Do not show save link if no integration is configured

This commit is contained in:
Frédéric Guillot 2018-04-29 17:43:40 -07:00
parent b166ceaea7
commit 31da4db14f
20 changed files with 133 additions and 100 deletions

View file

@ -176,3 +176,18 @@ func (s *Storage) CreateIntegration(userID int64) error {
return nil return nil
} }
// HasSaveEntry returns true if the given user can save articles to third-parties.
func (s *Storage) HasSaveEntry(userID int64) (result bool) {
query := `
SELECT true FROM integrations
WHERE user_id=$1 AND
(pinboard_enabled='t' OR instapaper_enabled='t' OR wallabag_enabled='t' OR nunux_keeper_enabled='t')
`
if err := s.db.QueryRow(query, userID).Scan(&result); err != nil {
result = false
}
return result
}

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT. // Code generated by go generate; DO NOT EDIT.
// 2018-04-29 16:22:00.539326448 -0700 PDT m=+0.023616542 // 2018-04-29 17:36:50.459886967 -0700 PDT m=+0.024552529
package template package template
@ -32,6 +32,7 @@ var templateCommonMap = map[string]string{
<li> <li>
<time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .user.Timezone .entry.Date }}</time> <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .user.Timezone .entry.Date }}</time>
</li> </li>
{{ if .hasSaveEntry }}
<li> <li>
<a href="#" <a href="#"
title="{{ t "Save this article" }}" title="{{ t "Save this article" }}"
@ -41,9 +42,15 @@ var templateCommonMap = map[string]string{
data-label-done="{{ t "Done!" }}" data-label-done="{{ t "Done!" }}"
>{{ t "Save" }}</a> >{{ t "Save" }}</a>
</li> </li>
{{ end }}
<li> <li>
<a href="{{ .entry.URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a> <a href="{{ .entry.URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a>
</li> </li>
{{ if .entry.CommentsURL }}
<li>
<a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
</li>
{{ end }}
<li> <li>
<a href="#" <a href="#"
data-toggle-bookmark="true" data-toggle-bookmark="true"
@ -63,11 +70,6 @@ var templateCommonMap = map[string]string{
data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}" data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
>{{ if eq .entry.Status "read" }} {{ t "Unread" }}{{ else }} {{ t "Read" }}{{ end }}</a> >{{ if eq .entry.Status "read" }} {{ t "Unread" }}{{ else }} {{ t "Read" }}{{ end }}</a>
</li> </li>
{{ if .entry.CommentsURL }}
<li>
<a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
</li>
{{ end }}
</ul> </ul>
</div> </div>
{{ end }}`, {{ end }}`,
@ -220,7 +222,7 @@ var templateCommonMap = map[string]string{
var templateCommonMapChecksums = map[string]string{ var templateCommonMapChecksums = map[string]string{
"entry_pagination": "f1465fa70f585ae8043b200ec9de5bf437ffbb0c19fb7aefc015c3555614ee27", "entry_pagination": "f1465fa70f585ae8043b200ec9de5bf437ffbb0c19fb7aefc015c3555614ee27",
"item_meta": "c14b5b36076e087346def2ebcef4876ed5e8165218f40dc017db44e754c22d03", "item_meta": "6cff8ae243f19dac936e523867d2975f70aa749b2a461ae63f6ebbca94cf7419",
"layout": "c7565e2cf904612e236bc1d7167c6c124ffe5d27348608eb5c2336606f266896", "layout": "c7565e2cf904612e236bc1d7167c6c124ffe5d27348608eb5c2336606f266896",
"pagination": "6ff462c2b2a53bc5448b651da017f40a39f1d4f16cef4b2f09784f0797286924", "pagination": "6ff462c2b2a53bc5448b651da017f40a39f1d4f16cef4b2f09784f0797286924",
} }

View file

@ -20,7 +20,7 @@
</span> </span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span> <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div> </div>
{{ template "item_meta" dict "user" $.user "entry" . }} {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article> </article>
{{ end }} {{ end }}
</div> </div>

View file

@ -27,7 +27,7 @@
</span> </span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span> <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div> </div>
{{ template "item_meta" dict "user" $.user "entry" . }} {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article> </article>
{{ end }} {{ end }}
</div> </div>

View file

@ -7,6 +7,7 @@
<li> <li>
<time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .user.Timezone .entry.Date }}</time> <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .user.Timezone .entry.Date }}</time>
</li> </li>
{{ if .hasSaveEntry }}
<li> <li>
<a href="#" <a href="#"
title="{{ t "Save this article" }}" title="{{ t "Save this article" }}"
@ -16,9 +17,15 @@
data-label-done="{{ t "Done!" }}" data-label-done="{{ t "Done!" }}"
>{{ t "Save" }}</a> >{{ t "Save" }}</a>
</li> </li>
{{ end }}
<li> <li>
<a href="{{ .entry.URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a> <a href="{{ .entry.URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a>
</li> </li>
{{ if .entry.CommentsURL }}
<li>
<a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
</li>
{{ end }}
<li> <li>
<a href="#" <a href="#"
data-toggle-bookmark="true" data-toggle-bookmark="true"
@ -38,11 +45,6 @@
data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}" data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
>{{ if eq .entry.Status "read" }}✘ {{ t "Unread" }}{{ else }}✔ {{ t "Read" }}{{ end }}</a> >{{ if eq .entry.Status "read" }}✘ {{ t "Unread" }}{{ else }}✔ {{ t "Read" }}{{ end }}</a>
</li> </li>
{{ if .entry.CommentsURL }}
<li>
<a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
</li>
{{ end }}
</ul> </ul>
</div> </div>
{{ end }} {{ end }}

View file

@ -18,6 +18,7 @@
data-value="{{ if .Starred }}star{{ else }}unstar{{ end }}" data-value="{{ if .Starred }}star{{ else }}unstar{{ end }}"
>{{ if .entry.Starred }}★ {{ t "Unstar" }}{{ else }}☆ {{ t "Star" }}{{ end }}</a> >{{ if .entry.Starred }}★ {{ t "Unstar" }}{{ else }}☆ {{ t "Star" }}{{ end }}</a>
</li> </li>
{{ if .hasSaveEntry }}
<li> <li>
<a href="#" <a href="#"
title="{{ t "Save this article" }}" title="{{ t "Save this article" }}"
@ -27,6 +28,7 @@
data-label-done="{{ t "Done!" }}" data-label-done="{{ t "Done!" }}"
>{{ t "Save" }}</a> >{{ t "Save" }}</a>
</li> </li>
{{ end }}
<li> <li>
<a href="#" <a href="#"
title="{{ t "Fetch original content" }}" title="{{ t "Fetch original content" }}"

View file

@ -38,7 +38,7 @@
</span> </span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span> <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div> </div>
{{ template "item_meta" dict "user" $.user "entry" . }} {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article> </article>
{{ end }} {{ end }}
</div> </div>

View file

@ -27,7 +27,7 @@
</span> </span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span> <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div> </div>
{{ template "item_meta" dict "user" $.user "entry" . }} {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article> </article>
{{ end }} {{ end }}
</div> </div>

View file

@ -30,7 +30,7 @@
</span> </span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span> <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div> </div>
{{ template "item_meta" dict "user" $.user "entry" . }} {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article> </article>
{{ end }} {{ end }}
</div> </div>

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT. // Code generated by go generate; DO NOT EDIT.
// 2018-04-29 16:22:00.531039167 -0700 PDT m=+0.015329261 // 2018-04-29 17:36:50.450844913 -0700 PDT m=+0.015510475
package template package template
@ -91,6 +91,37 @@ var templateViewsMap = map[string]string{
</form> </form>
{{ end }} {{ end }}
{{ end }}
`,
"bookmark_entries": `{{ define "title"}}{{ t "Favorites" }} ({{ .total }}){{ end }}
{{ define "content"}}
<section class="page-header">
<h1>{{ t "Favorites" }} ({{ .total }})</h1>
</section>
{{ if not .entries }}
<p class="alert alert-info">{{ t "There is no bookmark at the moment." }}</p>
{{ else }}
<div class="items">
{{ range .entries }}
<article class="item touch-item item-status-{{ .Status }}" data-id="{{ .ID }}">
<div class="item-header">
<span class="item-title">
{{ if ne .Feed.Icon.IconID 0 }}
<img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
{{ end }}
<a href="{{ route "starredEntry" "entryID" .ID }}">{{ .Title }}</a>
</span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div>
{{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article>
{{ end }}
</div>
{{ template "pagination" .pagination }}
{{ end }}
{{ end }} {{ end }}
`, `,
"categories": `{{ define "title"}}{{ t "Categories" }} ({{ .total }}){{ end }} "categories": `{{ define "title"}}{{ t "Categories" }} ({{ .total }}){{ end }}
@ -179,7 +210,7 @@ var templateViewsMap = map[string]string{
</span> </span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span> <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div> </div>
{{ template "item_meta" dict "user" $.user "entry" . }} {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article> </article>
{{ end }} {{ end }}
</div> </div>
@ -483,6 +514,7 @@ var templateViewsMap = map[string]string{
data-value="{{ if .Starred }}star{{ else }}unstar{{ end }}" data-value="{{ if .Starred }}star{{ else }}unstar{{ end }}"
>{{ if .entry.Starred }} {{ t "Unstar" }}{{ else }} {{ t "Star" }}{{ end }}</a> >{{ if .entry.Starred }} {{ t "Unstar" }}{{ else }} {{ t "Star" }}{{ end }}</a>
</li> </li>
{{ if .hasSaveEntry }}
<li> <li>
<a href="#" <a href="#"
title="{{ t "Save this article" }}" title="{{ t "Save this article" }}"
@ -492,6 +524,7 @@ var templateViewsMap = map[string]string{
data-label-done="{{ t "Done!" }}" data-label-done="{{ t "Done!" }}"
>{{ t "Save" }}</a> >{{ t "Save" }}</a>
</li> </li>
{{ end }}
<li> <li>
<a href="#" <a href="#"
title="{{ t "Fetch original content" }}" title="{{ t "Fetch original content" }}"
@ -618,7 +651,7 @@ var templateViewsMap = map[string]string{
</span> </span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span> <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div> </div>
{{ template "item_meta" dict "user" $.user "entry" . }} {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article> </article>
{{ end }} {{ end }}
</div> </div>
@ -705,7 +738,7 @@ var templateViewsMap = map[string]string{
{{ end }} {{ end }}
`, `,
"history": `{{ define "title"}}{{ t "History" }} ({{ .total }}){{ end }} "history_entries": `{{ define "title"}}{{ t "History" }} ({{ .total }}){{ end }}
{{ define "content"}} {{ define "content"}}
<section class="page-header"> <section class="page-header">
@ -734,7 +767,7 @@ var templateViewsMap = map[string]string{
</span> </span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span> <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div> </div>
{{ template "item_meta" dict "user" $.user "entry" . }} {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article> </article>
{{ end }} {{ end }}
</div> </div>
@ -1090,38 +1123,7 @@ var templateViewsMap = map[string]string{
{{ end }} {{ end }}
`, `,
"starred": `{{ define "title"}}{{ t "Favorites" }} ({{ .total }}){{ end }} "unread_entries": `{{ define "title"}}{{ t "Unread Items" }} {{ if gt .countUnread 0 }}({{ .countUnread }}){{ end }} {{ end }}
{{ define "content"}}
<section class="page-header">
<h1>{{ t "Favorites" }} ({{ .total }})</h1>
</section>
{{ if not .entries }}
<p class="alert alert-info">{{ t "There is no bookmark at the moment." }}</p>
{{ else }}
<div class="items">
{{ range .entries }}
<article class="item touch-item item-status-{{ .Status }}" data-id="{{ .ID }}">
<div class="item-header">
<span class="item-title">
{{ if ne .Feed.Icon.IconID 0 }}
<img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
{{ end }}
<a href="{{ route "starredEntry" "entryID" .ID }}">{{ .Title }}</a>
</span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div>
{{ template "item_meta" dict "user" $.user "entry" . }}
</article>
{{ end }}
</div>
{{ template "pagination" .pagination }}
{{ end }}
{{ end }}
`,
"unread": `{{ define "title"}}{{ t "Unread Items" }} {{ if gt .countUnread 0 }}({{ .countUnread }}){{ end }} {{ end }}
{{ define "content"}} {{ define "content"}}
<section class="page-header"> <section class="page-header">
@ -1153,7 +1155,7 @@ var templateViewsMap = map[string]string{
</span> </span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span> <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div> </div>
{{ template "item_meta" dict "user" $.user "entry" . }} {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
</article> </article>
{{ end }} {{ end }}
</div> </div>
@ -1230,24 +1232,24 @@ var templateViewsMap = map[string]string{
var templateViewsMapChecksums = map[string]string{ var templateViewsMapChecksums = map[string]string{
"about": "ad2fb778fc73c39b733b3f81b13e5c7d689b041fadd24ee2d4577f545aa788ad", "about": "ad2fb778fc73c39b733b3f81b13e5c7d689b041fadd24ee2d4577f545aa788ad",
"add_subscription": "053c920b0d7e109ea19dce6a448e304ce720db8633588ea04db16677f7209a7b", "add_subscription": "053c920b0d7e109ea19dce6a448e304ce720db8633588ea04db16677f7209a7b",
"bookmark_entries": "8e5fea7559218a34289c2f0e54955fc0ef3b9e629205927841cbcc2276aefb2a",
"categories": "ca1280cd157bb527d4fc907da67b05a8347378f6dce965b9389d4bcdf3600a11", "categories": "ca1280cd157bb527d4fc907da67b05a8347378f6dce965b9389d4bcdf3600a11",
"category_entries": "686132d71c52a665329670756ac09959d915f7bc3227970149c623059988b035", "category_entries": "6ad52c8d0c28e21ea48be76228ea8432adde1dc190010753a48928477d52e065",
"choose_subscription": "a325f9c976ca2b2dc148e25c8fef0cf6ccab0e04e86e604e7812bb18dc4cdde1", "choose_subscription": "a325f9c976ca2b2dc148e25c8fef0cf6ccab0e04e86e604e7812bb18dc4cdde1",
"create_category": "2b82af5d2dcd67898dc5daa57a6461e6ff8121a6089b2a2a1be909f35e4a2275", "create_category": "2b82af5d2dcd67898dc5daa57a6461e6ff8121a6089b2a2a1be909f35e4a2275",
"create_user": "233764778c915754141a20429ec8db9bf80ef2d7704867a2d7232c1e9df233ae", "create_user": "233764778c915754141a20429ec8db9bf80ef2d7704867a2d7232c1e9df233ae",
"edit_category": "cee720faadcec58289b707ad30af623d2ee66c1ce23a732965463250d7ff41c5", "edit_category": "cee720faadcec58289b707ad30af623d2ee66c1ce23a732965463250d7ff41c5",
"edit_feed": "d2c1c8486d7faf4ee58151ccf3e3c690e53bd6872050d291c5db8452a83c3d53", "edit_feed": "d2c1c8486d7faf4ee58151ccf3e3c690e53bd6872050d291c5db8452a83c3d53",
"edit_user": "321e0a60cf3bf7441bff970f4920e4c5b7c1883f80ab1d1674f8137954b25033", "edit_user": "321e0a60cf3bf7441bff970f4920e4c5b7c1883f80ab1d1674f8137954b25033",
"entry": "656a33552c3662c5d38a6178c811316ff55b38460b1f57d4087d51d631efe896", "entry": "bd611521ebb46714fce434fe7fa5d4e53e50da4c3ed02450ad3557f614f16e14",
"feed_entries": "420da786e827a77fecc8794207d158af3a30e489ca2b2019f48d5228919af4a7", "feed_entries": "4dffdb55cfad29df20612efe7ed2dbed03d919c4556898543ab6450f610d3c99",
"feeds": "2a5abe37968ea34a0576dbef52341645cb1fc9562e351382fbf721491da6f4fa", "feeds": "2a5abe37968ea34a0576dbef52341645cb1fc9562e351382fbf721491da6f4fa",
"history": "967bc95236269ab3a77455910aca1939f43f93171fe1af77eb3b1b4eac579e55", "history_entries": "451f0b202f47c9db5344d3e73862f5b7afbd4323fbdba21b6087866c40f045d3",
"import": "73b5112e20bfd232bf73334544186ea419505936bc237d481517a8622901878f", "import": "73b5112e20bfd232bf73334544186ea419505936bc237d481517a8622901878f",
"integrations": "979193f39c2a3b43cec192aa119713cc9cbe2d5fdaedf8d2b3573c752823446c", "integrations": "979193f39c2a3b43cec192aa119713cc9cbe2d5fdaedf8d2b3573c752823446c",
"login": "7d83c3067c02f1f6aafdd8816c7f97a4eb5a5a4bdaaaa4cc1e2fbb9c17ea65e8", "login": "7d83c3067c02f1f6aafdd8816c7f97a4eb5a5a4bdaaaa4cc1e2fbb9c17ea65e8",
"sessions": "3fa79031dd883847eba92fbafe5f535fa3a4e1614bb610f20588b6f8fc8b3624", "sessions": "3fa79031dd883847eba92fbafe5f535fa3a4e1614bb610f20588b6f8fc8b3624",
"settings": "ea2505b9d0a6d6bb594dba87a92079de19baa6d494f0651693a7685489fb7de9", "settings": "ea2505b9d0a6d6bb594dba87a92079de19baa6d494f0651693a7685489fb7de9",
"starred": "d006f5bcfca7abc7c68b6bb38fe25838acb81b65f960fbf06b97b259ba03b936", "unread_entries": "ca3ef1547d7d170b005a2f48fabd4c0a15550884db5e481659c13ffe6a47d19d",
"unread": "ad71a7bdd46c1d650efecbeeb37b7606a046027c15284c0712912b77397f90d4",
"users": "c6d91b0b29984b4cb3073bec6a2933cfb72981ec60f54b6c7aa05194f0e860bd", "users": "c6d91b0b29984b4cb3073bec6a2933cfb72981ec60f54b6c7aa05194f0e860bd",
} }

View file

@ -56,6 +56,7 @@ func (c *Controller) ShowStarredPage(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "starred") view.Set("menu", "starred")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("starred")) html.OK(w, view.Render("bookmark_entries"))
} }

View file

@ -73,6 +73,7 @@ func (c *Controller) CategoryEntries(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "categories") view.Set("menu", "categories")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("category_entries")) html.OK(w, view.Render("category_entries"))
} }

View file

@ -86,6 +86,7 @@ func (c *Controller) ShowStarredEntry(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "starred") view.Set("menu", "starred")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("entry")) html.OK(w, view.Render("entry"))
} }

View file

@ -93,6 +93,7 @@ func (c *Controller) ShowCategoryEntry(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "categories") view.Set("menu", "categories")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("entry")) html.OK(w, view.Render("entry"))
} }

View file

@ -93,6 +93,7 @@ func (c *Controller) ShowFeedEntry(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "feeds") view.Set("menu", "feeds")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("entry")) html.OK(w, view.Render("entry"))
} }

View file

@ -76,6 +76,7 @@ func (c *Controller) ShowReadEntry(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "history") view.Set("menu", "history")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("entry")) html.OK(w, view.Render("entry"))
} }

View file

@ -87,6 +87,7 @@ func (c *Controller) ShowUnreadEntry(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "unread") view.Set("menu", "unread")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("entry")) html.OK(w, view.Render("entry"))
} }

View file

@ -73,6 +73,7 @@ func (c *Controller) ShowFeedEntries(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "feeds") view.Set("menu", "feeds")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("feed_entries")) html.OK(w, view.Render("feed_entries"))
} }

View file

@ -54,6 +54,7 @@ func (c *Controller) ShowHistoryPage(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "history") view.Set("menu", "history")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("history")) html.OK(w, view.Render("history_entries"))
} }

View file

@ -58,6 +58,7 @@ func (c *Controller) ShowUnreadPage(w http.ResponseWriter, r *http.Request) {
view.Set("menu", "unread") view.Set("menu", "unread")
view.Set("user", user) view.Set("user", user)
view.Set("countUnread", c.store.CountUnreadEntries(user.ID)) view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
html.OK(w, view.Render("unread")) html.OK(w, view.Render("unread_entries"))
} }