Highlight categories with unread entries
This commit is contained in:
parent
d7cf782019
commit
3ac5095776
6 changed files with 24 additions and 3 deletions
|
@ -122,11 +122,13 @@ func (s *Storage) CategoriesWithFeedCount(userID int64) (model.Categories, error
|
|||
(SELECT count(*)
|
||||
FROM feeds
|
||||
JOIN entries ON (feeds.id = entries.feed_id)
|
||||
WHERE feeds.category_id = c.id AND entries.status = 'unread')
|
||||
WHERE feeds.category_id = c.id AND entries.status = 'unread') AS count_unread
|
||||
FROM categories c
|
||||
WHERE
|
||||
user_id=$1
|
||||
ORDER BY c.title ASC
|
||||
ORDER BY
|
||||
count_unread DESC,
|
||||
c.title ASC
|
||||
`
|
||||
|
||||
rows, err := s.db.Query(query, userID)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
{{ else }}
|
||||
<div class="items">
|
||||
{{ range .categories }}
|
||||
<article role="article" class="item">
|
||||
<article role="article" class="item{{if gt .TotalUnread 0 }} category-has-unread{{end}}">
|
||||
<div class="item-header" dir="auto">
|
||||
<span class="item-title">
|
||||
<a href="{{ route "categoryEntries" "categoryID" .ID }}">{{ .Title }}</a>
|
||||
|
|
|
@ -785,6 +785,13 @@ article.feed-has-unread {
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Categories list */
|
||||
article.category-has-unread {
|
||||
background-color: var(--category-has-unread-background-color);
|
||||
border-style: var(--category-has-unread-border-style);
|
||||
border-color: var(--category-has-unread-border-color);
|
||||
}
|
||||
|
||||
/* Icons */
|
||||
.icon,
|
||||
.icon-label {
|
||||
|
|
|
@ -108,6 +108,10 @@
|
|||
--feed-has-unread-border-style: solid;
|
||||
--feed-has-unread-border-color: rgb(33 57 76);
|
||||
|
||||
--category-has-unread-background-color: #1b1a1a;
|
||||
--category-has-unread-border-style: solid;
|
||||
--category-has-unread-border-color: rgb(33 57 76);
|
||||
|
||||
--keyboard-shortcuts-li-color: #9b9b9b;
|
||||
|
||||
--counter-color: #bbb;
|
||||
|
|
|
@ -108,6 +108,10 @@
|
|||
--feed-has-unread-border-style: solid;
|
||||
--feed-has-unread-border-color: #bee6bc;
|
||||
|
||||
--category-has-unread-background-color: #dfd;
|
||||
--category-has-unread-border-style: solid;
|
||||
--category-has-unread-border-color: #bee6bc;
|
||||
|
||||
--keyboard-shortcuts-li-color: #333;
|
||||
|
||||
--counter-color: #666;
|
||||
|
|
|
@ -107,6 +107,10 @@
|
|||
--feed-has-unread-border-style: solid;
|
||||
--feed-has-unread-border-color: #bee6bc;
|
||||
|
||||
--category-has-unread-background-color: #dfd;
|
||||
--category-has-unread-border-style: solid;
|
||||
--category-has-unread-border-color: #bee6bc;
|
||||
|
||||
--keyboard-shortcuts-li-color: #333;
|
||||
|
||||
--counter-color: #666;
|
||||
|
|
Loading…
Reference in a new issue