Bläddra i källkod

Tags cleanup (#13428)

* Tags cleanup

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* fmt

Signed-off-by: jolheiser <john.olheiser@gmail.com>
tags/v1.15.0-dev
John Olheiser 3 år sedan
förälder
incheckning
7c68ac8f7d
Inget konto är kopplat till bidragsgivarens mejladress
3 ändrade filer med 9 tillägg och 4 borttagningar
  1. 7
    3
      modules/context/repo.go
  2. 1
    0
      options/locale/locale_en-US.ini
  3. 1
    1
      templates/repo/sub_menu.tmpl

+ 7
- 3
modules/context/repo.go Visa fil

@@ -449,14 +449,18 @@ func RepoAssignment() macaron.Handler {
ctx.Data["RepoExternalIssuesLink"] = unit.ExternalTrackerConfig().ExternalTrackerURL
}

ctx.Data["NumReleases"], err = models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{
IncludeDrafts: false,
IncludeTags: true,
ctx.Data["NumTags"], err = models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{
IncludeTags: true,
})
if err != nil {
ctx.ServerError("GetReleaseCountByRepoID", err)
return
}
ctx.Data["NumReleases"], err = models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{})
if err != nil {
ctx.ServerError("GetReleaseCountByRepoID", err)
return
}

ctx.Data["Title"] = owner.Name + "/" + repo.Name
ctx.Data["Repository"] = repo

+ 1
- 0
options/locale/locale_en-US.ini Visa fil

@@ -810,6 +810,7 @@ commits = Commits
commit = Commit
release = Release
releases = Releases
tag = Tag
released_this = released this
file_raw = Raw
file_history = History

+ 1
- 1
templates/repo/sub_menu.tmpl Visa fil

@@ -10,7 +10,7 @@
</div>
{{if $.Permission.CanRead $.UnitTypeCode}}
<div class="item">
<a class="ui" href="{{.RepoLink}}/tags">{{svg "octicon-tag"}} <b>{{.NumReleases}}</b> {{.i18n.Tr (TrN .i18n.Lang .NumReleases "repo.release" "repo.releases") }}</a>
<a class="ui" href="{{.RepoLink}}/tags">{{svg "octicon-tag"}} <b>{{.NumTags}}</b> {{.i18n.Tr (TrN .i18n.Lang .NumTags "repo.tag" "repo.tags") }}</a>
</div>
{{end}}
<div class="item">

Laddar…
Avbryt
Spara