~vpzom/hitide

dd90d4ace99f982403b43041cd083f1bf9010906 — Colin Reeder 11 months ago ef9f257
Show comment timestamps on comment page and user page (#215)
6 files changed, 15 insertions(+), 7 deletions(-)

M res/lang/de.ftl
M res/lang/en.ftl
M res/lang/eo.ftl
M res/lang/fr.ftl
M src/components/mod.rs
M src/routes/comments.rs
M res/lang/de.ftl => res/lang/de.ftl +1 -1
@@ 96,7 96,7 @@ sort_hot = Heis
sort_new = Neu
submit = Absenden
text_with_markdown = Text (Markdown unterstützt)
thing_comment = { $part_comment } Auf { $part_post }
thing_comment = { $part_comment } Auf { $part_post } { $part_time }:
thing_comment_part_comment = Kommentar
timeago_years =
    { $years } { $years ->

M res/lang/en.ftl => res/lang/en.ftl +1 -1
@@ 182,7 182,7 @@ sort_new = new
sort_top = top
submit = Submit
text_with_markdown = Text (markdown supported)
thing_comment = { $part_comment } on { $part_post }:
thing_comment = { $part_comment } on { $part_post } { $part_time }:
thing_comment_part_comment = Comment
time_input_minutes = minutes
time_input_hours = hours

M res/lang/eo.ftl => res/lang/eo.ftl +1 -1
@@ 106,7 106,7 @@ sort_hot = furora
sort_new = nova
submit = Sendi
text_with_markdown = Teksto (markdown estas permesita)
thing_comment = { $part_comment } sur { $part_post }:
thing_comment = { $part_comment } sur { $part_post } { $part_time }:
thing_comment_part_comment = Komento
timeago_years =
    antaŭ { $years } { $years ->

M res/lang/fr.ftl => res/lang/fr.ftl +1 -1
@@ 91,7 91,7 @@ sort_hot = tendance
sort_new = nouveau
submit = Envoyer
text_with_markdown = Texte (markdown supporté)
thing_comment = { $part_comment } sur { $part_post }
thing_comment = { $part_comment } sur { $part_post } { $part_time }:
thing_comment_part_comment = Commentaire
timeago_years =
    il y a { $years } { $years ->

M src/components/mod.rs => src/components/mod.rs +5 -1
@@ 575,7 575,7 @@ impl<'a> render::Render for ThingItem<'a> {
                        <small>
                            {
                                lang::TrElements::new(
                                    lang.tr(&lang::thing_comment(lang::LangPlaceholder(0), lang::LangPlaceholder(1))),
                                    lang.tr(&lang::thing_comment(lang::LangPlaceholder(0), lang::LangPlaceholder(1), lang::LangPlaceholder(2))),
                                    |id, w| {
                                        match id {
                                            0 => render::rsx! {


@@ 588,6 588,10 @@ impl<'a> render::Render for ThingItem<'a> {
                                                    {comment.post.title.as_ref()}
                                                </a>
                                            }.render_into(w),
                                            2 => TimeAgo {
                                                since: chrono::DateTime::parse_from_rfc3339(&comment.created).unwrap(),
                                                lang,
                                            }.render_into(w),
                                            _ => unreachable!(),
                                        }
                                    }

M src/routes/comments.rs => src/routes/comments.rs +6 -2
@@ 3,7 3,7 @@ use super::{
    get_cookie_map_for_req, html_response, res_to_error, CookieMap, JustStringID, ReturnToParams,
};
use crate::components::{
    Comment, ContentView, HTPage, IconExt, MaybeFillCheckbox, MaybeFillTextArea, UserLink,
    Comment, ContentView, HTPage, IconExt, MaybeFillCheckbox, MaybeFillTextArea, TimeAgo, UserLink,
};
use crate::lang;
use crate::resp_types::{JustContentHTML, JustID, RespCommentInfo, RespList, RespPostCommentInfo};


@@ 163,7 163,11 @@ async fn page_comment_inner(
                        }
                    })
                }
                <small><cite><UserLink lang={&lang} user={comment.as_ref().author.as_ref()} /></cite>{":"}</small>
                <small>
                    <cite><UserLink lang={&lang} user={comment.as_ref().author.as_ref()} /></cite>
                    {" "}
                    <TimeAgo since={chrono::DateTime::parse_from_rfc3339(&comment.as_ref().created).unwrap()} lang={&lang} />
                </small>
                <ContentView src={&comment} />
                {
                    comment.as_ref().attachments.iter().map(|attachment| {