From 3d19313a7f655bc2626990650c4de8141485eea3 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 26 Jul 2019 21:13:06 -0700 Subject: Add option to disable feeds --- ui/feed_edit.go | 1 + ui/form/feed.go | 3 +++ ui/static/js/app.js | 4 ---- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/feed_edit.go b/ui/feed_edit.go index a195613..a01c8c9 100644 --- a/ui/feed_edit.go +++ b/ui/feed_edit.go @@ -51,6 +51,7 @@ func (h *handler) showEditFeedPage(w http.ResponseWriter, r *http.Request) { CategoryID: feed.Category.ID, Username: feed.Username, Password: feed.Password, + Disabled: feed.Disabled, } sess := session.New(h.store, request.SessionID(r)) diff --git a/ui/form/feed.go b/ui/form/feed.go index 0151ea6..1a04acf 100644 --- a/ui/form/feed.go +++ b/ui/form/feed.go @@ -24,6 +24,7 @@ type FeedForm struct { CategoryID int64 Username string Password string + Disabled bool } // ValidateModification validates FeedForm fields @@ -48,6 +49,7 @@ func (f FeedForm) Merge(feed *model.Feed) *model.Feed { feed.ParsingErrorMsg = "" feed.Username = f.Username feed.Password = f.Password + feed.Disabled = f.Disabled return feed } @@ -69,5 +71,6 @@ func NewFeedForm(r *http.Request) *FeedForm { CategoryID: int64(categoryID), Username: r.FormValue("feed_username"), Password: r.FormValue("feed_password"), + Disabled: r.FormValue("disabled") == "1", } } diff --git a/ui/static/js/app.js b/ui/static/js/app.js index f054cc0..cae1d45 100644 --- a/ui/static/js/app.js +++ b/ui/static/js/app.js @@ -118,10 +118,6 @@ function markPageAsRead() { function handleEntryStatus(element) { let currentEntry = findEntry(element); if (currentEntry) { - // The order is important here, - // On the unread page, the read item will be hidden. - // If "goToNextListItem" first, it may go to an item about to hide: - // Imagine that user click 'mark as read' right below the '.current-item' toggleEntryStatus(currentEntry); if (isListView() && currentEntry.classList.contains('current-item')) { goToNextListItem(); -- cgit v1.2.3