add mark as read button(s) to inbox

This commit is contained in:
2026-06-10 17:59:51 +03:00
parent 8a7eb91a34
commit 6e73186127
4 changed files with 47 additions and 4 deletions

View File

@@ -12,7 +12,20 @@
You do not have any subscriptions.
{%- endif -%}
{%- endset -%}
{{ subheader('Your inbox', topline) }}
{%- call() subheader('Your inbox', topline) -%}
<fieldset class="plank even no-shadow minimal subheader-actions">
<legend>Actions</legend>
<form method="POST" action="{{url_for('threads.mark_read')}}">
{%- for sub in subscriptions -%}
<input type="hidden" name="id[]" value="{{sub.id}}">
{%- endfor -%}
<button>Mark all as read</button>
</form>
<form method="POST" action="{{url_for('threads.unsubscribe_all')}}">
<button class="warn">Unsubscribe from all</button>
</form>
</fieldset>
{%- endcall -%}
{%- if subscriptions | length > 0 -%}
<div class="plank">
{%- for sub in subscriptions -%}
@@ -20,11 +33,17 @@
{%- set thread = sub.get_thread() -%}
<summary class="plank secondary-bg no-shadow even">
{{thread.title}} ({{sub.get_unread_count()}} unread)
<form method="POST" action="{{url_for('threads.unsubscribe', thread_id=thread.id)}}">
<div>
<form class="inline horizontal" method="POST" action="{{url_for('threads.unsubscribe', thread_id=thread.id)}}">
<input type="hidden" name="return_to" value="{{url_for('users.inbox', username=get_active_user().username)}}">
<a href="{{url_for('threads.thread_by_id', thread_id=thread.id)}}" class="linkbutton">Go to thread</a>
<input type="submit" value="Unsubscribe" class="warn">
</form>
<form class="inline horizontal" method="POST" action="{{url_for('threads.mark_read')}}">
<input type="hidden" name="id[]" value="{{sub.id}}">
<button>Mark as read</button>
</form>
</div>
</summary>
{%- set posts = sub.get_full_posts_view() -%}