diff options
author | Colin Reeder <colin@vpzom.click> | 2020-08-08 18:01:20 -0600 |
---|---|---|
committer | Colin Reeder <colin@vpzom.click> | 2020-08-08 18:01:20 -0600 |
commit | 05c1e6e4db0c40f826d6cd35b1be767b0e3d6f1d (patch) | |
tree | 82371497509e723a91871aec9b84d1064ef862fd /src/routes/mod.rs | |
parent | 649d33ca68889669d62817765bf8d6a3441b6949 (diff) |
Use icon for like buttons
Diffstat (limited to 'src/routes/mod.rs')
-rw-r--r-- | src/routes/mod.rs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/routes/mod.rs b/src/routes/mod.rs index 72268d0..f5236c8 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -3,8 +3,8 @@ use std::borrow::Cow; use std::sync::Arc; use crate::components::{ - Comment, Content, HTPage, MaybeFillInput, MaybeFillTextArea, NotificationItem, PostItem, - ThingItem, UserLink, + Comment, Content, HTPage, IconExt, MaybeFillInput, MaybeFillTextArea, NotificationItem, + PostItem, ThingItem, UserLink, }; use crate::resp_types::{ RespCommentInfo, RespInstanceInfo, RespNotification, RespPostCommentInfo, RespPostListPost, @@ -232,21 +232,6 @@ async fn page_comment_inner( } <p> { - if let Some(parent) = &comment.parent { - Some(render::rsx! { - <div> - <small><a href={format!("/comments/{}", parent.id)}>{"<- "}{lang.tr("to_parent", None)}</a></small> - </div> - }) - } else { - None - } - } - <small><cite><UserLink user={comment.as_ref().author.as_ref()} /></cite>{":"}</small> - <Content src={&comment} /> - </p> - <div class={"actionList"}> - { if base_data.login.is_some() { Some(render::rsx! { <> @@ -254,13 +239,13 @@ async fn page_comment_inner( if comment.as_ref().your_vote.is_some() { render::rsx! { <form method={"POST"} action={format!("/comments/{}/unlike", comment.as_ref().as_ref().id)}> - <button type={"submit"}>{lang.tr("like_undo", None)}</button> + <button type={"submit"} class={"iconbutton"}>{hitide_icons::UPVOTED.img()}</button> </form> } } else { render::rsx! { <form method={"POST"} action={format!("/comments/{}/like", comment.as_ref().as_ref().id)}> - <button type={"submit"}>{lang.tr("like", None)}</button> + <button type={"submit"} class={"iconbutton"}>{hitide_icons::UPVOTE.img()}</button> </form> } } @@ -272,6 +257,21 @@ async fn page_comment_inner( } } { + if let Some(parent) = &comment.parent { + Some(render::rsx! { + <div> + <small><a href={format!("/comments/{}", parent.id)}>{"<- "}{lang.tr("to_parent", None)}</a></small> + </div> + }) + } else { + None + } + } + <small><cite><UserLink user={comment.as_ref().author.as_ref()} /></cite>{":"}</small> + <Content src={&comment} /> + </p> + <div class={"actionList"}> + { if author_is_me(&comment.as_ref().author, &base_data.login) { Some(render::rsx! { <a href={format!("/comments/{}/delete", comment.as_ref().as_ref().id)}>{lang.tr("delete", None)}</a> |