user.html.twig 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {% extends 'partials/base.html.twig' %}
  2. {% if admin.route %}
  3. {% set user = admin.data('users/' ~ admin.route) %}
  4. {% set title = "PLUGIN_ADMIN.USER"|t ~ ": " ~ admin.route|e %}
  5. {% else %}
  6. {% set title = "PLUGIN_ADMIN_PRO.USERS"|t %}
  7. {% endif %}
  8. {% block titlebar %}
  9. {% if not admin.route %}
  10. {% if authorize(['admin.users', 'admin.super']) %}
  11. <div class="button-bar">
  12. <a class="button" href="#modal" data-remodal-target="modal"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD_ACCOUNT"|t }}</a>
  13. </div>
  14. <h1><i class="fa fa-fw fa-users"></i> {{ "PLUGIN_ADMIN.USERS"|t }}</h1>
  15. {% else %}
  16. <h1>{{ "PLUGIN_ADMIN.ACCESS_DENIED"|t }}</h1>
  17. {% endif %}
  18. {% else %}
  19. {% if authorize(['admin.users', 'admin.super']) or grav.user.username == user.username %}
  20. <div class="button-bar">
  21. {% if config.plugins["admin-pro"].enabled %}
  22. <a class="button" href="{{ base_url }}/users"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|t }}</a>
  23. {% endif %}
  24. <button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|t }}</button>
  25. </div>
  26. <h1><i class="fa fa-fw fa-user"></i> {{ "PLUGIN_ADMIN.USER"|t }}: {{ user.username }}</h1>
  27. {% else %}
  28. <h1>{{ "PLUGIN_ADMIN.ACCESS_DENIED"|t }}</h1>
  29. {% endif %}
  30. {% endif %}
  31. {% endblock %}
  32. {% block content %}
  33. {% if authorize(['admin.users', 'admin.super']) or grav.user.username == user.username %}
  34. <div>
  35. {% if not admin.route %}
  36. {% include 'partials/users-list.html.twig' %}
  37. <div class="remodal" data-remodal-id="modal" data-remodal-options="hashTracking: false, closeOnOutsideClick: false">
  38. {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('user/account_new') } %}
  39. </div>
  40. {% else %}
  41. {% include 'partials/blueprints.html.twig' with { data: user, blueprints: user.blueprints } %}
  42. {% endif %}
  43. </div>
  44. <div class="remodal" data-remodal-id="changes">
  45. <form>
  46. <h1>{{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_TITLE"|t }}</h1>
  47. <p class="bigger">
  48. {{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_DESC"|t }}
  49. </p>
  50. <br>
  51. <div class="button-bar">
  52. <a class="button secondary" data-leave-action="cancel" href="#"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|t }}</a>
  53. <a class="button" data-leave-action="continue" href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|t }}</a>
  54. </div>
  55. </form>
  56. </div>
  57. {% endif %}
  58. {% endblock %}