diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2021-11-18 00:50:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 23:50:17 +0000 |
commit | ea42d3c04ef48b9ff0354ea196179d1a5025c04a (patch) | |
tree | 8a95df877dae7a5cf62364a525cc532205d5d188 /templates | |
parent | 3c4724d70e4ac7bfc06b97f6fad8936f97479b6b (diff) | |
download | gitea-ea42d3c04ef48b9ff0354ea196179d1a5025c04a.tar.gz gitea-ea42d3c04ef48b9ff0354ea196179d1a5025c04a.zip |
Fixed commit count. (#17698)
Added "Tag" label.
Unified branch, tag and commit name.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/branch_dropdown.tmpl | 10 | ||||
-rw-r--r-- | templates/repo/commits_table.tmpl | 9 | ||||
-rw-r--r-- | templates/repo/sub_menu.tmpl | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index a2115729b2..a6120483b5 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -7,9 +7,9 @@ {{if $release}} {{.root.i18n.Tr "repo.release.compare"}} {{else}} - {{svg "octicon-git-branch"}} - {{if .root.IsViewBranch}}{{.root.i18n.Tr "repo.branch"}}{{else}}{{.root.i18n.Tr "repo.tree"}}{{end}}: - <strong>{{if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.BranchName}}{{end}}</strong> + {{if .root.IsViewTag}}{{svg "octicon-tag"}}{{else}}{{svg "octicon-git-branch"}}{{end}} + {{if .root.IsViewBranch}}{{.root.i18n.Tr "repo.branch"}}{{else if .root.IsViewTag}}{{.root.i18n.Tr "repo.tag"}}{{else}}{{.root.i18n.Tr "repo.tree"}}{{end}}: + <strong>{{if .root.IsViewBranch}}{{.root.BranchName}}{{else if .root.IsViewTag}}{{.root.TagName}}{{else}}{{ShortSha .root.CommitID}}{{end}}</strong> {{end}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} @@ -66,8 +66,10 @@ <div class="text small"> {{if or .root.IsViewBranch $release}} {{.root.i18n.Tr "repo.branch.create_from" .root.BranchName}} + {{else if .root.IsViewTag}} + {{.root.i18n.Tr "repo.branch.create_from" .root.TagName}} {{else}} - {{.root.i18n.Tr "repo.branch.create_from" (ShortSha .root.BranchName)}} + {{.root.i18n.Tr "repo.branch.create_from" (ShortSha .root.CommitID)}} {{end}} </div> </a> diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 4871b688a7..edd5f7285a 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -1,12 +1,11 @@ <h4 class="ui top attached header commits-table df ac sb"> <div class="commits-table-left df ac"> {{if or .PageIsCommits (gt .CommitCount 0)}} - {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .Branch}}({{.Branch}}){{end}} - {{else if .IsNothingToCompare }} - {{.i18n.Tr "repo.commits.nothing_to_compare" }} {{if .Branch}}({{.Branch}}){{end}} - + {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .RefName}}({{.RefName}}){{end}} + {{else if .IsNothingToCompare}} + {{.i18n.Tr "repo.commits.nothing_to_compare" }} {{if .RefName}}({{.RefName}}){{end}} {{else}} - {{.i18n.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch }} {{if .Branch}}({{.Branch}}){{end}} + {{.i18n.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} {{if .RefName}}({{.RefName}}){{end}} {{end}} </div> <div class="commits-table-right df ac"> diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl index 3b05708c74..1fec6dcec1 100644 --- a/templates/repo/sub_menu.tmpl +++ b/templates/repo/sub_menu.tmpl @@ -3,7 +3,7 @@ <div class="ui two horizontal center link list"> {{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo)}} <div class="item{{if .PageIsCommits}} active{{end}}"> - <a class="ui" href="{{.RepoLink}}/commits{{if .IsViewBranch}}/branch{{else if .IsViewTag}}/tag{{else if .IsViewCommit}}/commit{{end}}/{{PathEscapeSegments .BranchName}}">{{svg "octicon-history"}} <b>{{.CommitsCount}}</b> {{.i18n.Tr (TrN .i18n.Lang .CommitsCount "repo.commit" "repo.commits") }}</a> + <a class="ui" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}">{{svg "octicon-history"}} <b>{{.CommitsCount}}</b> {{.i18n.Tr (TrN .i18n.Lang .CommitsCount "repo.commit" "repo.commits") }}</a> </div> <div class="item{{if .PageIsBranches}} active{{end}}"> <a class="ui" href="{{.RepoLink}}/branches">{{svg "octicon-git-branch"}} <b>{{.BranchesCount}}</b> {{.i18n.Tr (TrN .i18n.Lang .BranchesCount "repo.branch" "repo.branches") }}</a> |