aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2020-05-17 14:50:42 -0700
committerAlec Warner <antarus@gentoo.org>2020-05-17 14:50:42 -0700
commit976a1d85db9d08b7f59dd7bdc5cda26be2901eb4 (patch)
tree6125757a59512a367416c88114b0961776d5dcb6 /web
parentAdd gorilla feeds. (diff)
downloadsoko-976a1d85db9d08b7f59dd7bdc5cda26be2901eb4.tar.gz
soko-976a1d85db9d08b7f59dd7bdc5cda26be2901eb4.tar.bz2
soko-976a1d85db9d08b7f59dd7bdc5cda26be2901eb4.zip
Packages should print out different USE_EXPAND sources.
Extend GetPackageUseflags to return a map instead of a list. Keys are USE_EXPAND categories, and values are the flags. Fix json and useflag templates to properly emit the flags. Signed-off-by: Alec Warner <antarus@gentoo.org>
Diffstat (limited to 'web')
-rw-r--r--web/templates/packages/useflag.tmpl9
1 files changed, 5 insertions, 4 deletions
diff --git a/web/templates/packages/useflag.tmpl b/web/templates/packages/useflag.tmpl
index db4bf07..a1940e1 100644
--- a/web/templates/packages/useflag.tmpl
+++ b/web/templates/packages/useflag.tmpl
@@ -26,14 +26,15 @@
{{ if .UseExpands }}
- <!-- TODO group by -->
- <span class="kk-useflag-group">{{ (index .UseExpands 0).UseExpand}} (Use Expand)</span>
- <ul class="kk-useflag-container {{ if ge (len .UseExpands) 10 }}kk-useflag-container-many{{else}}kk-useflag-container-few{{end}}">
- {{range .UseExpands}}
+ {{range $key, $flags := .UseExpands}}
+ <span class="kk-useflag-group">{{ $key }} (Use Expand)</span>
+ <ul class="kk-useflag-container {{ if ge (len $flags) 10 }}kk-useflag-container-many{{else}}kk-useflag-container-few{{end}}">
+ {{range $flags}}
<li class="kk-useflag">
<a title="{{.Description}}" data-toggle="tooltip" href="/useflags/{{.Name}}">{{ replaceall .Name (print .UseExpand "_") "" }}</a>
</li>
{{end}}
</ul>
+ {{end}}
{{end}}
{{end}}