Skip to content

Commit

Permalink
Add repository counter badge to repository tab (#24205)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jakob30061 authored Apr 19, 2023
1 parent eed6b28 commit 52b17bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions templates/org/menu.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -22,13 +25,13 @@
<a class="{{if $.PageIsOrgMembers}}active {{end}}item" href="{{$.OrgLink}}/members">
{{svg "octicon-person"}}&nbsp;{{$.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"}}&nbsp;{{$.locale.Tr "org.teams"}}
{{if .NumTeams}}
<div class="ui primary label">{{.NumTeams}}</div>
<div class="ui small label">{{.NumTeams}}</div>
{{end}}
</a>
{{end}}
Expand Down
5 changes: 4 additions & 1 deletion templates/user/profile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}
Expand All @@ -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}}
Expand Down

0 comments on commit 52b17bf

Please sign in to comment.