aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/user/overview/header.tmpl13
-rw-r--r--templates/user/profile.tmpl39
2 files changed, 14 insertions, 38 deletions
diff --git a/templates/user/overview/header.tmpl b/templates/user/overview/header.tmpl
index 10227a3ebd..6016aca447 100644
--- a/templates/user/overview/header.tmpl
+++ b/templates/user/overview/header.tmpl
@@ -1,6 +1,7 @@
<!-- TODO: make template org and user can share -->
-{{with .ContextUser}}
- <div class="ui container">
+{{if or (.IsPackagesPage) (.PageIsViewProjects)}}
+ {{with .ContextUser}}
+ <div class="ui container">
<div class="ui vertically grid head">
<div class="column">
<div class="ui header">
@@ -14,11 +15,17 @@
</div>
</div>
</div>
+ {{end}}
{{end}}
<div class="ui tabs container">
<div class="ui secondary stackable pointing menu">
- <a class="item" href="{{.ContextUser.HomeLink}}">
+ {{if .ProfileReadme}}
+ <a class='{{if or (eq .TabName "overview") (and (eq .TabName "") (not .IsPackagesPage) (not .PageIsViewProjects))}}active {{end}}item' href="{{.ContextUser.HomeLink}}?tab=overview">
+ {{svg "octicon-info"}} {{.locale.Tr "user.overview"}}
+ </a>
+ {{end}}
+ <a class="{{if or (eq .TabName "repositories") (and (eq .TabName "") (not .IsPackagesPage) (not .PageIsViewProjects) (not .ProfileReadme))}}active {{end}} item" href="{{.ContextUser.HomeLink}}?tab=repositories">
{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
{{if .ContextUser.NumRepos}}
<div class="ui small label">{{.ContextUser.NumRepos}}</div>
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index 431961089d..08e50fd0ce 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -121,40 +121,7 @@
</div>
<div class="ui eleven wide column">
<div class="ui secondary stackable pointing tight menu">
- <a class='{{if and (ne .TabName "activity") (ne .TabName "following") (ne .TabName "followers") (ne .TabName "stars") (ne .TabName "watching") (ne .TabName "projects") (ne .TabName "code")}}active {{end}}item' href="{{.ContextUser.HomeLink}}">
- {{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
- {{if .ContextUser.NumRepos}}
- <div class="ui small label">{{.ContextUser.NumRepos}}</div>
- {{end}}
- </a>
- <a href="{{.ContextUser.HomeLink}}/-/projects" class="{{if eq .TabName "projects"}}active {{end}}item">
- {{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
- </a>
- {{if .IsPackageEnabled}}
- <a class='{{if eq .TabName "packages"}}active {{end}}item' href="{{.ContextUser.HomeLink}}/-/packages">
- {{svg "octicon-package"}} {{.locale.Tr "packages.title"}}
- </a>
- {{end}}
- {{if and (not $.UnitTypeCode.UnitGlobalDisabled) .IsRepoIndexerEnabled}}
- <a class='{{if eq .TabName "code"}}active {{end}}item' href="{{.ContextUser.HomeLink}}/-/code">
- {{svg "octicon-code"}} {{.locale.Tr "user.code"}}
- </a>
- {{end}}
- <a class='{{if eq .TabName "activity"}}active {{end}}item' href="{{.ContextUser.HomeLink}}?tab=activity">
- {{svg "octicon-rss"}} {{.locale.Tr "user.activity"}}
- </a>
- {{if not .DisableStars}}
- <a class='{{if eq .TabName "stars"}}active {{end}}item' href="{{.ContextUser.HomeLink}}?tab=stars">
- {{svg "octicon-star"}} {{.locale.Tr "user.starred"}}
- {{if .ContextUser.NumStars}}
- <div class="ui small label">{{.ContextUser.NumStars}}</div>
- {{end}}
- </a>
- {{else}}
- <a class='{{if eq .TabName "watching"}}active {{end}}item' href="{{.ContextUser.HomeLink}}?tab=watching">
- {{svg "octicon-eye"}} {{.locale.Tr "user.watched"}}
- </a>
- {{end}}
+ {{template "user/overview/header" .}}
</div>
{{if eq .TabName "activity"}}
@@ -177,10 +144,12 @@
{{template "repo/user_cards" .}}
{{else if eq .TabName "followers"}}
{{template "repo/user_cards" .}}
- {{else}}
+ {{else if or (eq .TabName "repositories") (not .ProfileReadme)}}
{{template "explore/repo_search" .}}
{{template "explore/repo_list" .}}
{{template "base/paginate" .}}
+ {{else if .ProfileReadme}}
+ <div id="readme_profile" class="render-content markup"> {{$.ProfileReadme|Str2html}} </div>
{{end}}
</div>
</div>