feat: show post link title for comments on user page (#169)
This commit is contained in:
parent
d9e7681004
commit
366bc17f97
@ -298,6 +298,7 @@ pub struct Post {
|
||||
pub body: String,
|
||||
pub author: Author,
|
||||
pub permalink: String,
|
||||
pub link_title: String,
|
||||
pub poll: Option<Poll>,
|
||||
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,
|
||||
|
@ -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;
|
||||
|
@ -63,8 +63,10 @@
|
||||
</div>
|
||||
<details class="comment_right" open>
|
||||
<summary class="comment_data">
|
||||
<a class="comment_link" href="{{ post.permalink }}">Comment on r/{{ post.community }}</a>
|
||||
<span class="created" title="{{ post.created }}">{{ post.rel_time }}</span>
|
||||
<a class="comment_link" href="{{ post.permalink }}" title="{{ post.link_title }}">{{ post.link_title }}</a>
|
||||
<span class="created"> in </span>
|
||||
<a href="/r/{{ post.community }}">r/{{ post.community }}</a>
|
||||
<span class="created" title="{{ post.created }}"> {{ post.rel_time }}</span>
|
||||
</summary>
|
||||
<p class="comment_body">{{ post.body|safe }}</p>
|
||||
</details>
|
||||
|
Loading…
Reference in New Issue
Block a user