themes.html.twig 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {% extends 'partials/base.html.twig' %}
  2. {% if admin.route %}
  3. {% set installing = admin.route starts with 'install' %}
  4. {% set installed = true %}
  5. {# Try installed packages first, then remote #}
  6. {% set package = admin.themes(true)[admin.route] %}
  7. {% if (not package) %}
  8. {% set package = admin.themes(false)[admin.route] %}
  9. {% set installed = false %}
  10. {% endif %}
  11. {% set theme = package.toArray() %}
  12. {% set title = "PLUGIN_ADMIN.THEME"|tu ~ ": " ~ theme.name|e %}
  13. {% endif %}
  14. {% block titlebar %}
  15. {% if not admin.route or installing %}
  16. <div class="button-bar">
  17. {% if (installing) %}
  18. <a class="button" href="{{ base_url_relative }}/themes"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
  19. {% else %}
  20. <a class="button" href="{{ base_url }}/"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
  21. <a class="button" href="{{ base_url_relative }}/themes/install"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD"|tu }}</a>
  22. {% if authorize(['admin.maintenance', 'admin.super']) %}
  23. <button data-gpm-checkupdates="" class="button"><i class="fa fa-refresh"></i> {{ "PLUGIN_ADMIN.CHECK_FOR_UPDATES"|tu }}</button>
  24. {% endif %}
  25. {% endif %}
  26. </div>
  27. <h1><i class="fa fa-fw fa-tint"></i> {{ "PLUGIN_ADMIN.THEMES"|tu }}</h1>
  28. {% else %}
  29. {% if (installed) %}
  30. <div class="button-bar">
  31. <a class="button" href="{{ base_url_relative }}/themes"><i class="fa fa-arrow-left"></i> {{ "PLUGIN_ADMIN.BACK_TO_THEMES"|tu }}</a>
  32. <button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
  33. </div>
  34. {% else %}
  35. <div class="button-bar">
  36. <a class="button" href="{{ base_url_relative }}/themes/install"><i class="fa fa-arrow-left"></i> {{ "PLUGIN_ADMIN.BACK_TO_THEMES"|tu }}</a>
  37. </div>
  38. {% endif %}
  39. <h1><i class="fa fa-fw fa-tint"></i> {{ "PLUGIN_ADMIN.THEME"|tu }}: {{ theme.name|e }}</h1>
  40. {% endif %}
  41. {% endblock %}
  42. {% block content %}
  43. <div class="gpm gpm-themes">
  44. {% include 'partials/messages.html.twig' %}
  45. {% if not admin.route or installing %}
  46. {% include 'partials/themes-list.html.twig' %}
  47. {% else %}
  48. {% include 'partials/themes-details.html.twig' %}
  49. {% endif %}
  50. </div>
  51. {% endblock %}