Add accordion to release list and compact non-latest (#10910)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
release/v1.15
John Olheiser 2020-03-31 17:39:54 -05:00 committed by GitHub
parent 2c25e75dca
commit 36d9237e60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 23 deletions

View File

@ -14,7 +14,7 @@
{{end}} {{end}}
</h2> </h2>
<ul id="release-list"> <ul id="release-list">
{{range $release := .Releases}} {{range $idx, $release := .Releases}}
<li class="ui grid"> <li class="ui grid">
<div class="ui four wide column meta"> <div class="ui four wide column meta">
{{if .IsTag}} {{if .IsTag}}
@ -71,28 +71,35 @@
{{Str2html .Note}} {{Str2html .Note}}
</div> </div>
<div class="download"> <div class="download">
<h2>{{$.i18n.Tr "repo.release.downloads"}}</h2> <div class="ui accordion">
<ul class="list"> <h2 class="title {{if eq $idx 0}}active{{end}}">
{{if $.Permission.CanRead $.UnitTypeCode}} <i class="dropdown icon"></i>
<li> {{$.i18n.Tr "repo.release.downloads"}}
<a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (ZIP)</strong></a> </h2>
</li> <div class="content {{if eq $idx 0}}active{{end}}">
<li> <ul class="list">
<a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.tar.gz"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a> {{if $.Permission.CanRead $.UnitTypeCode}}
</li> <li>
{{end}} <a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (ZIP)</strong></a>
{{if .Attachments}} </li>
{{range .Attachments}} <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>
<span class="ui text right" data-tooltip="{{$.i18n.Tr "repo.release.download_count" (.DownloadCount | PrettyNumber)}}" data-position="bottom right">{{svg "octicon-info" 16}}</span> </li>
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}"> {{end}}
<strong><span class="ui image" title='{{.Name}}'>{{svg "octicon-package" 16}}</span> {{.Name}}</strong> {{if .Attachments}}
<span class="ui text grey right">{{.Size | FileSize}}</span> {{range .Attachments}}
</a> <li>
</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>
{{end}} <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
{{end}} <strong><span class="ui image" title='{{.Name}}'>{{svg "octicon-package" 16}}</span> {{.Name}}</strong>
</ul> <span class="ui text grey right">{{.Size | FileSize}}</span>
</a>
</li>
{{end}}
{{end}}
</ul>
</div>
</div>
</div> </div>
{{end}} {{end}}
<span class="dot">&nbsp;</span> <span class="dot">&nbsp;</span>