dashboard.html.twig 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. </ul>
  19. </div>
  20. {% endif %}
  21. {% if authorize(['admin.maintenance', 'admin.super']) %}
  22. <button data-gpm-checkupdates="" class="button"><i class="fa fa-refresh"></i> {{ "PLUGIN_ADMIN.CHECK_FOR_UPDATES"|tu }}</button>
  23. {% endif %}
  24. </div>
  25. <h1><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</h1>
  26. {% endblock %}
  27. {% block widgets %}
  28. {% if config.plugins.admin.notifications.dashboard %}
  29. <div class="dashboard-notifications-container"></div>
  30. {% endif %}
  31. <div id="admin-dashboard">
  32. {% if grav.twig.plugins_hooked_dashboard_widgets_top %}
  33. {% for widget in grav.twig.plugins_hooked_dashboard_widgets_top %}
  34. {% if attribute(config.plugins.admin.widgets, widget.template) == true %}
  35. <div class="dashboard-item-flex">
  36. {% include 'partials/' ~ widget.template ~ '.html.twig' %}
  37. </div>
  38. {% endif %}
  39. {% endfor %}
  40. {% endif %}
  41. </div>
  42. {% endblock %}
  43. {% block content %}
  44. {%- if grav.twig.plugins_hooked_dashboard_widgets_main -%}
  45. {%- for widget in grav.twig.plugins_hooked_dashboard_widgets_main -%}
  46. {%- if attribute(config.plugins.admin.widgets, widget.template) == true %}
  47. {% include 'partials/' ~ widget.template ~ '.html.twig' %}
  48. {% endif -%}
  49. {%- endfor -%}
  50. {%- endif -%}
  51. {% endblock %}
  52. {% block content_bottom %}
  53. <div id="admin-dashboard">
  54. {%- if grav.twig.plugins_hooked_dashboard_widgets_bottom -%}
  55. {%- for widget in grav.twig.plugins_hooked_dashboard_widgets_bottom -%}
  56. {%- if attribute(config.plugins.admin.widgets, widget.template) == true %}
  57. {% include 'partials/' ~ widget.template ~ '.html.twig' %}
  58. {% endif -%}
  59. {%- endfor -%}
  60. {%- endif -%}
  61. </div>
  62. {% endblock %}