e877800779
Why: It is nice to have the ability to mark an entire category as read in the UI. The API already exposes that functionality anyway, so for consistency reasons, expose it in the UI as well What: Add a new handler in the UI to markCategoryAsRead() and amend views and router to expose the functionality in the UI
70 lines
3.2 KiB
HTML
70 lines
3.2 KiB
HTML
{{ define "title"}}{{ t "page.categories.title" }} ({{ .total }}){{ end }}
|
|
|
|
{{ define "content"}}
|
|
<section class="page-header">
|
|
<h1>{{ t "page.categories.title" }} ({{ .total }})</h1>
|
|
<ul>
|
|
<li>
|
|
<a href="{{ route "createCategory" }}">{{ t "menu.create_category" }}</a>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
|
|
{{ if not .categories }}
|
|
<p class="alert alert-error">{{ t "alert.no_category" }}</p>
|
|
{{ else }}
|
|
<div class="items">
|
|
{{ range .categories }}
|
|
<article class="item">
|
|
<div class="item-header" dir="auto">
|
|
<span class="item-title">
|
|
<a href="{{ route "categoryEntries" "categoryID" .ID }}">{{ .Title }}</a>
|
|
</span>
|
|
(<span title="{{ t "page.categories.unread_counter" }}">{{ .TotalUnread }}</span>)
|
|
</div>
|
|
<div class="item-meta">
|
|
<ul class="item-meta-info">
|
|
<li>
|
|
{{ if eq .FeedCount 0 }}{{ t "page.categories.no_feed" }}{{ else }}{{ plural "page.categories.feed_count" .FeedCount .FeedCount }}{{ end }}
|
|
</li>
|
|
</ul>
|
|
<ul class="item-meta-icons">
|
|
<li>
|
|
<a href="{{ route "categoryEntries" "categoryID" .ID }}">{{ icon "entries" }}<span class="icon-label">{{ t "page.categories.entries" }}</span></a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route "categoryFeeds" "categoryID" .ID }}">{{ icon "feeds" }}<span class="icon-label">{{ t "page.categories.feeds" }}</span></a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route "editCategory" "categoryID" .ID }}">{{ icon "edit" }}<span class="icon-label">{{ t "menu.edit_category" }}</span></a>
|
|
</li>
|
|
{{ if eq .FeedCount 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-url="{{ route "removeCategory" "categoryID" .ID }}">{{ icon "delete" }}<span class="icon-label">{{ t "action.remove" }}</span></a>
|
|
</li>
|
|
{{ end }}
|
|
{{ if gt .TotalUnread 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-url="{{ route "markCategoryAsRead" "categoryID" .ID }}">{{ icon "read" }}<span class="icon-label">{{ t "menu.mark_all_as_read" }}</span></a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
</article>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
|
|
{{ end }}
|