add subscribing and unsubscribing, add post editing

This commit is contained in:
2026-04-28 19:03:29 +03:00
parent f3acf64e6d
commit ff2c6606f8
8 changed files with 219 additions and 33 deletions

View File

@@ -24,7 +24,11 @@
{%- if thread.user_id == get_active_user().id -%}
<a class="linkbutton" href="{{url_for('threads.edit', thread_id=thread.id)}}">Edit</a>
{%- endif -%}
<button>Subscribe</button>
<form action="{{url_for('threads.subscribe' if not get_active_user().is_subscribed(thread.id) else 'threads.unsubscribe', thread_id=thread.id)}}" method="POST">
<input type="hidden" name="last_post_timestamp" value="{{last_post.created_at}}">
<input type="hidden" name="last_post_id" value="{{last_post.id}}">
<input type="submit" value="{{'Subscribe' if not get_active_user().is_subscribed(thread.id) else 'Unsubscribe'}}">
</form>
<button disabled title="This feature requires JavaScript to be enabled.">{{icn_bookmark(24)}}Bookmark&hellip;</button>
{%- endif -%}
<a href="{{url_for('threads.feed', thread_id=thread.id)}}" class="linkbutton rss">Subscribe via RSS</a>