39 lines
1.5 KiB
HTML
39 lines
1.5 KiB
HTML
{% from 'common/macros.html' import subheader %}
|
|
{% from 'common/macros.html' import full_post with context %}
|
|
{%- extends 'base.html' -%}
|
|
{%- block title -%}inbox{%- endblock -%}
|
|
{%- block content -%}
|
|
{%- set topline -%}
|
|
{%- if unread_count -%}
|
|
You have {{unread_count}} unread posts across {{subscriptions | length}} threads.
|
|
{%- elif subscriptions | length > 0 -%}
|
|
You have no unread posts.
|
|
{%- else -%}
|
|
You do not have any subscriptions.
|
|
{%- endif -%}
|
|
{%- endset -%}
|
|
{{ subheader('Your inbox', topline) }}
|
|
{%- if subscriptions | length > 0 -%}
|
|
<div class="plank">
|
|
{%- for sub in subscriptions -%}
|
|
<details class="separated">
|
|
{%- 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)}}">
|
|
<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>
|
|
</summary>
|
|
{%- set posts = sub.get_full_posts_view() -%}
|
|
|
|
{%- for post in posts -%}
|
|
<div class="plank post no-shadow even">{{full_post(post, show_toolbar=false, show_reactions=false)}}</div>
|
|
{%- endfor -%}
|
|
</details>
|
|
{%- endfor -%}
|
|
</div>
|
|
{%- endif -%}
|
|
{%- endblock -%}
|