From 0ca0f83ac4ffcb35b176fb0513d6c9e739382e83 Mon Sep 17 00:00:00 2001 From: Craig Williams Date: Wed, 7 Jun 2023 13:29:24 +0100 Subject: [PATCH] Removed dependency on blockier-templates --- templates/pages/user.html.twig | 293 ++++++++++++++++++++++----------- 1 file changed, 201 insertions(+), 92 deletions(-) diff --git a/templates/pages/user.html.twig b/templates/pages/user.html.twig index 5b5a01e..4588801 100644 --- a/templates/pages/user.html.twig +++ b/templates/pages/user.html.twig @@ -1,104 +1,213 @@ -{% extends "@blockier-templates/pages/user.html.twig" %} +{% extends "@admin/pages/user.html.twig" %} -{% block tools %} -
  • - - {{translate('EDIT')}} - -
  • - {% if 'password' not in tools.hidden %} -
  • - - {{translate('PASSWORD')}} - -
  • - {% endif %} - {% if 'roles' not in tools.hidden %} -
  • - - {{translate('ROLE', 2)}} - -
  • - {% endif %} - {% if 'organisations' not in tools.hidden %} -
  • - - {{translate('ORGANISATION', 2)}} - -
  • - {% endif %} - {% if 'activate' not in tools.hidden and user.flag_verified == "0" %} -
  • - - {{translate('ACTIVATE')}} - -
  • - {% endif %} - {% if 'enable' not in tools.hidden %} - {% if user.flag_enabled == "1" %} -
  • - - {{translate('DISABLE')}} - -
  • - {% else %} -
  • - - {{translate('ENABLE')}} - -
  • - {% endif %} - {% endif %} - {% if 'delete' not in tools.hidden %} -
  • - - {{translate('DELETE')}} - -
  • - {% endif %} -{% endblock %} +{% block body_matter %} + {% block group_box %} + {% endblock %} +
    +
    +
    + {% block user_box %} +
    +
    +

    {{translate('USER.SUMMARY')}}

    + {% if 'tools' not in tools.hidden %} +
    +
    + + +
    +
    + {% endif %} +
    +
    + {{user.user_name}} +

    {{user.full_name}}

    +
    + {% if user.flag_enabled == 0 %} + + {% endif %} + {% if user.flag_verified == 0 %} + + {% endif %} +
    +

    {{user.user_name}}{% if 'group' not in fields.hidden and user.group.name is not null %} • {{user.group.name}}{% endif %}

    -{% block user_box %} - {{ parent() }} -
    -
    -

    {{translate('USER.ORGANISATIONS')}}

    + {% if 'email' not in fields.hidden %} +
    + {{translate("EMAIL")}} +

    + + {{user.email}} +

    + {% endif %} + + {% if 'locale' not in fields.hidden %} +
    + {{translate("LOCALE")}} +

    + {{locales[user.locale]}} +

    + {% endif %} + + {% block user_profile %}{% endblock %} + + {% if 'roles' not in fields.hidden %} +
    + {{translate("ROLE", 2)}} +

    + {% for role in user.roles %} + {{role.name}} + {% endfor %} +

    + {% endif %} +
    +
    + {% endblock %} + {% block organisations_box %} +
    +
    +

    {{translate('USER.ORGANISATIONS')}}

    +
    +
    +

    + {% for organisation in user.organisations %} +

    +
    + {{organisation.name}} +
    + {{organisation.description}} +
    + {% if checkAccess('update_user_field', { 'user' : user, 'fields' : ['organisations'] }) or hasRole('organisations-admin') -%} +
    + +
    + {% endif -%} +
    +
    + {% endfor %} + {% for organisation in user.pendingOrganisations %} +
    +
    + {{organisation.name}} +
    + {{organisation.description}} +
    + {% if checkAccess('update_user_field', { 'user' : user, 'fields' : ['organisations'] }) or hasRole('organisations-admin') -%} +
    + +
    + {% endif -%} +
    +
    + {% endfor %} +

    +
    +
    + {% endblock %} +
    -
    -

    - {% for organisation in user.organisations %} -

    -
    - {{organisation.name}} -
    - {{organisation.description}} + {% if 'activities' not in widgets.hidden %} +
    + {% block activity_box %} +
    +
    +

    {{translate('ACTIVITY', 2)}}

    + {% include "tables/table-tool-menu.html.twig" %}
    - {% if hasRole('site-admin') or hasRole('organisations-admin') -%} -
    - +
    + {% include "tables/activities.html.twig" with { + "table" : { + "id" : "table-user-activities" + } + } + %}
    - {% endif -%}
    -
    - {% endfor %} - {% for organisation in user.pendingOrganisations %} -
    -
    - {{organisation.name}} -
    - {{organisation.description}} -
    - {% if hasRole('site-admin') or hasRole('organisations-admin') -%} -
    - -
    - {% endif -%} + {% endblock %} +
    + {% endif %} +
    + {% if 'permissions' not in widgets.hidden %} +
    +
    +
    +
    +

    {{translate('PERMISSION', 2)}}

    + {% include "tables/table-tool-menu.html.twig" %}
    -
    - {% endfor %} -

    +
    + {% include "tables/permissions.html.twig" with { + "table" : { + "id" : "table-permissions", + "columns" : ["via_roles"] + } + } + %} +
    +
    + {% endif %} {% endblock %} \ No newline at end of file