mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Display list of feeds per category
This commit is contained in:
parent
15fe9c20df
commit
fad9ad2be4
22 changed files with 345 additions and 141 deletions
|
@ -20,18 +20,13 @@
|
|||
<span class="item-title">
|
||||
<a href="{{ route "categoryEntries" "categoryID" .ID }}">{{ .Title }}</a>
|
||||
</span>
|
||||
(<span title="{{ if eq .FeedCount 0 }}{{ t "page.categories.no_feed" }}{{ else }}{{ plural "page.categories.feed_count" .FeedCount .FeedCount }}{{ end }}">{{ .FeedCount }}</span>)
|
||||
</div>
|
||||
<div class="item-meta">
|
||||
<ul>
|
||||
<li>
|
||||
{{ if eq .FeedCount 0 }}
|
||||
{{ t "page.categories.no_feed" }}
|
||||
{{ else }}
|
||||
{{ plural "page.categories.feed_count" .FeedCount .FeedCount }}
|
||||
{{ end }}
|
||||
<a href="{{ route "categoryFeeds" "categoryID" .ID }}">{{ t "page.categories.feeds" }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ route "editCategory" "categoryID" .ID }}">{{ t "menu.edit_category" }}</a>
|
||||
</li>
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
<a href="{{ route "categoryEntries" "categoryID" .category.ID }}">{{ t "menu.show_only_unread_entries" }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
<li>
|
||||
<a href="{{ route "categoryFeeds" "categoryID" .category.ID }}">{{ t "menu.feeds" }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
|
34
template/html/category_feeds.html
Normal file
34
template/html/category_feeds.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
{{ define "title"}}{{ .category.Title }} > {{ t "page.feeds.title" }} ({{ .total }}){{ end }}
|
||||
|
||||
{{ define "content"}}
|
||||
<section class="page-header">
|
||||
<h1>{{ .category.Title }} > {{ t "page.feeds.title" }} ({{ .total }})</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ route "categories" }}">{{ t "menu.categories" }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route "editCategory" "categoryID" .category.ID }}">{{ t "menu.edit_category" }}</a>
|
||||
</li>
|
||||
{{ if eq .total 0 }}
|
||||
<li>
|
||||
<a href="#"
|
||||
data-confirm="true"
|
||||
data-label-question="{{ t "confirm.question" }}"
|
||||
data-label-yes="{{ t "confirm.yes" }}"
|
||||
data-label-no="{{ t "confirm.no" }}"
|
||||
data-label-loading="{{ t "confirm.loading" }}"
|
||||
data-redirect-url="{{ route "categories" }}"
|
||||
data-url="{{ route "removeCategory" "categoryID" .category.ID }}">{{ t "action.remove" }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
{{ if not .feeds }}
|
||||
<p class="alert">{{ t "alert.no_feed_in_category" }}</p>
|
||||
{{ else }}
|
||||
{{ template "feed_list" dict "user" .user "feeds" .feeds "ParsingErrorCount" .ParsingErrorCount }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
56
template/html/common/feed_list.html
Normal file
56
template/html/common/feed_list.html
Normal file
|
@ -0,0 +1,56 @@
|
|||
{{ define "feed_list" }}
|
||||
<div class="items">
|
||||
{{ range .feeds }}
|
||||
<article class="item {{ if ne .ParsingErrorCount 0 }}feed-parsing-error{{ end }}">
|
||||
<div class="item-header">
|
||||
<span class="item-title">
|
||||
{{ if .Icon }}
|
||||
<img src="{{ route "icon" "iconID" .Icon.IconID }}" width="16" height="16" loading="lazy" alt="{{ .Title }}">
|
||||
{{ end }}
|
||||
{{ if .Disabled }} 🚫 {{ end }}
|
||||
<a href="{{ route "feedEntries" "feedID" .ID }}">{{ .Title }}</a>
|
||||
</span>
|
||||
<span class="feed-entries-counter">
|
||||
(<span title="{{ t "page.feeds.unread_counter" }}">{{ .UnreadCount }}</span>/<span title="{{ t "page.feeds.read_counter" }}">{{ .ReadCount }}</span>)
|
||||
</span>
|
||||
<span class="category">
|
||||
<a href="{{ route "categoryEntries" "categoryID" .Category.ID }}">{{ .Category.Title }}</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="item-meta">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ .SiteURL }}" title="{{ .SiteURL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ domain .SiteURL }}</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ t "page.feeds.last_check" }} <time datetime="{{ isodate .CheckedAt }}" title="{{ isodate .CheckedAt }}">{{ elapsed $.user.Timezone .CheckedAt }}</time>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ route "refreshFeed" "feedID" .ID }}">{{ t "menu.refresh_feed" }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route "editFeed" "feedID" .ID }}">{{ t "menu.edit_feed" }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
data-confirm="true"
|
||||
data-label-question="{{ t "confirm.question" }}"
|
||||
data-label-yes="{{ t "confirm.yes" }}"
|
||||
data-label-no="{{ t "confirm.no" }}"
|
||||
data-label-loading="{{ t "confirm.loading" }}"
|
||||
data-url="{{ route "removeFeed" "feedID" .ID }}">{{ t "action.remove" }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{ if ne .ParsingErrorCount 0 }}
|
||||
<div class="parsing-error">
|
||||
<strong title="{{ .ParsingErrorMsg }}" class="parsing-error-count">{{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }}</strong>
|
||||
- <small class="parsing-error-message">{{ .ParsingErrorMsg }}</small>
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
|
@ -7,6 +7,9 @@
|
|||
<li>
|
||||
<a href="{{ route "categories" }}">{{ t "menu.categories" }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route "categoryFeeds" "categoryID" .category.ID }}">{{ t "menu.feeds" }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route "createCategory" }}">{{ t "menu.create_category" }}</a>
|
||||
</li>
|
||||
|
@ -24,7 +27,7 @@
|
|||
<input type="text" name="title" id="form-title" value="{{ .form.Title }}" required autofocus>
|
||||
|
||||
<div class="buttons">
|
||||
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.saving" }}">{{ t "action.update" }}</button> {{ t "action.or" }} <a href="{{ route "categories" }}">{{ t "action.cancel" }}</a>
|
||||
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.saving" }}">{{ t "action.update" }}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{ end }}
|
||||
|
|
|
@ -22,60 +22,7 @@
|
|||
{{ if not .feeds }}
|
||||
<p class="alert">{{ t "alert.no_feed" }}</p>
|
||||
{{ else }}
|
||||
<div class="items">
|
||||
{{ range .feeds }}
|
||||
<article class="item {{ if ne .ParsingErrorCount 0 }}feed-parsing-error{{ end }}">
|
||||
<div class="item-header">
|
||||
<span class="item-title">
|
||||
{{ if .Icon }}
|
||||
<img src="{{ route "icon" "iconID" .Icon.IconID }}" width="16" height="16" loading="lazy" alt="{{ .Title }}">
|
||||
{{ end }}
|
||||
{{ if .Disabled }} 🚫 {{ end }}
|
||||
<a href="{{ route "feedEntries" "feedID" .ID }}">{{ .Title }}</a>
|
||||
</span>
|
||||
<span class="feed-entries-counter">
|
||||
(<span title="{{ t "page.feeds.unread_counter" }}">{{ .UnreadCount }}</span>/<span title="{{ t "page.feeds.read_counter" }}">{{ .ReadCount }}</span>)
|
||||
</span>
|
||||
<span class="category">
|
||||
<a href="{{ route "categoryEntries" "categoryID" .Category.ID }}">{{ .Category.Title }}</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="item-meta">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ .SiteURL }}" title="{{ .SiteURL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ domain .SiteURL }}</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ t "page.feeds.last_check" }} <time datetime="{{ isodate .CheckedAt }}" title="{{ isodate .CheckedAt }}">{{ elapsed $.user.Timezone .CheckedAt }}</time>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ route "refreshFeed" "feedID" .ID }}">{{ t "menu.refresh_feed" }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route "editFeed" "feedID" .ID }}">{{ t "menu.edit_feed" }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
data-confirm="true"
|
||||
data-label-question="{{ t "confirm.question" }}"
|
||||
data-label-yes="{{ t "confirm.yes" }}"
|
||||
data-label-no="{{ t "confirm.no" }}"
|
||||
data-label-loading="{{ t "confirm.loading" }}"
|
||||
data-url="{{ route "removeFeed" "feedID" .ID }}">{{ t "action.remove" }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{ if ne .ParsingErrorCount 0 }}
|
||||
<div class="parsing-error">
|
||||
<strong title="{{ .ParsingErrorMsg }}" class="parsing-error-count">{{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }}</strong>
|
||||
- <small class="parsing-error-message">{{ .ParsingErrorMsg }}</small>
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ template "feed_list" dict "user" .user "feeds" .feeds "ParsingErrorCount" .ParsingErrorCount }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue