plugins.html.twig 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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.plugins(true)[admin.route] %}
  7. {% if (not package) %}
  8. {% set package = admin.plugins(false)[admin.route] %}
  9. {% set installed = false %}
  10. {% endif %}
  11. {% set plugin = package.toArray() %}
  12. {% set title = "PLUGIN_ADMIN.PLUGIN"|tu ~ ": " ~ plugin.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 }}/plugins"><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 }}/plugins/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-plug"></i> {{ "PLUGIN_ADMIN.PLUGINS"|tu }}</h1>
  28. {% else %}
  29. {% if (installed) %}
  30. <div class="button-bar">
  31. <a class="button" href="{{ base_url_relative }}/plugins"><i class="fa fa-arrow-left"></i> {{ "PLUGIN_ADMIN.BACK_TO_PLUGINS"|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 }}/plugins/install"><i class="fa fa-arrow-left"></i> {{ "PLUGIN_ADMIN.BACK_TO_PLUGINS"|tu }}</a>
  37. </div>
  38. {% endif %}
  39. <h1><i class="fa fa-fw fa-plug"></i> {{ "PLUGIN_ADMIN.PLUGIN"|tu }}: {{ plugin.name|e }}</h1>
  40. {% endif %}
  41. {% endblock %}
  42. {% block content %}
  43. <div class="gpm gpm-plugins">
  44. {% include 'partials/messages.html.twig' %}
  45. {% if not admin.route or installing %}
  46. {% include 'partials/plugins-list.html.twig' %}
  47. {% else %}
  48. {% include 'partials/plugins-details.html.twig' %}
  49. {% endif %}
  50. </div>
  51. {% endblock %}