add mark as read button(s) to inbox
This commit is contained in:
@@ -166,6 +166,26 @@ def unsubscribe(thread_id):
|
||||
subscription.delete()
|
||||
return redirect(return_to)
|
||||
|
||||
@bp.post('/subscriptions/unsubscribe-all/')
|
||||
@login_required
|
||||
def unsubscribe_all():
|
||||
user = get_active_user()
|
||||
|
||||
@bp.post('/subscriptions/mark-read/')
|
||||
@login_required
|
||||
def mark_read():
|
||||
# TODO: make a return_to param
|
||||
user = get_active_user()
|
||||
sub_ids = request.form.getlist('id[]', type=int)
|
||||
now = time_now()
|
||||
for sub_id in sub_ids:
|
||||
sub = Subscriptions.find({'id': sub_id, 'user_id': user.id})
|
||||
if not sub:
|
||||
continue
|
||||
sub.update({'last_seen': now})
|
||||
|
||||
return redirect(url_for('users.inbox', username=user.username))
|
||||
|
||||
@bp.get('/<int:thread_id>/feed.atom/')
|
||||
def feed(thread_id):
|
||||
return 'stub'
|
||||
|
||||
Reference in New Issue
Block a user