mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 09:17:41 +01:00
Add repository counter badge to repository tab (#24205)
Add a new badge to the repository tab for users and organizations. The badge is only visible if a repo exists. Change the badge color of existing "Starred Repositories". (from primary to small) Closes #24188
This commit is contained in:
parent
eed6b28fc0
commit
52b17bfa07
2 changed files with 9 additions and 3 deletions
|
@ -2,6 +2,9 @@
|
|||
<div class="ui secondary stackable pointing menu">
|
||||
<a class="{{if .PageIsViewRepositories}}active {{end}}item" href="{{$.Org.HomeLink}}">
|
||||
{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
|
||||
{{if .Owner.NumRepos}}
|
||||
<div class="ui small label">{{.Owner.NumRepos}}</div>
|
||||
{{end}}
|
||||
</a>
|
||||
{{if and .IsProjectEnabled .CanReadProjects}}
|
||||
<a class="{{if .PageIsViewProjects}}active {{end}}item" href="{{$.Org.HomeLink}}/-/projects">
|
||||
|
@ -22,13 +25,13 @@
|
|||
<a class="{{if $.PageIsOrgMembers}}active {{end}}item" href="{{$.OrgLink}}/members">
|
||||
{{svg "octicon-person"}} {{$.locale.Tr "org.members"}}
|
||||
{{if .NumMembers}}
|
||||
<div class="ui primary label">{{.NumMembers}}</div>
|
||||
<div class="ui small label">{{.NumMembers}}</div>
|
||||
{{end}}
|
||||
</a>
|
||||
<a class="{{if $.PageIsOrgTeams}}active {{end}}item" href="{{$.OrgLink}}/teams">
|
||||
{{svg "octicon-people"}} {{$.locale.Tr "org.teams"}}
|
||||
{{if .NumTeams}}
|
||||
<div class="ui primary label">{{.NumTeams}}</div>
|
||||
<div class="ui small label">{{.NumTeams}}</div>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
|
|
@ -123,6 +123,9 @@
|
|||
<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="{{.Owner.HomeLink}}">
|
||||
{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
|
||||
{{if .Owner.NumRepos}}
|
||||
<div class="ui small label">{{.Owner.NumRepos}}</div>
|
||||
{{end}}
|
||||
</a>
|
||||
<a href="{{.Owner.HomeLink}}/-/projects" class="{{if eq .TabName "projects"}}active {{end}}item">
|
||||
{{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
|
||||
|
@ -144,7 +147,7 @@
|
|||
<a class='{{if eq .TabName "stars"}}active {{end}}item' href="{{.Owner.HomeLink}}?tab=stars">
|
||||
{{svg "octicon-star"}} {{.locale.Tr "user.starred"}}
|
||||
{{if .Owner.NumStars}}
|
||||
<div class="ui primary label">{{.Owner.NumStars}}</div>
|
||||
<div class="ui small label">{{.Owner.NumStars}}</div>
|
||||
{{end}}
|
||||
</a>
|
||||
{{else}}
|
||||
|
|
Loading…
Reference in a new issue