nav.html.twig 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <nav id="admin-sidebar">
  2. <div id="admin-logo">
  3. <h3><a href="{{ base_url_relative }}">{{ "PLUGIN_ADMIN.GRAV_ADMIN"|tu }}</a> <a target="_blank" href="{{ base_url_relative_frontend }}"><i class="fa fa-fw fa-angle-double-right"></i></a></h3>
  4. </div>
  5. {#{% if admin.authorize %}#}
  6. <div id="admin-user-details">
  7. <a href="{{ base_url_relative }}/users/{{ admin.user.username }}">
  8. <img src="http://www.gravatar.com/avatar/{{ admin.user.email|md5 }}?s=32" />
  9. <div class="admin-user-names">
  10. <h4>{{ admin.user.fullname }}</h4>
  11. <h5>{{ admin.user.title }}</h5>
  12. </div>
  13. </a>
  14. </div>
  15. {#{% endif %}#}
  16. <ul id="admin-menu">
  17. <li class="{{ (location == 'dashboard') ? 'selected' : '' }}">
  18. <a href="{{ base_url_relative }}"><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</a>
  19. </li>
  20. {% if authorize(['admin.configuration', 'admin.super']) %}
  21. <li class="{{ (location == 'system' or location == 'site') ? 'selected' : '' }}">
  22. <a href="{{ base_url_relative }}/system"><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }}</a>
  23. </li>
  24. {% endif %}
  25. {% if authorize(['admin.pages', 'admin.super']) %}
  26. <li class="{{ (location == 'pages') ? 'selected' : '' }}">
  27. <a href="{{ base_url_relative }}/pages">
  28. <i class="fa fa-fw fa-file-text-o"></i> {{ "PLUGIN_ADMIN.PAGES"|tu }}
  29. <span class="badges">
  30. <span class="badge count">{{ admin.countPages }}</span>
  31. </span>
  32. </a>
  33. </li>
  34. {% endif %}
  35. {% if grav.twig.plugins_hooked_nav %}
  36. {% for label, item in grav.twig.plugins_hooked_nav %}
  37. {% if authorize(['admin.' ~ item.route, 'admin.super']) %}
  38. <li class="{{ (location == item.route) ? 'selected' : '' }}">
  39. <a href="{{ base_url_relative }}/{{ item.route }}">
  40. <i class="fa fa-fw {{ item.icon }}"></i> {{ label|tu }}
  41. </a>
  42. </li>
  43. {% endif %}
  44. {% endfor %}
  45. {% endif %}
  46. {% if authorize(['admin.plugins', 'admin.super']) %}
  47. <li class="{{ (location == 'plugins') ? 'selected' : '' }}">
  48. <a href="{{ base_url_relative }}/plugins">
  49. <i class="fa fa-fw fa-plug"></i> {{ "PLUGIN_ADMIN.PLUGINS"|tu }}
  50. <span class="badges">
  51. <span class="badge updates"></span>
  52. <span class="badge count">{{ admin.plugins|length }}</span>
  53. </span>
  54. </a>
  55. </li>
  56. {% endif %}
  57. {% if authorize(['admin.themes', 'admin.super']) %}
  58. <li class="{{ (location == 'themes') ? 'selected' : '' }}">
  59. <a href="{{ base_url_relative }}/themes">
  60. <i class="fa fa-fw fa-tint"></i> {{ "PLUGIN_ADMIN.THEMES"|tu }}
  61. <span class="badges">
  62. <span class="badge updates"></span>
  63. <span class="badge count">{{ admin.themes|length }}</span>
  64. </span>
  65. </a>
  66. </li>
  67. {% endif %}
  68. {% include 'nav-pro.html.twig' ignore missing %}
  69. <!-- <li class="{{ (location == 'logs') ? 'selected' : '' }}">
  70. <a href="{{ base_url_relative }}/logs">
  71. <i class="fa fa-fw fa-warning"></i> Error Logs
  72. <span class="badges">
  73. <span class="badge count">{{ admin.logs|length }}</span>
  74. </span>
  75. </a>
  76. </li> -->
  77. <li>
  78. <a href="{{ base_url_relative }}/task{{ config.system.param_sep }}logout"><i class="fa fa-fw fa-sign-out"></i> {{ "PLUGIN_ADMIN.LOGOUT"|tu }}</a>
  79. </li>
  80. </ul>
  81. </nav>