diff options
author | Lauris BH <lauris@nix.lv> | 2017-09-20 08:26:49 +0300 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-09-20 13:26:49 +0800 |
commit | 7a0297819d3aececb8b633de5a2995c40b7bfcae (patch) | |
tree | 7aed967ad21f95df2b16359ec1551662d653a1fd /templates/repo/release/list.tmpl | |
parent | 8b6236d67b21f2a3291207ef77d103a3ce7476ba (diff) | |
download | gitea-7a0297819d3aececb8b633de5a2995c40b7bfcae.tar.gz gitea-7a0297819d3aececb8b633de5a2995c40b7bfcae.zip |
Sync releases table with tags on push and for mirrors (#2459)
* Sync releases table with tags on push and for mirrors
* Code style fixes
* Fix api to return only releases
* Optimize release creation and update
Minimize posibility of race conditions
* Fix release lower tag name updating
* handle tag reference update by addionally comparing commit id
Diffstat (limited to 'templates/repo/release/list.tmpl')
-rw-r--r-- | templates/repo/release/list.tmpl | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index c18bc4884d..9106bba9b3 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -17,7 +17,9 @@ {{range .Releases}} <li class="ui grid"> <div class="ui four wide column meta"> - {{if .PublisherID}} + {{if .IsTag}} + {{if .Created}}<span class="time">{{TimeSince .Created $.Lang}}</span>{{end}} + {{else}} {{if .IsDraft}} <span class="ui yellow label">{{$.i18n.Tr "repo.release.draft"}}</span> {{else if .IsPrerelease}} @@ -28,13 +30,22 @@ <span class="tag text blue"> <a href="{{$.RepoLink}}/src/{{.TagName}}" rel="nofollow"><i class="tag icon"></i> {{.TagName}}</a> </span> + <span class="commit"> + <a href="{{$.RepoLink}}/src/{{.Sha1}}" rel="nofollow"><i class="code icon"></i> {{ShortSha .Sha1}}</a> + </span> {{end}} - <span class="commit"> - <a href="{{$.RepoLink}}/src/{{.Sha1}}" rel="nofollow"><i class="code icon"></i> {{ShortSha .Sha1}}</a> - </span> </div> <div class="ui twelve wide column detail"> - {{if .PublisherID}} + {{if .IsTag}} + <h4> + <a href="{{$.RepoLink}}/src/{{.TagName}}" rel="nofollow"><i class="tag icon"></i> {{.TagName}}</a> + </h4> + <div class="download"> + <a href="{{$.RepoLink}}/src/{{.Sha1}}" rel="nofollow"><i class="code icon"></i> {{ShortSha .Sha1}}</a> + <a href="{{$.RepoLink}}/archive/{{.TagName}}.zip" rel="nofollow"><i class="octicon octicon-file-zip"></i> ZIP</a> + <a href="{{$.RepoLink}}/archive/{{.TagName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a> + </div> + {{else}} <h3> <a href="{{$.RepoLink}}/src/{{.TagName}}">{{.Title}}</a> {{if $.IsRepositoryWriter}}<small>(<a href="{{$.RepoLink}}/releases/edit/{{.TagName}}" rel="nofollow">{{$.i18n.Tr "repo.release.edit"}}</a>)</small>{{end}} @@ -70,14 +81,6 @@ {{end}} </ul> </div> - {{else}} - <h4> - <a href="{{$.RepoLink}}/src/{{.TagName}}" rel="nofollow"><i class="tag icon"></i> {{.TagName}}</a> - </h4> - <div class="download"> - <a href="{{$.RepoLink}}/archive/{{.TagName}}.zip" rel="nofollow"><i class="octicon octicon-file-zip"></i> ZIP</a> - <a href="{{$.RepoLink}}/archive/{{.TagName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a> - </div> {{end}} <span class="dot"> </span> </div> |