diff --git a/app/models.py b/app/models.py index 90131d2e..45d8b24d 100644 --- a/app/models.py +++ b/app/models.py @@ -1087,7 +1087,7 @@ class User(UserMixin, db.Model): if user_note: return user_note.body else: - return None + return '' class ActivityLog(db.Model): diff --git a/app/templates/base.html b/app/templates/base.html index fa066b25..4badd911 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -33,12 +33,12 @@ [{{ user_note | truncate(12, True) }}] {% endif -%} {% endif -%} -
+ > {% endif -%} {% endmacro -%} diff --git a/app/templates/user/user_preview.html b/app/templates/user/user_preview.html index cba88076..df093d2e 100644 --- a/app/templates/user/user_preview.html +++ b/app/templates/user/user_preview.html @@ -2,20 +2,21 @@
{% if user.avatar_id -%} -
+
{% endif -%} -
- {{ user.display_name() }} +
+

{{ user.display_name() }}

+

{{ _('Instance') }}: {{ user.instance_domain() }}
+ {% if user.is_instance_admin() or (user.is_local() and user.is_admin()) %}({{ _('Admin') }})
{% endif %} + {% if user.is_admin() or user.is_staff() %}{{ _('Roles') }}: {% if user.is_admin() %}{{ _('Admin') }}{% endif %} {% if user.is_staff() %}{{ _('Staff') }}{% endif %}
{% endif %} +

-

{{ _('Instance') }}: {{ user.instance_domain() }} - {% if user.is_instance_admin() or (user.is_local() and user.is_admin()) %}({{ _('Admin') }}){% endif %}
- {% if user.is_admin() or user.is_staff() %}{{ _('Role permissions') }}: {% if user.is_admin() %}{{ _('Admin') }}{% endif %} {% if user.is_staff() %}{{ _('Staff') }}{% endif %}
{% endif %} - {{ _('Joined') }}: {{ arrow.get(user.created).humanize(locale=locale) }}
+

{{ _('Joined') }}: {{ arrow.get(user.created).humanize(locale=locale) }}
{% if current_user.is_authenticated and current_user.is_admin() %}{{ _('Referer') }}: {{ user.referrer if user.referrer }}
{% endif %} {% if current_user.is_authenticated and current_user.is_admin() %}{{ _('IP and country code') }}: {{ user.ip_address if user.ip_address }}{% if user.ip_address_country %} ({{ user.ip_address_country }}){% endif %}
{% endif %} {% if current_user.is_authenticated and current_user.is_admin() and user.last_seen %}{{ _('Active') }}: {{ arrow.get(user.last_seen).humanize(locale=locale) }}
{% endif %}