~vpzom/hitide

da1441451d5cad51aed5148c89cd8219b34fb6c9 — Colin Reeder 3 days ago f856b2b
Add infoBox for non-approved posts
4 files changed, 10 insertions(+), 0 deletions(-)

M res/lang/en.ftl
M res/lang/eo.ftl
M src/resp_types.rs
M src/routes/posts.rs
M res/lang/en.ftl => res/lang/en.ftl +1 -0
@@ 52,6 52,7 @@ post_delete_question = Delete this post?
post_delete_title = Delete Post
post_likes_nothing = Looks like nobody has liked this post yet.
post_new = New Post
post_not_approved = This post has not been approved by the community.
register = Register
remote = Remote
reply = reply

M res/lang/eo.ftl => res/lang/eo.ftl +1 -0
@@ 52,6 52,7 @@ post_delete_question = Ĉu vi volas forigi ĉi tiun poŝton?
post_delete_title = Forigi Poŝton
post_likes_nothing = Ŝajnas, ke neniu ankoraŭ ŝatis ĉi tion poŝton.
post_new = Nova Poŝto
post_not_approved = Ĉi tiu poŝto ne estas aprobita per la komunumo.
register = Registriĝi
remote = Fora
reply = respondi

M src/resp_types.rs => src/resp_types.rs +1 -0
@@ 110,6 110,7 @@ pub struct RespPostInfo<'a> {

    pub content_text: Option<Cow<'a, str>>,
    pub content_html: Option<Cow<'a, str>>,
    pub approved: bool,
    pub score: i64,
    #[serde(borrow)]
    pub comments: Vec<RespPostCommentInfo<'a>>,

M src/routes/posts.rs => src/routes/posts.rs +7 -0
@@ 48,6 48,13 @@ async fn page_post(

    Ok(html_response(render::html! {
        <HTPage base_data={&base_data} lang={&lang} title={title}>
            {
                if post.approved {
                    None
                } else {
                    Some(render::rsx! { <div class={"infoBox"}>{lang.tr("post_not_approved", None)}</div> })
                }
            }
            <h1>{title}</h1>
            <p>
                <a href={format!("/posts/{}/likes", post_id)}>