diff --git a/src/assets/index.html b/src/assets/index.html index cd1799f..e955363 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -49,10 +49,6 @@ {% inline "plus.svg" %} New Feed -
+Manage Feeds
-Keyboard Shortcuts
diff --git a/src/assets/javascripts/app.js b/src/assets/javascripts/app.js index 36fff67..160e3d5 100644 --- a/src/assets/javascripts/app.js +++ b/src/assets/javascripts/app.js @@ -181,6 +181,10 @@ var vm = new Vue({ this.refreshStats() .then(this.refreshFeeds.bind(this)) .then(this.refreshItems.bind(this)) + + api.feeds.list_errors().then(function(errors) { + vm.feed_errors = errors + }) }, data: function() { var s = app.settings @@ -244,7 +248,24 @@ var vm = new Vue({ return folders }, feedsById: function() { - return this.feeds.reduce(function(acc, feed) { acc[feed.id] = feed; return acc }, {}) + return this.feeds.reduce(function(acc, f) { acc[f.id] = f; return acc }, {}) + }, + foldersById: function() { + return this.folders.reduce(function(acc, f) { acc[f.id] = f; return acc }, {}) + }, + current: function() { + var parts = (this.feedSelected || '').split(':', 2) + var type = parts[0] + var guid = parts[1] + + var folder = {}, feed = {} + + if (type == 'feed') + feed = this.feedsById[guid] || {} + if (type == 'folder') + folder = this.foldersById[guid] || {} + + return {type: type, feed: feed, folder: folder} }, itemSelectedContent: function() { if (!this.itemSelected) return '' @@ -346,6 +367,10 @@ var vm = new Vue({ acc[stat.feed_id] = stat return acc }, {}) + + api.feeds.list_errors().then(function(errors) { + vm.feed_errors = errors + }) }) }, getItemsQuery: function() { @@ -464,7 +489,10 @@ var vm = new Vue({ if (newTitle) { api.folders.update(folder.id, {title: newTitle}).then(function() { folder.title = newTitle - }) + this.folders.sort(function(a, b) { + return a.title.localeCompare(b.title) + }) + }.bind(this)) } }, deleteFolder: function(folder) { @@ -587,11 +615,6 @@ var vm = new Vue({ vm.feedNewChoice = [] vm.feedNewChoiceSelected = '' } - if (settings === 'manage') { - api.feeds.list_errors().then(function(errors) { - vm.feed_errors = errors - }) - } }, resizeFeedList: function(width) { this.feedListWidth = Math.min(Math.max(200, width), 700) diff --git a/src/assets/stylesheets/app.css b/src/assets/stylesheets/app.css index 1525250..eb522c5 100644 --- a/src/assets/stylesheets/app.css +++ b/src/assets/stylesheets/app.css @@ -198,7 +198,6 @@ select.form-control:not([multiple]):not([size]) { cursor: pointer; } -.list-row:hover, .toolbar-item:hover, .toolbar-search:hover, .selectgroup-label:hover, @@ -270,16 +269,6 @@ select.form-control:not([multiple]):not([size]) { background-color: #f8f9fa; } -.list-row { - padding-left: .5rem; - padding-right: .5rem; - margin-left: -.5rem; - margin-right: -.5rem; - border-radius: 3px; - user-select: none; - cursor: default; -} - .toolbar { min-height: 2rem !important; max-height: 2rem !important; @@ -471,7 +460,6 @@ a, .theme-sepia .toolbar-item:hover, .theme-sepia .toolbar-search:hover, .theme-sepia .dropdown-item:hover, -.theme-sepia .list-row:hover, .theme-sepia .toolbar-search:focus { background-color: #e0d6ba; } @@ -495,7 +483,6 @@ a, .theme-night .dropdown-divider { border-color: #1a1a1a !important; } -.theme-night .list-row:hover, .theme-night .selectgroup-label:hover, .theme-night .dropdown-item:hover, .theme-night .toolbar-item:hover,