dashboard.html.twig 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {% extends 'partials/base.html.twig' %}
  2. {% set title = "PLUGIN_ADMIN.DASHBOARD"|t %}
  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-retweet"></i> {{ "PLUGIN_ADMIN.CLEAR_CACHE"|t }}</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"|t }}</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"|t }}</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"|t }}</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"|t }}</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"|t }}</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"|t }}</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"|t }}</button>
  24. {% endif %}
  25. </div>
  26. <h1><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.DASHBOARD"|t }}</h1>
  27. {% endblock %}
  28. {% block widgets %}
  29. {% if config.plugins.admin.notifications.dashboard %}
  30. <div class="dashboard-notifications-container"></div>
  31. {% endif %}
  32. {# System notifications, cannot be turned off #}
  33. {% include 'partials/dashboard-problems.html.twig' %}
  34. <div id="admin-dashboard">
  35. {% if grav.twig.plugins_hooked_dashboard_widgets_top %}
  36. {% for widget in grav.twig.plugins_hooked_dashboard_widgets_top %}
  37. {% if attribute(config.plugins.admin.widgets_display, widget.template)|string in ['1', 'true'] %}
  38. <div class="dashboard-item-flex">
  39. {% include 'partials/' ~ widget.template ~ '.html.twig' %}
  40. </div>
  41. {% endif %}
  42. {% endfor %}
  43. {% endif %}
  44. </div>
  45. {% endblock %}
  46. {% block content %}
  47. {%- if grav.twig.plugins_hooked_dashboard_widgets_main -%}
  48. {%- for widget in grav.twig.plugins_hooked_dashboard_widgets_main -%}
  49. {% if attribute(config.plugins.admin.widgets_display, widget.template)|string in ['1', 'true'] %}
  50. {% include 'partials/' ~ widget.template ~ '.html.twig' %}
  51. {% endif -%}
  52. {%- endfor -%}
  53. {%- endif -%}
  54. {% endblock %}
  55. {% block content_bottom %}
  56. <div id="admin-dashboard">
  57. {%- if grav.twig.plugins_hooked_dashboard_widgets_bottom -%}
  58. {%- for widget in grav.twig.plugins_hooked_dashboard_widgets_bottom -%}
  59. {% if attribute(config.plugins.admin.widgets_display, widget.template)|string in ['1', 'true'] %}
  60. {% include 'partials/' ~ widget.template ~ '.html.twig' %}
  61. {% endif -%}
  62. {%- endfor -%}
  63. {%- endif -%}
  64. </div>
  65. {% endblock %}