fix html and make user_preview popups work on posts and together with icons

This commit is contained in:
Hendrik L 2025-01-13 16:39:12 +01:00
parent 4bcd218b8a
commit 9f49c02ac6
2 changed files with 13 additions and 13 deletions

View file

@ -13,6 +13,16 @@
{% endif -%} {% endif -%}
{{ user.display_name() }}{% if add_domain and not user.is_local() %}<span class="text-muted">@{{ user.ap_domain }}</span>{% endif %} {{ user.display_name() }}{% if add_domain and not user.is_local() %}<span class="text-muted">@{{ user.ap_domain }}</span>{% endif %}
</a> </a>
<div class="d-none user_preview" id="preview_{{ user.id }}"
{% if htmx_redirect_back_to -%}
hx-get="{{ url_for('user.user_preview', user_id=user.id, return_to=htmx_redirect_back_to) }}"
{% else %}
hx-get="{{ url_for('user.user_preview', user_id=user.id) }}"
{% endif %}
hx-trigger="intersect once"
hx-target="this"
hx-swap="innerHTML"
></div>
{% if user.created_recently() -%} {% if user.created_recently() -%}
<span class="fe fe-new-account" title="New account"> </span> <span class="fe fe-new-account" title="New account"> </span>
{% endif -%} {% endif -%}
@ -33,16 +43,6 @@
<span class="user_note" title="{{ _('User note: %(note)s', note=user_note) }}">[{{ user_note | truncate(12, True) }}]</span> <span class="user_note" title="{{ _('User note: %(note)s', note=user_note) }}">[{{ user_note | truncate(12, True) }}]</span>
{% endif -%} {% endif -%}
{% endif -%} {% endif -%}
<div class="d-none user_preview" id="preview_{{ user.id }}"
{% if htmx_redirect_back_to -%}
hx-get="{{ url_for('user.user_preview', user_id=user.id, return_to=htmx_redirect_back_to) }}"
{% else %}
hx-get="{{ url_for('user.user_preview', user_id=user.id) }}"
{% endif %}
hx-trigger="intersect once"
hx-target="this"
hx-swap="innerHTML"
></div>
{% endif -%} {% endif -%}
</span> </span>
{% endmacro -%} {% endmacro -%}

View file

@ -14,12 +14,12 @@
<p><a href="{{ post.url }}" rel="nofollow ugc" target="_blank" aria-label="Go to image">{{ post.url|shorten_url }} <p><a href="{{ post.url }}" rel="nofollow ugc" target="_blank" aria-label="Go to image">{{ post.url|shorten_url }}
<span class="fe fe-external"></span></a></p> <span class="fe fe-external"></span></a></p>
{% endif -%} {% endif -%}
<p>{% if post.reports > 0 and current_user.is_authenticated and post.community.is_moderator(current_user) -%} <div>{% if post.reports > 0 and current_user.is_authenticated and post.community.is_moderator(current_user) -%}
<span class="red fe fe-report" title="{{ _('Reported. Check post for issues.') }}"></span> <span class="red fe fe-report" title="{{ _('Reported. Check post for issues.') }}"></span>
{% endif -%}<small>submitted <time datetime="{{ arrow.get(post.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}" title="{{ arrow.get(post.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}">{{ arrow.get(post.posted_at).humanize(locale=locale) }}</time> by {% endif -%}<small>submitted <time datetime="{{ arrow.get(post.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}" title="{{ arrow.get(post.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}">{{ arrow.get(post.posted_at).humanize(locale=locale) }}</time> by
{{ render_username(post.author, htmx_redirect_back_to=request.url) }} {{ render_username(post.author, htmx_redirect_back_to=request.url) }}
{% if post.edited_at -%} edited <time datetime="{{ arrow.get(post.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}" title="{{ arrow.get(post.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}">{{ arrow.get(post.edited_at).humanize(locale=locale) }}{% endif -%}</time></small> {% if post.edited_at -%} edited <time datetime="{{ arrow.get(post.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}" title="{{ arrow.get(post.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}">{{ arrow.get(post.edited_at).humanize(locale=locale) }}</time>{% endif -%}</small>
</p> </div>
{% if post.type == POST_TYPE_IMAGE -%} {% if post.type == POST_TYPE_IMAGE -%}
<div class="post_image"> <div class="post_image">
{% if post.image_id -%} {% if post.image_id -%}