mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fixing header counts issue when always showing folder counts and having blurblogs unintentionally collapsed.
This commit is contained in:
parent
3e1b00f941
commit
ffed6046b2
3 changed files with 17 additions and 6 deletions
|
@ -103,7 +103,7 @@ class MSocialProfile(mongo.Document):
|
|||
|
||||
super(MSocialProfile, self).save(*args, **kwargs)
|
||||
if self.user_id not in self.following_user_ids:
|
||||
self.follow_user(self.user_id)
|
||||
self.follow_user(self.user_id, force=True)
|
||||
self.count_follows()
|
||||
|
||||
@property
|
||||
|
@ -351,7 +351,7 @@ class MSocialProfile(mongo.Document):
|
|||
|
||||
logging.debug(" ---> ~FB~SB%s~SN (%s) following %s" % (self.username, self.user_id, user_id))
|
||||
|
||||
if not followee.protected:
|
||||
if not followee.protected or force:
|
||||
if user_id not in self.following_user_ids:
|
||||
self.following_user_ids.append(user_id)
|
||||
elif not force:
|
||||
|
@ -2136,7 +2136,7 @@ class MInteraction(mongo.Document):
|
|||
|
||||
meta = {
|
||||
'collection': 'interactions',
|
||||
'indexes': [('user_id', '-date'), 'category'],
|
||||
'indexes': [('user_id', '-date'), 'category', 'with_user_id'],
|
||||
'allow_inheritance': False,
|
||||
'index_drop_dups': True,
|
||||
'ordering': ['-date'],
|
||||
|
@ -2335,7 +2335,7 @@ class MActivity(mongo.Document):
|
|||
|
||||
meta = {
|
||||
'collection': 'activities',
|
||||
'indexes': [('user_id', '-date'), 'category'],
|
||||
'indexes': [('user_id', '-date'), 'category', 'with_user_id'],
|
||||
'allow_inheritance': False,
|
||||
'index_drop_dups': True,
|
||||
'ordering': ['-date'],
|
||||
|
|
|
@ -102,7 +102,11 @@ NEWSBLUR.Views.SocialProfileBadge = Backbone.View.extend({
|
|||
}, [
|
||||
$.make('img', { src: NEWSBLUR.Globals.MEDIA_URL + 'img/icons/silk/lock.png' }),
|
||||
$.make('span', 'Follow')
|
||||
])
|
||||
]),
|
||||
(!profile.get('private') && $.make('div', {
|
||||
className: 'NB-profile-badge-action-preview NB-modal-submit-button NB-modal-submit-grey ' +
|
||||
(!profile.get('shared_stories_count') ? 'NB-disabled' : '')
|
||||
}, 'Preview'))
|
||||
]);
|
||||
} else {
|
||||
$actions = $.make('div', { className: 'NB-profile-badge-action-buttons' }, [
|
||||
|
|
|
@ -20,8 +20,10 @@ NEWSBLUR.Views.Sidebar = Backbone.View.extend({
|
|||
var show_folder_counts = NEWSBLUR.assets.preference('folder_counts');
|
||||
var collapsed = _.contains(NEWSBLUR.Preferences.collapsed_folders, 'river_blurblog');
|
||||
|
||||
if (collapsed || show_folder_counts) {
|
||||
if (collapsed) {
|
||||
this.show_collapsed_river_blurblog_count(options);
|
||||
} else if (show_folder_counts) {
|
||||
this.show_counts(options);
|
||||
}
|
||||
|
||||
return collapsed;
|
||||
|
@ -51,6 +53,11 @@ NEWSBLUR.Views.Sidebar = Backbone.View.extend({
|
|||
});
|
||||
}
|
||||
|
||||
this.show_counts(options);
|
||||
},
|
||||
|
||||
show_counts: function(options) {
|
||||
var $header = this.$('.NB-feeds-header-river-blurblogs');
|
||||
var $counts = new NEWSBLUR.Views.FolderCount({
|
||||
collection: NEWSBLUR.assets.social_feeds
|
||||
}).render().$el;
|
||||
|
|
Loading…
Add table
Reference in a new issue