mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Adding socialsubs to mark all as read.
This commit is contained in:
parent
b12f5ffb66
commit
4a0b698b95
2 changed files with 12 additions and 12 deletions
|
@ -872,15 +872,17 @@ def mark_all_as_read(request):
|
||||||
days = int(request.POST.get('days', 0))
|
days = int(request.POST.get('days', 0))
|
||||||
|
|
||||||
feeds = UserSubscription.objects.filter(user=request.user)
|
feeds = UserSubscription.objects.filter(user=request.user)
|
||||||
for sub in feeds:
|
socialsubs = MSocialSubscription.objects.filter(user_id=request.user.pk)
|
||||||
if days == 0:
|
for subtype in [feeds, socialsubs]:
|
||||||
sub.mark_feed_read()
|
for sub in subtype:
|
||||||
else:
|
if days == 0:
|
||||||
read_date = datetime.datetime.utcnow() - datetime.timedelta(days=days)
|
sub.mark_feed_read()
|
||||||
if sub.mark_read_date < read_date:
|
else:
|
||||||
sub.needs_unread_recalc = True
|
read_date = datetime.datetime.utcnow() - datetime.timedelta(days=days)
|
||||||
sub.mark_read_date = read_date
|
if sub.mark_read_date < read_date:
|
||||||
sub.save()
|
sub.needs_unread_recalc = True
|
||||||
|
sub.mark_read_date = read_date
|
||||||
|
sub.save()
|
||||||
|
|
||||||
logging.user(request, "~FMMarking all as read: ~SB%s days" % (days,))
|
logging.user(request, "~FMMarking all as read: ~SB%s days" % (days,))
|
||||||
return dict(code=code)
|
return dict(code=code)
|
||||||
|
|
|
@ -3575,8 +3575,7 @@
|
||||||
|
|
||||||
var view_not_empty;
|
var view_not_empty;
|
||||||
if (unread_view >= 1) {
|
if (unread_view >= 1) {
|
||||||
view_not_empty = this.model.preference('lock_green_slider') ||
|
view_not_empty = NEWSBLUR.assets.feeds.any(function(feed) {
|
||||||
NEWSBLUR.assets.feeds.any(function(feed) {
|
|
||||||
return feed.get('ps');
|
return feed.get('ps');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -3584,7 +3583,6 @@
|
||||||
return feed.get('ps') || feed.get('nt');
|
return feed.get('ps') || feed.get('nt');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".NB-feeds-list-empty").remove();
|
$(".NB-feeds-list-empty").remove();
|
||||||
if (!view_not_empty && !all_mode) {
|
if (!view_not_empty && !all_mode) {
|
||||||
var $empty = $.make("div", { className: "NB-feeds-list-empty" }, [
|
var $empty = $.make("div", { className: "NB-feeds-list-empty" }, [
|
||||||
|
|
Loading…
Add table
Reference in a new issue