From fad9ad2be4fc800f8710e2a498cc8f536af8827c Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 17 Nov 2019 19:44:12 -0800 Subject: Display list of feeds per category --- template/common.go | 57 ++++++++++++++++++ template/html/categories.html | 9 +-- template/html/category_entries.html | 3 + template/html/category_feeds.html | 34 +++++++++++ template/html/common/feed_list.html | 56 +++++++++++++++++ template/html/edit_category.html | 5 +- template/html/feeds.html | 55 +---------------- template/views.go | 116 ++++++++++++++++-------------------- 8 files changed, 207 insertions(+), 128 deletions(-) create mode 100644 template/html/category_feeds.html create mode 100644 template/html/common/feed_list.html (limited to 'template') diff --git a/template/common.go b/template/common.go index 574e4e1..2539cad 100644 --- a/template/common.go +++ b/template/common.go @@ -21,6 +21,62 @@ var templateCommonMap = map[string]string{ {{ end }} +{{ end }}`, + "feed_list": `{{ define "feed_list" }} +
+ {{ range .feeds }} +
+
+ + {{ if .Icon }} + {{ .Title }} + {{ end }} + {{ if .Disabled }} 🚫 {{ end }} + {{ .Title }} + + + ({{ .UnreadCount }}/{{ .ReadCount }}) + + + {{ .Category.Title }} + +
+
+
    +
  • + {{ domain .SiteURL }} +
  • +
  • + {{ t "page.feeds.last_check" }} +
  • +
+ +
+ {{ if ne .ParsingErrorCount 0 }} +
+ {{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }} + - {{ .ParsingErrorMsg }} +
+ {{ end }} +
+ {{ end }} +
{{ end }}`, "item_meta": `{{ define "item_meta" }}
@@ -274,6 +330,7 @@ var templateCommonMap = map[string]string{ var templateCommonMapChecksums = map[string]string{ "entry_pagination": "4faa91e2eae150c5e4eab4d258e039dfdd413bab7602f0009360e6d52898e353", + "feed_list": "7b7ea2c7df07d048c83d86237d5b5e41bddce561273c652d9265950093ca261b", "item_meta": "34deb081a054f2948ad808bdb2c8603d6ab00c58f2f50c4ead0b47ae092888eb", "layout": "010e31c9dde88cb429b21f4b0c24bb3769043a3ef1ef4a57100314f5910c8725", "pagination": "3386e90c6e1230311459e9a484629bc5d5bf39514a75ef2e73bbbc61142f7abb", diff --git a/template/html/categories.html b/template/html/categories.html index b534ba1..4be3c2f 100644 --- a/template/html/categories.html +++ b/template/html/categories.html @@ -20,18 +20,13 @@ {{ .Title }} + ({{ .FeedCount }})
- diff --git a/template/html/category_feeds.html b/template/html/category_feeds.html new file mode 100644 index 0000000..b903256 --- /dev/null +++ b/template/html/category_feeds.html @@ -0,0 +1,34 @@ +{{ define "title"}}{{ .category.Title }} > {{ t "page.feeds.title" }} ({{ .total }}){{ end }} + +{{ define "content"}} + + +{{ if not .feeds }} +

{{ t "alert.no_feed_in_category" }}

+{{ else }} + {{ template "feed_list" dict "user" .user "feeds" .feeds "ParsingErrorCount" .ParsingErrorCount }} +{{ end }} + +{{ end }} diff --git a/template/html/common/feed_list.html b/template/html/common/feed_list.html new file mode 100644 index 0000000..cb80a1f --- /dev/null +++ b/template/html/common/feed_list.html @@ -0,0 +1,56 @@ +{{ define "feed_list" }} +
+ {{ range .feeds }} +
+
+ + {{ if .Icon }} + {{ .Title }} + {{ end }} + {{ if .Disabled }} 🚫 {{ end }} + {{ .Title }} + + + ({{ .UnreadCount }}/{{ .ReadCount }}) + + + {{ .Category.Title }} + +
+
+
    +
  • + {{ domain .SiteURL }} +
  • +
  • + {{ t "page.feeds.last_check" }} +
  • +
+ +
+ {{ if ne .ParsingErrorCount 0 }} +
+ {{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }} + - {{ .ParsingErrorMsg }} +
+ {{ end }} +
+ {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/template/html/edit_category.html b/template/html/edit_category.html index 6b21e46..3506e45 100644 --- a/template/html/edit_category.html +++ b/template/html/edit_category.html @@ -7,6 +7,9 @@
  • {{ t "menu.categories" }}
  • +
  • + {{ t "menu.feeds" }} +
  • {{ t "menu.create_category" }}
  • @@ -24,7 +27,7 @@
    - {{ t "action.or" }} {{ t "action.cancel" }} +
    {{ end }} diff --git a/template/html/feeds.html b/template/html/feeds.html index 7d4a428..e4d24bf 100644 --- a/template/html/feeds.html +++ b/template/html/feeds.html @@ -22,60 +22,7 @@ {{ if not .feeds }}

    {{ t "alert.no_feed" }}

    {{ else }} -
    - {{ range .feeds }} -
    -
    - - {{ if .Icon }} - {{ .Title }} - {{ end }} - {{ if .Disabled }} 🚫 {{ end }} - {{ .Title }} - - - ({{ .UnreadCount }}/{{ .ReadCount }}) - - - {{ .Category.Title }} - -
    -
    -
      -
    • - {{ domain .SiteURL }} -
    • -
    • - {{ t "page.feeds.last_check" }} -
    • -
    - -
    - {{ if ne .ParsingErrorCount 0 }} -
    - {{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }} - - {{ .ParsingErrorMsg }} -
    - {{ end }} -
    - {{ end }} -
    + {{ template "feed_list" dict "user" .user "feeds" .feeds "ParsingErrorCount" .ParsingErrorCount }} {{ end }} {{ end }} diff --git a/template/views.go b/template/views.go index 788e2f5..c4fadb4 100644 --- a/template/views.go +++ b/template/views.go @@ -151,18 +151,13 @@ var templateViewsMap = map[string]string{ {{ .Title }} + ({{ .FeedCount }})
    - @@ -252,6 +250,41 @@ var templateViewsMap = map[string]string{ {{ template "pagination" .pagination }} {{ end }} +{{ end }} +`, + "category_feeds": `{{ define "title"}}{{ .category.Title }} > {{ t "page.feeds.title" }} ({{ .total }}){{ end }} + +{{ define "content"}} + + +{{ if not .feeds }} +

    {{ t "alert.no_feed_in_category" }}

    +{{ else }} + {{ template "feed_list" dict "user" .user "feeds" .feeds "ParsingErrorCount" .ParsingErrorCount }} +{{ end }} + {{ end }} `, "choose_subscription": `{{ define "title"}}{{ t "page.add_feed.title" }}{{ end }} @@ -366,6 +399,9 @@ var templateViewsMap = map[string]string{
  • {{ t "menu.categories" }}
  • +
  • + {{ t "menu.feeds" }} +
  • {{ t "menu.create_category" }}
  • @@ -383,7 +419,7 @@ var templateViewsMap = map[string]string{
    - {{ t "action.or" }} {{ t "action.cancel" }} +
    {{ end }} @@ -778,60 +814,7 @@ var templateViewsMap = map[string]string{ {{ if not .feeds }}

    {{ t "alert.no_feed" }}

    {{ else }} -
    - {{ range .feeds }} -
    -
    - - {{ if .Icon }} - {{ .Title }} - {{ end }} - {{ if .Disabled }} 🚫 {{ end }} - {{ .Title }} - - - ({{ .UnreadCount }}/{{ .ReadCount }}) - - - {{ .Category.Title }} - -
    -
    -
      -
    • - {{ domain .SiteURL }} -
    • -
    • - {{ t "page.feeds.last_check" }} -
    • -
    - -
    - {{ if ne .ParsingErrorCount 0 }} -
    - {{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }} - - {{ .ParsingErrorMsg }} -
    - {{ end }} -
    - {{ end }} -
    + {{ template "feed_list" dict "user" .user "feeds" .feeds "ParsingErrorCount" .ParsingErrorCount }} {{ end }} {{ end }} @@ -1362,17 +1345,18 @@ var templateViewsMapChecksums = map[string]string{ "about": "4035658497363d7af7f79be83190404eb21ec633fe8ec636bdfc219d9fc78cfc", "add_subscription": "a0f1d2bc02b6adc83dbeae593f74d9b936102cd6dd73302cdbec2137cafdcdd9", "bookmark_entries": "65588da78665699dd3f287f68325e9777d511f1a57fee4131a5bb6d00bb68df8", - "categories": "642ee3cddbd825ee6ab5a77caa0d371096b55de0f1bd4ae3055b8c8a70507d8d", - "category_entries": "3ec30d2cb97f29514ff61898a4f23d2aa73a24b3468b6d410b1c2d18c8808927", + "categories": "2c5dd0ed6355bd5acc393bbf6117d20458b5581aab82036008324f6bbbe2af75", + "category_entries": "dee7b9cd60c6c46f01dd4289940679df31c1fce28ce4aa7249fa459023e1eeb4", + "category_feeds": "527c2ffbc4fcec775071424ba1022ae003525dba53a28cc41f48fb7b30aa984b", "choose_subscription": "33c04843d7c1b608d034e605e52681822fc6d79bc6b900c04915dd9ebae584e2", "create_category": "6b22b5ce51abf4e225e23a79f81be09a7fb90acb265e93a8faf9446dff74018d", "create_user": "9b73a55233615e461d1f07d99ad1d4d3b54532588ab960097ba3e090c85aaf3a", - "edit_category": "daf073d2944a180ce5aaeb80b597eb69597a50dff55a9a1d6cf7938b48d768cb", + "edit_category": "b1c0b38f1b714c5d884edcd61e5b5295a5f1c8b71c469b35391e4dcc97cc6d36", "edit_feed": "34aa0d668b3ea1a1b5fa480c20cebeae729b37010af3bb915d2a9eed73d3b996", "edit_user": "c692db9de1a084c57b93e95a14b041d39bf489846cbb91fc982a62b72b77062a", "entry": "24aeba26ef9a51ce585ca5c4af090f1de7d7bfd7f1e3ff1b63af520e2afa76bd", "feed_entries": "9c70b82f55e4b311eff20be1641733612e3c1b406ce8010861e4c417d97b6dcc", - "feeds": "f11ba1c45cf3966843ddc406d96e048fc8f2235428e10111a1660a141ea2c42f", + "feeds": "fa06cd1e1e3fec79132386972c640a2fe91237f5dba572389d5f45be74545f25", "history_entries": "87e17d39de70eb3fdbc4000326283be610928758eae7924e4b08dcb446f3b6a9", "import": "5eb56cecaa4d369b9acc991a82be7617710c551089a2e99d34ce8b6e5c37df0a", "integrations": "6104ff6ff3ac3c1ae5e850c78250aab6e99e2342a337589f3848459fa333766a", -- cgit v1.2.3