diff options
author | John Olheiser <john.olheiser@gmail.com> | 2020-03-31 17:39:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 17:39:54 -0500 |
commit | 36d9237e60441362684f9f297855662099bc5498 (patch) | |
tree | 96645ed3ddc6a7d8d5a77e000f5f47ab0991c15e /templates | |
parent | 2c25e75dca62850ddc328ed46c7b7d27b61be90b (diff) | |
download | gitea-36d9237e60441362684f9f297855662099bc5498.tar.gz gitea-36d9237e60441362684f9f297855662099bc5498.zip |
Add accordion to release list and compact non-latest (#10910)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/release/list.tmpl | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index eb3b043238..22aea09f7b 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -14,7 +14,7 @@ {{end}} </h2> <ul id="release-list"> - {{range $release := .Releases}} + {{range $idx, $release := .Releases}} <li class="ui grid"> <div class="ui four wide column meta"> {{if .IsTag}} @@ -71,28 +71,35 @@ {{Str2html .Note}} </div> <div class="download"> - <h2>{{$.i18n.Tr "repo.release.downloads"}}</h2> - <ul class="list"> - {{if $.Permission.CanRead $.UnitTypeCode}} - <li> - <a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (ZIP)</strong></a> - </li> - <li> - <a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.tar.gz"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a> - </li> - {{end}} - {{if .Attachments}} - {{range .Attachments}} - <li> - <span class="ui text right" data-tooltip="{{$.i18n.Tr "repo.release.download_count" (.DownloadCount | PrettyNumber)}}" data-position="bottom right">{{svg "octicon-info" 16}}</span> - <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}"> - <strong><span class="ui image" title='{{.Name}}'>{{svg "octicon-package" 16}}</span> {{.Name}}</strong> - <span class="ui text grey right">{{.Size | FileSize}}</span> - </a> - </li> - {{end}} - {{end}} - </ul> + <div class="ui accordion"> + <h2 class="title {{if eq $idx 0}}active{{end}}"> + <i class="dropdown icon"></i> + {{$.i18n.Tr "repo.release.downloads"}} + </h2> + <div class="content {{if eq $idx 0}}active{{end}}"> + <ul class="list"> + {{if $.Permission.CanRead $.UnitTypeCode}} + <li> + <a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (ZIP)</strong></a> + </li> + <li> + <a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.tar.gz"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a> + </li> + {{end}} + {{if .Attachments}} + {{range .Attachments}} + <li> + <span class="ui text right" data-tooltip="{{$.i18n.Tr "repo.release.download_count" (.DownloadCount | PrettyNumber)}}" data-position="bottom right">{{svg "octicon-info" 16}}</span> + <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}"> + <strong><span class="ui image" title='{{.Name}}'>{{svg "octicon-package" 16}}</span> {{.Name}}</strong> + <span class="ui text grey right">{{.Size | FileSize}}</span> + </a> + </li> + {{end}} + {{end}} + </ul> + </div> + </div> </div> {{end}} <span class="dot"> </span> |