nav-quick-tray.html.twig 1.0 KB

1234567891011121314151617181920212223
  1. {% if grav.twig.plugins_quick_tray %}
  2. <ul id="admin-nav-quick-tray">
  3. {% for label, item in grav.twig.plugins_quick_tray %}
  4. {% if authorize((item.authorize is defined and item.authorize is iterable) ? item.authorize : [item.authorize ?: ('admin.' ~ (item.location ?: item.route)), 'admin.super']) %}
  5. {% set data_tags = '' %}
  6. {% if (item.data) %}
  7. {% for key, value in item.data %}
  8. {% set data_tags = data_tags ~ ' data-' ~ key ~ '="' ~ value ~ '"' %}
  9. {% endfor %}
  10. {% endif %}
  11. <li class="{{ item.class }} hint--bottom" data-hint="{{ item.hint }}" {{ data_tags|raw }}>
  12. {% if item.route %}
  13. <a href="{{ url(item.route) }}">
  14. <i class="fa fa-fw {{ item.icon }}"></i>
  15. </a>
  16. {% else %}
  17. <i class="fa fa-fw {{ item.icon }}"></i>
  18. {% endif %}
  19. </li>
  20. {% endif %}
  21. {% endfor %}
  22. </ul>
  23. {% endif %}