diff --git a/src/utils.rs b/src/utils.rs index 52f81a3..ea0045d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -298,6 +298,7 @@ pub struct Post { pub body: String, pub author: Author, pub permalink: String, + pub link_title: String, pub poll: Option, pub score: (String, String), pub upvote_ratio: i64, @@ -411,6 +412,7 @@ impl Post { stickied: data["stickied"].as_bool().unwrap_or_default() || data["pinned"].as_bool().unwrap_or_default(), }, permalink: val(post, "permalink"), + link_title: val(post, "link_title"), poll: Poll::parse(&data["poll_data"]), rel_time, created, @@ -715,6 +717,7 @@ pub async fn parse_post(post: &Value) -> Post { distinguished: val(post, "distinguished"), }, permalink, + link_title: val(post, "link_title"), poll, score: format_num(score), upvote_ratio: ratio as i64, diff --git a/static/style.css b/static/style.css index 05b4e4b..f7e8854 100644 --- a/static/style.css +++ b/static/style.css @@ -1255,10 +1255,28 @@ a.search_subreddit:hover { min-width: 0; } -.comment_data > * { +.comment:has([id]) .comment_data > * { margin-right: 5px; } +.comment:not([id]) .comment_data { + display: inline-flex; + max-width: 100%; +} + +.comment:not([id]) .comment_data > * { + flex: 0 0 auto; +} + +.comment:not([id]) .comment_data > .comment_link { + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + word-break: break-all; + overflow: hidden; + flex: 0 1 auto; +} + .comment_image { max-width: 500px; align-self: center; diff --git a/templates/user.html b/templates/user.html index 42019e7..35e58b2 100644 --- a/templates/user.html +++ b/templates/user.html @@ -63,8 +63,10 @@
- Comment on r/{{ post.community }} - {{ post.rel_time }} + {{ post.link_title }} +  in  + r/{{ post.community }} +  {{ post.rel_time }}

{{ post.body|safe }}