M cmd/links/main.go => cmd/links/main.go +3 -0
@@ 235,6 235,9 @@ func run() error {
// Convert penies to dollar amount
return links.FromPenniesToFloat(amt)
},
+ "isTagUsedInFilter": func(tag string, activeTags string) bool {
+ return strings.Contains(activeTags, tag)
+ },
})
err = srv.LoadTemplatesFS(links.TemplateFS, "templates/*.html", "templates/*.txt")
if err != nil {
M templates/link_list.html => templates/link_list.html +7 -2
@@ 27,7 27,7 @@
<div class="d-none autocomplete-tags"></div>
</div>
<p class="mt-1 pull-right">
- <a href="#" class="button primary is-small">{{.pd.Data.clear}}</a>
+ <a href="{{reverse "core:home_link_list"}}" class="button primary is-small">{{.pd.Data.clear}}</a>
<button type="submit" class="button primary is-small">{{.pd.Data.apply}}</button>
</p>
</div>
@@ 145,7 145,12 @@
{{if .Tags}}
<div class="link-tag mt-1">
{{range .Tags}}
- <a class="link-tag__item link-tag__item--simple" href="{{if $.tagFilter}}?tag={{$.tagFilter}},{{.Slug}}{{else}}?tag={{.Slug}}{{end}}">#{{.Name}}</a>
+ {{if isTagUsedInFilter .Name $.tagFilter}}
+ <small class="link-tag__item link-tag__item--simple">#{{.Name}}</small>
+ {{else}}
+ <a class="link-tag__item link-tag__item--simple"
+ href="{{if $.tagFilter}}?tag={{$.tagFilter}},{{.Slug}}{{if $.excludeTagFilter}}&exclude={{$.excludeTagFilter}}{{end}}{{else}}?tag={{.Slug}}{{if $.excludeTagFilter}}&exclude={{$.excludeTagFilter}}{{end}}{{end}}">#{{.Name}}</a>
+ {{end}}
{{end}}
</div>
{{end}}