Add direct link to reply/comment

It's difficult to be able to copy and paste a link to a specific
comment or reply. It's only easy from the notifications page.

This patch introduces a link to a comment/reply by changing
the <span> to a <a> around the "When" text like "15 hours ago".

This is usually how other websites do deep links to comments too,
they make the time of post into a clickable link, so people should
be able to find it easyly.
This commit is contained in:
Jeena 2024-09-27 10:55:39 +00:00
parent a14a41c18e
commit 14fa658774

View file

@ -84,7 +84,7 @@
{{ render_username(comment['comment'].author) }}
{% endwith -%}
{% if comment['comment'].author.id == post.author.id -%}<span title="Submitter of original post" aria-label="{{ _('Post creator') }}" class="small">[OP] </span>{% endif -%}
<span class="text-muted small" aria_label="{{ _('When: ') }}">{{ arrow.get(comment['comment'].posted_at).humanize(locale=locale) }}{% if comment['comment'].edited_at -%}, edited {{ arrow.get(comment['comment'].edited_at).humanize(locale=locale) }} {% endif -%}</span>
<a href="#comment_{{ comment['comment'].id }}" class="text-muted small" aria_label="{{ _('When: ') }}">{{ arrow.get(comment['comment'].posted_at).humanize(locale=locale) }}{% if comment['comment'].edited_at -%}, edited {{ arrow.get(comment['comment'].edited_at).humanize(locale=locale) }} {% endif -%}</a>
<a class="unhide" href="#"><span class="fe fe-expand"></span></a>
{% if comment['comment'].reports and current_user.is_authenticated and post.community.is_moderator(current_user)%}
<span class="red fe fe-report" title="{{ _('Reported. Check comment for issues.') }}"></span>