dashboard.html.twig 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. {% extends 'partials/base.html.twig' %}
  2. {% block titlebar %}
  3. <div class="button-bar">
  4. {% if authorize(['admin.maintenance', 'admin.super']) %}
  5. <div class="button-group">
  6. <button data-clear-cache="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache" class="button"><i class="fa fa-trash"></i> {{ "PLUGIN_ADMIN.CLEAR_CACHE"|tu }}</button>
  7. <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
  8. <i class="fa fa-caret-down"></i>
  9. </button>
  10. <ul class="dropdown-menu">
  11. <li><a data-clear-cache="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache/cleartype{{ config.system.param_sep }}all" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_ALL_CACHE"|tu }}</a></li>
  12. <li><a data-clear-cache="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache/cleartype{{ config.system.param_sep }}assets-only" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_ASSETS_ONLY"|tu }}</a></li>
  13. <li><a data-clear-cache="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache/cleartype{{ config.system.param_sep }}images-only" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_IMAGES_ONLY"|tu }}</a></li>
  14. <li><a data-clear-cache="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache/cleartype{{ config.system.param_sep }}cache-only" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_CACHE_ONLY"|tu }}</a></li>
  15. </ul>
  16. </div>
  17. <button data-gpm-checkupdates="" class="button"><i class="fa fa-refresh"></i> {{ "PLUGIN_ADMIN.CHECK_FOR_UPDATES"|tu }}</button>
  18. {% endif %}
  19. </div>
  20. <h1><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</h1>
  21. {% endblock %}
  22. {% block messages %}{% endblock %}
  23. {% block content_top %}
  24. {% set gpm = admin.gpm() %}
  25. {% set updatable = gpm.getUpdatablePlugins() %}
  26. {% set backup = admin.lastBackup() %}
  27. <div id="admin-dashboard">
  28. {% if authorize(['admin.maintenance', 'admin.super']) %}
  29. <div id="updates" class="dashboard-item dashboard-left">
  30. <div class="tertiary-accent default-box-shadow">
  31. <h1>{{ "PLUGIN_ADMIN.MAINTENANCE"|tu }}</h1>
  32. <div class="admin-update-charts">
  33. <div class="updates-chart">
  34. <div class="chart-wrapper">
  35. <div class="ct-chart"></div>
  36. <span class="numeric hidden"><span>-</span><em>{{ "PLUGIN_ADMIN.UPDATED"|tu|lower }}</em></span>
  37. </div>
  38. <p class="js__updates-available-description">&nbsp;</p>
  39. </div>
  40. <div class="backups-chart">
  41. <div class="chart-wrapper">
  42. <div class="ct-chart"></div>
  43. <script>
  44. var data = {
  45. series: [{{ backup.chart_fill }}, {{ backup.chart_empty }}]
  46. };
  47. var options = {
  48. donut: true,
  49. donutWidth: 10,
  50. startAngle: 0,
  51. total: 100,
  52. showLabel: false,
  53. height: 150,
  54. chartPadding: !isFirefox ? 5 : 10
  55. };
  56. Chartist.Pie('.backups-chart .ct-chart', data, options);
  57. </script>
  58. <span class="numeric">{{ backup.days }}<em>{{ "PLUGIN_ADMIN.DAYS"|tu|lower }}</em></span>
  59. </div>
  60. <p>{{ "PLUGIN_ADMIN.LAST_BACKUP"|tu }}</p>
  61. </div>
  62. </div>
  63. <div class="flush-bottom button-bar">
  64. <button data-maintenance-update="{{ base_url_relative }}/update.json/task{{ config.system.param_sep }}update" class="button"><i class="fa fa-cloud-download"></i> {{ "PLUGIN_ADMIN.UPDATE"|tu }}</button>
  65. <button data-ajax="{{ base_url_relative }}/backup.json/task{{ config.system.param_sep }}backup" class="button"><i class="fa fa-database"></i> {{ "PLUGIN_ADMIN.BACKUP"|tu }}</button>
  66. </div>
  67. </div>
  68. </div>
  69. {% endif %}
  70. {% if authorize(['admin.statistics', 'admin.super']) %}
  71. <div id="popularity" class="dashboard-item dashboard-right">
  72. <div class="secondary-accent default-box-shadow">
  73. <h1>{{ "PLUGIN_ADMIN.STATISTICS"|tu }}</h1>
  74. <div class="ct-chart"></div>
  75. <script>
  76. var data = {
  77. labels: {{ popularity.getDailyChartData['labels'] }},
  78. series: [
  79. {{ popularity.getDailyChartData['data'] }}
  80. ]
  81. };
  82. var options = {
  83. height: 164,
  84. chartPadding: !isFirefox ? 5 : 25,
  85. axisX: {
  86. showGrid: false,
  87. labelOffset: {
  88. x: 0,
  89. y: 5
  90. }
  91. },
  92. axisY: {
  93. offset: 15,
  94. showLabel: true,
  95. showGrid: true,
  96. labelOffset: {
  97. x: 5,
  98. y: 5
  99. },
  100. scaleMinSpace: 20
  101. }
  102. };
  103. Chartist.Bar('#popularity .ct-chart', data, options);
  104. </script>
  105. <div class="flush-bottom button-bar stats-bar">
  106. <span class="stat">
  107. <b>{{ popularity.getDailyTotal }}</b>
  108. <i>{{ "PLUGIN_ADMIN.TODAY"|tu }}</i>
  109. </span>
  110. <span class="stat">
  111. <b>{{ popularity.getWeeklyTotal }}</b>
  112. <i>{{ "PLUGIN_ADMIN.WEEK"|tu }}</i>
  113. </span>
  114. <span class="stat">
  115. <b>{{ popularity.getMonthlyTotal }}</b>
  116. <i>{{ "PLUGIN_ADMIN.MONTH"|tu }}</i>
  117. </span>
  118. </div>
  119. </div>
  120. </div>
  121. {% endif %}
  122. </div>
  123. {% endblock %}
  124. {% block content %}
  125. {% include 'partials/messages.html.twig' %}
  126. {% if config.plugins.admin.show_beta_msg %}
  127. <div class="error alert"><i class="fa fa-exclamation-circle"></i> {{ 'PLUGIN_ADMIN.ADMIN_BETA_MSG'|tu }}</div>
  128. {% endif %}
  129. {% if authorize(['admin.pages', 'admin.super']) %}
  130. <div id="latest">
  131. <div class="button-bar">
  132. <a class="button" href="{{ uri.route(true) }}/pages"><i class="fa fa-fw fa-file-text-o"></i>{{ "PLUGIN_ADMIN.MANAGE_PAGES"|tu }}</a>
  133. </div>
  134. <h1>{{ "PLUGIN_ADMIN.LATEST_PAGE_UPDATES"|tu }}</h1>
  135. <table>
  136. {% for latest in admin.latestPages %}
  137. <tr><td class="double page-title"><a href="{{ base_url }}/pages/{{ latest.route|trim('/') }}"><i class="fa fa-fw fa-file-o"></i> {{ latest.title }}</a></td><td class="double page-route">{{ latest.route }}</td><td><b class="last-modified">{{ latest.modified|nicetime }}</b></td></tr>
  138. {% endfor %}
  139. </table>
  140. </div>
  141. {% endif %}
  142. {% endblock %}