user.html.twig 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {% extends 'partials/base.html.twig' %}
  2. {% if admin.route %}
  3. {% set user = admin.data('users/' ~ admin.route) %}
  4. {% set title = "PLUGIN_ADMIN.USER"|tu ~ ": " ~ admin.route|e %}
  5. {% else %}
  6. {% set title = "PLUGIN_ADMIN_PRO.USERS"|tu %}
  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"|tu }}</a>
  13. </div>
  14. <h1><i class="fa fa-fw fa-users"></i> {{ "PLUGIN_ADMIN.USERS"|tu }}</h1>
  15. {% else %}
  16. <h1>{{ "PLUGIN_ADMIN.ACCESS_DENIED"|tu }}</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"|tu }}</a>
  23. {% endif %}
  24. <button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
  25. </div>
  26. <h1><i class="fa fa-fw fa-user"></i> {{ "PLUGIN_ADMIN.USER"|tu }}: {{ user.username|e }}</h1>
  27. {% else %}
  28. <h1>{{ "PLUGIN_ADMIN.ACCESS_DENIED"|tu }}</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">
  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"|tu }}</h1>
  47. <p class="bigger">
  48. {{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_DESC"|tu }}
  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"|tu }}</a>
  53. <a class="button" data-leave-action="continue" href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
  54. </div>
  55. </form>
  56. </div>
  57. {% endif %}
  58. {% endblock %}