diff --git a/snikket_web/scss/app.scss b/snikket_web/scss/app.scss index 9f5d45c..314c0f3 100644 --- a/snikket_web/scss/app.scss +++ b/snikket_web/scss/app.scss @@ -1206,6 +1206,13 @@ pre.guru-meditation { p.form-desc.weak, p.field-desc.weak { color: $gray-700; } + + .user-badge-icon { + color: $gray-900 !important; + background-color: $gray-100 !important; + border-color: $gray-300 !important; + box-shadow: black 0 0 2px !important; + } } /* tooltip magic */ @@ -1256,3 +1263,42 @@ pre.guru-meditation { .with-tooltip:hover:before, .with-tooltip:hover:after { display: block; } + +.username-with-avatar { + display: flex; + align-items: center; + + .avatar-container { + position: relative; + } + + .user-badge-icon { + position: absolute; + bottom: -10px; + right: 0px; + background: white; + border-radius: 50%; + width: 1.2em; + height: 1.2em; + border-color: $gray-500; + border-width: 1px; + border-style: solid; + text-align: center; + margin: 0; + padding: 0; + margin: 0; + padding: 0; + box-shadow: $gray-500 0px 0px 2px; + + line-height: 1; + .icon { + /* vertical-align: text-bottom; */ + padding: 0.1em; + } + } + + .user-info-container { + margin-left: 0.5em; + } + +} diff --git a/snikket_web/templates/admin_users.html b/snikket_web/templates/admin_users.html index 7c1831b..3ad15de 100644 --- a/snikket_web/templates/admin_users.html +++ b/snikket_web/templates/admin_users.html @@ -1,12 +1,12 @@ {% extends "admin_app.html" %} -{% from "library.j2" import action_button, icon, value_or_hint, custom_form_button %} +{% from "library.j2" import action_button, avatar, icon, render_user, value_or_hint, custom_form_button with context %} {% block content %}

{% trans %}Manage users{% endtrans %}

- - + + @@ -14,15 +14,15 @@ {% for user in users %} - + {% if user.enabled %} + + {% elif user.deletion_request %} + + {% else %} + + {% endif %}
{% trans %}Login name{% endtrans %}{% trans %}Display name{% endtrans %}{% trans %}User{% endtrans %}{% trans %}Last active{% endtrans %} {% trans %}Actions{% endtrans %}
- {{- user.localpart -}} - {%- if user.has_admin_role -%} - {% call icon("admin") %}{% trans %} (Administrator){% endtrans %}{% endcall %} - {%- endif -%} - {%- if user.has_restricted_role -%} - {% call icon("lock") %}{% trans %} (Restricted){% endtrans %}{% endcall %} - {%- endif -%} + {%- call render_user(user) -%}{%- endcall -%} {% call value_or_hint(user.display_name) %}{% endcall %}{{ user.last_active | format_last_activity }}{% trans %}Deleted{% endtrans %}{% trans %}Locked{% endtrans %} {%- call action_button("edit", url_for(".edit_user", localpart=user.localpart), class="primary") -%} {% trans user_name=user.localpart %}Edit user {{ user_name }}{% endtrans %} diff --git a/snikket_web/templates/library.j2 b/snikket_web/templates/library.j2 index d717a23..bb0cef2 100644 --- a/snikket_web/templates/library.j2 +++ b/snikket_web/templates/library.j2 @@ -10,6 +10,29 @@ {%- endif -%} {%- endmacro %} +{% macro render_user(user, caller=None) -%} +
+
+ {%- call avatar(user.localpart+"@"+config["SNIKKET_DOMAIN"], user.avatar_info[0].hash if user.avatar_info | length > 0 else None ) %}{% endcall -%} + {%- if user.has_admin_role -%} +
+ {% call icon("admin") %}{% trans %} (Administrator){% endtrans %}{% endcall %} +
+ {%- elif user.has_restricted_role -%} +
+ {% call icon("lock") %}{% trans %} (Restricted){% endtrans %}{% endcall %} +
+ {%- endif -%} +
+ +
+{%- endmacro -%} + {% macro showuri(uri, caller=None, id_=None) %} {%- if uri is none -%}