fix alignment of edited date on posts

This commit is contained in:
rimu 2025-01-16 16:17:55 +13:00
parent d06b7ea4b0
commit 0f0e0b40b6
3 changed files with 11 additions and 10 deletions

View file

@ -1087,7 +1087,7 @@ class User(UserMixin, db.Model):
if user_note: if user_note:
return user_note.body return user_note.body
else: else:
return None return ''
class ActivityLog(db.Model): class ActivityLog(db.Model):

View file

@ -33,12 +33,12 @@
<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 }}" <span class="d-none user_preview" id="preview_{{ user.id }}"
hx-get="{{ url_for('user.user_preview', user_id=user.id) }}" hx-get="{{ url_for('user.user_preview', user_id=user.id) }}"
hx-trigger="intersect once" hx-trigger="intersect once"
hx-target="this" hx-target="this"
hx-swap="innerHTML" hx-swap="innerHTML"
></div> ></span>
{% endif -%} {% endif -%}
</span> </span>
{% endmacro -%} {% endmacro -%}

View file

@ -2,20 +2,21 @@
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
{% if user.avatar_id -%} {% if user.avatar_id -%}
<div class="col-auto preview_avatar_image"> <div class="col-6 preview_avatar_image">
<img src="{{ user.avatar_image() }}" alt="" loading="lazy" /> <img src="{{ user.avatar_image() }}" alt="" loading="lazy" />
</div> </div>
{% endif -%} {% endif -%}
<div class="col-auto"> <div class="col-6">
<a href="/u/{{ user.link() }}">{{ user.display_name() }}</a> <h4 class="mb-0"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></h4>
<p>{{ _('Instance') }}: <a href="{{ url_for('instance.instance_overview', instance_domain=user.instance_domain()) }}">{{ user.instance_domain() }}</a><br>
{% if user.is_instance_admin() or (user.is_local() and user.is_admin()) %}<span class="red">({{ _('Admin') }})</span><br>{% endif %}
{% if user.is_admin() or user.is_staff() %}{{ _('Roles') }}: {% if user.is_admin() %}{{ _('Admin') }}{% endif %} {% if user.is_staff() %}{{ _('Staff') }}{% endif %}<br />{% endif %}
</p>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-auto"> <div class="col-auto">
<p>{{ _('Instance') }}: <a href="{{ url_for('instance.instance_overview', instance_domain=user.instance_domain()) }}">{{ user.instance_domain() }}</a> <p> {{ _('Joined') }}: {{ arrow.get(user.created).humanize(locale=locale) }}<br />
{% if user.is_instance_admin() or (user.is_local() and user.is_admin()) %}<span class="red">({{ _('Admin') }})</span>{% endif %}<br />
{% if user.is_admin() or user.is_staff() %}{{ _('Role permissions') }}: {% if user.is_admin() %}{{ _('Admin') }}{% endif %} {% if user.is_staff() %}{{ _('Staff') }}{% endif %}<br />{% endif %}
{{ _('Joined') }}: {{ arrow.get(user.created).humanize(locale=locale) }}<br />
{% if current_user.is_authenticated and current_user.is_admin() %}{{ _('Referer') }}: <span title="{{ _('Which website linked to PieFed when the user initially registered.') }}">{{ user.referrer if user.referrer }}</span><br />{% endif %} {% if current_user.is_authenticated and current_user.is_admin() %}{{ _('Referer') }}: <span title="{{ _('Which website linked to PieFed when the user initially registered.') }}">{{ user.referrer if user.referrer }}</span><br />{% endif %}
{% if current_user.is_authenticated and current_user.is_admin() %}{{ _('IP and country code') }}: <span title="{{ _('IP address of last interaction.') }}">{{ user.ip_address if user.ip_address }}{% if user.ip_address_country %} ({{ user.ip_address_country }}){% endif %}</span><br />{% endif %} {% if current_user.is_authenticated and current_user.is_admin() %}{{ _('IP and country code') }}: <span title="{{ _('IP address of last interaction.') }}">{{ user.ip_address if user.ip_address }}{% if user.ip_address_country %} ({{ user.ip_address_country }}){% endif %}</span><br />{% endif %}
{% if current_user.is_authenticated and current_user.is_admin() and user.last_seen %}{{ _('Active') }}: {{ arrow.get(user.last_seen).humanize(locale=locale) }}<br />{% endif %} {% if current_user.is_authenticated and current_user.is_admin() and user.last_seen %}{{ _('Active') }}: {{ arrow.get(user.last_seen).humanize(locale=locale) }}<br />{% endif %}