Skip to content

Commit 36d9237

Browse files
authored
Add accordion to release list and compact non-latest (#10910)
Signed-off-by: jolheiser <[email protected]>
1 parent 2c25e75 commit 36d9237

File tree

1 file changed

+30
-23
lines changed

1 file changed

+30
-23
lines changed

templates/repo/release/list.tmpl

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{{end}}
1515
</h2>
1616
<ul id="release-list">
17-
{{range $release := .Releases}}
17+
{{range $idx, $release := .Releases}}
1818
<li class="ui grid">
1919
<div class="ui four wide column meta">
2020
{{if .IsTag}}
@@ -71,28 +71,35 @@
7171
{{Str2html .Note}}
7272
</div>
7373
<div class="download">
74-
<h2>{{$.i18n.Tr "repo.release.downloads"}}</h2>
75-
<ul class="list">
76-
{{if $.Permission.CanRead $.UnitTypeCode}}
77-
<li>
78-
<a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (ZIP)</strong></a>
79-
</li>
80-
<li>
81-
<a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.tar.gz"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a>
82-
</li>
83-
{{end}}
84-
{{if .Attachments}}
85-
{{range .Attachments}}
86-
<li>
87-
<span class="ui text right" data-tooltip="{{$.i18n.Tr "repo.release.download_count" (.DownloadCount | PrettyNumber)}}" data-position="bottom right">{{svg "octicon-info" 16}}</span>
88-
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
89-
<strong><span class="ui image" title='{{.Name}}'>{{svg "octicon-package" 16}}</span> {{.Name}}</strong>
90-
<span class="ui text grey right">{{.Size | FileSize}}</span>
91-
</a>
92-
</li>
93-
{{end}}
94-
{{end}}
95-
</ul>
74+
<div class="ui accordion">
75+
<h2 class="title {{if eq $idx 0}}active{{end}}">
76+
<i class="dropdown icon"></i>
77+
{{$.i18n.Tr "repo.release.downloads"}}
78+
</h2>
79+
<div class="content {{if eq $idx 0}}active{{end}}">
80+
<ul class="list">
81+
{{if $.Permission.CanRead $.UnitTypeCode}}
82+
<li>
83+
<a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (ZIP)</strong></a>
84+
</li>
85+
<li>
86+
<a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.tar.gz"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a>
87+
</li>
88+
{{end}}
89+
{{if .Attachments}}
90+
{{range .Attachments}}
91+
<li>
92+
<span class="ui text right" data-tooltip="{{$.i18n.Tr "repo.release.download_count" (.DownloadCount | PrettyNumber)}}" data-position="bottom right">{{svg "octicon-info" 16}}</span>
93+
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
94+
<strong><span class="ui image" title='{{.Name}}'>{{svg "octicon-package" 16}}</span> {{.Name}}</strong>
95+
<span class="ui text grey right">{{.Size | FileSize}}</span>
96+
</a>
97+
</li>
98+
{{end}}
99+
{{end}}
100+
</ul>
101+
</div>
102+
</div>
96103
</div>
97104
{{end}}
98105
<span class="dot">&nbsp;</span>

0 commit comments

Comments
 (0)