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

@@ -1,6 +1,7 @@
from flask import url_for, session
from flask import url_for, session, request
from .models import Posts, Threads
from .auth import is_logged_in
import time
def get_post_url(post_id, _anchor=False, external=False):
post = Posts.find({'id': post_id})
@@ -24,3 +25,9 @@ def get_csrf_token():
def csrf_input():
return f'<input type="hidden" name="csrf" value="{get_csrf_token()}">'
def get_form_checkbox(name: str) -> bool:
return request.form.get(name, None) == 'on'
def time_now() -> int:
return int(time.time())