Skip to content

Commit 83fe8c9

Browse files
committed
wip
1 parent f4b8f6f commit 83fe8c9

File tree

5 files changed

+261
-155
lines changed

5 files changed

+261
-155
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ generate_repo = Generate Repository
10321032
generate_from = Generate From
10331033
repo_desc = Description
10341034
repo_desc_helper = Enter short description (optional)
1035-
repo_lang = Language
1035+
repo_lang = Languages
10361036
repo_gitignore_helper = Select .gitignore templates.
10371037
repo_gitignore_helper_desc = Choose which files not to track from a list of templates for common languages. Typical artifacts generated by each language's build tools are included on .gitignore by default.
10381038
issue_labels = Issue Labels

routers/web/repo/view.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,22 @@ func renderLanguageStats(ctx *context.Context) {
902902
ctx.Data["LanguageStats"] = langs
903903
}
904904

905+
func renderLatestRelease(ctx *context.Context) {
906+
release, err := repo_model.GetLatestReleaseByRepoID(ctx, ctx.Repo.Repository.ID)
907+
if err != nil && !repo_model.IsErrReleaseNotExist(err) {
908+
ctx.ServerError("GetLatestReleaseByRepoID", err)
909+
return
910+
}
911+
912+
if release != nil {
913+
if err = release.LoadAttributes(ctx); err != nil {
914+
ctx.ServerError("release.LoadAttributes", err)
915+
return
916+
}
917+
ctx.Data["LatestRelease"] = release
918+
}
919+
}
920+
905921
func renderRepoTopics(ctx *context.Context) {
906922
topics, err := db.Find[repo_model.Topic](ctx, &repo_model.FindTopicOptions{
907923
RepoID: ctx.Repo.Repository.ID,
@@ -1014,6 +1030,11 @@ func renderHomeCode(ctx *context.Context) {
10141030
return
10151031
}
10161032

1033+
renderLatestRelease(ctx)
1034+
if ctx.Written() {
1035+
return
1036+
}
1037+
10171038
if entry.IsDir() {
10181039
renderDirectory(ctx)
10191040
} else {

0 commit comments

Comments
 (0)