diff --git a/template/functions.go b/template/functions.go index 7fff2eac..33519e95 100644 --- a/template/functions.go +++ b/template/functions.go @@ -80,6 +80,13 @@ func (f *funcMap) Map() template.FuncMap { "theme_color": func(theme string) string { return model.ThemeColor(theme) }, + "icon": func(iconName string) template.HTML { + return template.HTML(fmt.Sprintf( + ``, + route.Path(f.router, "appIcon", "filename", "sprite.svg"), + iconName, + )) + }, // These functions are overrided at runtime after the parsing. "elapsed": func(timezone string, t time.Time) string { diff --git a/template/templates/common/feed_list.html b/template/templates/common/feed_list.html index 27116a36..5825d216 100644 --- a/template/templates/common/feed_list.html +++ b/template/templates/common/feed_list.html @@ -28,10 +28,10 @@
diff --git a/template/templates/common/icons.html b/template/templates/common/icons.html deleted file mode 100644 index 0b82a3b3..00000000 --- a/template/templates/common/icons.html +++ /dev/null @@ -1,135 +0,0 @@ - -{{ define "icon_read" }} - -{{ end }} -{{ define "icon_unread" }} - -{{ end }} -{{ define "icon_star" }} - -{{ end }} -{{ define "icon_unstar" }} - -{{ end }} -{{ define "icon_save" }} - -{{ end }} -{{ define "icon_scraper" }} - -{{ end }} -{{ define "icon_share" }} - -{{ end }} -{{ define "icon_comment" }} - -{{ end }} -{{ define "icon_external_link" }} - -{{ end }} -{{ define "icon_delete" }} - -{{ end }} -{{ define "icon_edit" }} - -{{ end }} -{{ define "icon_feeds" }} - -{{ end }} -{{ define "icon_entries" }} - -{{ end }} -{{ define "icon_refresh" }} - -{{ end }} \ No newline at end of file diff --git a/template/templates/common/item_meta.html b/template/templates/common/item_meta.html index e2991ff8..c4f4f4bb 100644 --- a/template/templates/common/item_meta.html +++ b/template/templates/common/item_meta.html @@ -23,7 +23,7 @@ data-label-read="{{ t "entry.status.read" }}" data-label-unread="{{ t "entry.status.unread" }}" data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}" - >{{ if eq .entry.Status "read" }}{{ template "icon_unread" }}{{ else }}{{ template "icon_read" }}{{ end }}{{ if eq .entry.Status "read" }}{{ t "entry.status.unread" }}{{ else }}{{ t "entry.status.read" }}{{ end }} + >{{ if eq .entry.Status "read" }}{{ icon "unread" }}{{ else }}{{ icon "read" }}{{ end }}{{ if eq .entry.Status "read" }}{{ t "entry.status.unread" }}{{ else }}{{ t "entry.status.read" }}{{ end }}