Front-end is complete. Rss feeds for folders now being generated. Just needs backend.

This commit is contained in:
Samuel Clay 2015-08-22 18:20:04 -07:00
parent ef9d88d9d3
commit 1ad02d4b11
3 changed files with 41 additions and 1 deletions

View file

@ -119,6 +119,10 @@ NEWSBLUR.Models.FeedOrFolder = Backbone.Model.extend({
return this.folders.has_unreads(options);
},
rss_url: function(filter) {
return this.folders.rss_url(filter);
},
view_setting: function(setting) {
if (this.is_folder()) {
@ -319,6 +323,17 @@ NEWSBLUR.Collections.Folders = Backbone.Collection.extend({
});
},
rss_url: function(filter) {
var url = NEWSBLUR.URLs['folder_rss'];
url = url.replace('{user_id}', NEWSBLUR.Globals.user_id);
url = url.replace('{secret_token}', NEWSBLUR.Globals.secret_token);
url = url.replace('{folder_title}', encodeURIComponent(this.options.title));
url = url + "?filter=" + filter;
console.log(['rss_url', this]);
return "https://" + NEWSBLUR.URLs.domain + url;
},
view_setting: function(setting) {
return NEWSBLUR.assets.view_setting('river:' + (this.get('folder_title') || ''), setting);
}

View file

@ -261,6 +261,30 @@ _.extend(NEWSBLUR.ReaderFeedException.prototype, {
]))
])
])),
(this.folder && $.make('div', { className: 'NB-fieldset NB-exception-option NB-exception-option-feed NB-modal-submit' }, [
$.make('h5', [
$.make('div', { className: 'NB-exception-option-meta' }),
'Folder RSS Feed Address'
]),
$.make('div', { className: 'NB-fieldset-fields' }, [
$.make('div', { className: 'NB-exception-input-wrapper' }, [
$.make('div', { className: 'NB-loading' }),
$.make('label', { 'for': 'NB-exception-input-unread', className: 'NB-exception-label' }, [
$.make('div', { className: 'NB-folder-icon' }),
'Unread+Focus:'
]),
$.make('input', { type: 'text', id: 'NB-exception-input-unread', className: 'NB-exception-input-unread NB-input', name: 'folder_rss_unread_url', value: this.folder.rss_url('unread') })
]),
$.make('div', { className: 'NB-exception-input-wrapper' }, [
$.make('div', { className: 'NB-loading' }),
$.make('label', { 'for': 'NB-exception-input-focus', className: 'NB-exception-label' }, [
$.make('div', { className: 'NB-folder-icon' }),
'Only Focus:'
]),
$.make('input', { type: 'text', id: 'NB-exception-input-focus', className: 'NB-exception-input-focus NB-input', name: 'folder_rss_focus_url', value: this.folder.rss_url('focus') })
])
])
])),
$.make('div', { className: 'NB-fieldset NB-exception-option NB-exception-option-delete NB-exception-block-only NB-modal-submit' }, [
$.make('h5', [
$.make('span', { className: 'NB-exception-option-option NB-exception-only' }, 'Option 4:'),

View file

@ -99,7 +99,8 @@
'opml-export' : "{% url "opml-export" %}",
'domain' : "{% current_domain %}",
'favicon' : "/rss_feeds/icon/{id}",
'delete-account' : "{% url "profile-delete-account" %}"
'delete-account' : "{% url "profile-delete-account" %}",
'folder_rss' : "/reader/folder_rss/{user_id}/{secret_token}/{folder_title}"
};
NEWSBLUR.Models = {};
NEWSBLUR.Collections = {};