add: polls

This commit is contained in:
trisua 2025-06-04 17:21:46 -04:00
parent 4dfa09207e
commit 6555324650
29 changed files with 339 additions and 56 deletions

View file

@ -717,6 +717,12 @@ pub async fn post_request(
Err(e) => return Err(Html(render_error(e, &jar, &data, &user).await)),
};
// check poll
let poll = match data.0.get_post_poll(&post, &user).await {
Ok(q) => q,
Err(e) => return Err(Html(render_error(e, &jar, &data, &user).await)),
};
// check permissions
let (can_read, can_manage_pins) = check_permissions!(community, jar, data, user);
@ -755,6 +761,7 @@ pub async fn post_request(
context.insert("post", &post);
context.insert("reposting", &reposting);
context.insert("question", &question);
context.insert("poll", &poll);
context.insert("replies", &feed);
context.insert("page", &props.page);
context.insert(