File tree Expand file tree Collapse file tree 5 files changed +261
-155
lines changed Expand file tree Collapse file tree 5 files changed +261
-155
lines changed Original file line number Diff line number Diff line change @@ -1032,7 +1032,7 @@ generate_repo = Generate Repository
10321032generate_from = Generate From
10331033repo_desc = Description
10341034repo_desc_helper = Enter short description (optional)
1035- repo_lang = Language
1035+ repo_lang = Languages
10361036repo_gitignore_helper = Select .gitignore templates.
10371037repo_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.
10381038issue_labels = Issue Labels
Original file line number Diff line number Diff 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+
905921func 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 {
You can’t perform that action at this time.
0 commit comments