dashboard.html.twig 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {% extends 'partials/base.html.twig' %}
  2. {% set title = "PLUGIN_ADMIN.DASHBOARD"|tu %}
  3. {% set clear_cache_url = base_url_relative ~ '/cache.json/task' ~ config.system.param_sep ~ 'clearCache'|e('html_attr') %}
  4. {% block titlebar %}
  5. <div class="button-bar">
  6. {% if authorize(['admin.maintenance', 'admin.super', 'admin.cache']) %}
  7. <div class="button-group">
  8. <button data-clear-cache-type="" data-clear-cache="{{ uri.addNonce(clear_cache_url, 'admin-form', 'admin-nonce') }}" class="button"><i class="fa fa-trash"></i> {{ "PLUGIN_ADMIN.CLEAR_CACHE"|tu }}</button>
  9. <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
  10. <i class="fa fa-caret-down"></i>
  11. </button>
  12. <ul class="dropdown-menu">
  13. <li><a data-clear-cache-type="all" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'all', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_ALL_CACHE"|tu }}</a></li>
  14. <li><a data-clear-cache-type="assets-only" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'assets-only', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_ASSETS_ONLY"|tu }}</a></li>
  15. <li><a data-clear-cache-type="images-only" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'images-only', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_IMAGES_ONLY"|tu }}</a></li>
  16. <li><a data-clear-cache-type="cache-only" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'cache-only', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_CACHE_ONLY"|tu }}</a></li>
  17. <li><a data-clear-cache-type="tmp-only" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'tmp-only', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_TMP_ONLY"|tu }}</a></li>
  18. <li><a data-clear-cache-type="purge" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'purge', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CACHE_PURGE"|tu }}</a></li>
  19. </ul>
  20. </div>
  21. {% endif %}
  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. </div>
  26. <h1><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</h1>
  27. {% endblock %}
  28. {% block widgets %}
  29. {% if config.plugins.admin.notifications.dashboard %}
  30. <div class="dashboard-notifications-container"></div>
  31. {% endif %}
  32. <div id="admin-dashboard">
  33. {% if grav.twig.plugins_hooked_dashboard_widgets_top %}
  34. {% for widget in grav.twig.plugins_hooked_dashboard_widgets_top %}
  35. {% if attribute(config.plugins.admin.widgets, widget.template) == true %}
  36. <div class="dashboard-item-flex">
  37. {% include 'partials/' ~ widget.template ~ '.html.twig' %}
  38. </div>
  39. {% endif %}
  40. {% endfor %}
  41. {% endif %}
  42. </div>
  43. {% endblock %}
  44. {% block content %}
  45. {%- if grav.twig.plugins_hooked_dashboard_widgets_main -%}
  46. {%- for widget in grav.twig.plugins_hooked_dashboard_widgets_main -%}
  47. {%- if attribute(config.plugins.admin.widgets, widget.template) == true %}
  48. {% include 'partials/' ~ widget.template ~ '.html.twig' %}
  49. {% endif -%}
  50. {%- endfor -%}
  51. {%- endif -%}
  52. {% endblock %}
  53. {% block content_bottom %}
  54. <div id="admin-dashboard">
  55. {%- if grav.twig.plugins_hooked_dashboard_widgets_bottom -%}
  56. {%- for widget in grav.twig.plugins_hooked_dashboard_widgets_bottom -%}
  57. {%- if attribute(config.plugins.admin.widgets, widget.template) == true %}
  58. {% include 'partials/' ~ widget.template ~ '.html.twig' %}
  59. {% endif -%}
  60. {%- endfor -%}
  61. {%- endif -%}
  62. </div>
  63. {% endblock %}