tools.html.twig 1.1 KB

12345678910111213141516171819202122232425262728
  1. {% extends 'partials/base.html.twig' %}
  2. {% set tools_slug = uri.basename|e %}
  3. {% if tools_slug == 'tools' %}{% set tools_slug = 'direct-install' %}{% endif %}
  4. {% set title = "PLUGIN_ADMIN.TOOLS"|tu ~ ": " ~ ("PLUGIN_ADMIN." ~ tools_slug|underscorize|upper)|tu %}
  5. {% block titlebar %}
  6. <h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.TOOLS"|tu }} - {{ ("PLUGIN_ADMIN." ~ tools_slug|underscorize|upper)|tu }}</h1>
  7. {% endblock %}
  8. {% block content_top %}
  9. <ul class="tab-bar">
  10. {% for tool in admin.tools %}
  11. <li {% if tools_slug == tool|hyphenize %}class="active"{% endif %}>
  12. {% if tools_slug == tool %}<span>{% else %}<a href="{{ base_url_relative }}/tools/{{tool|hyphenize}}">{% endif %}
  13. {{ tool|tu|capitalize }}
  14. {% if tools_slug == tool %}</span>{% else %}</a>{% endif %}
  15. </li>
  16. {% endfor %}
  17. </ul>
  18. {% endblock %}
  19. {% block content %}
  20. {% if authorize(['admin.tools', 'admin.super']) %}
  21. {% include 'partials/tools-' ~ tools_slug ~ '.html.twig' ignore missing %}
  22. {% endif %}
  23. {% endblock %}