1
0

sidebar.twig 2.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <aside class="hidden w-56 border-r border-slate-200 bg-white px-3 py-6 text-sm dark:border-slate-800 dark:bg-slate-950 md:block">
  2. <nav class="flex flex-col gap-1">
  3. {% set links = [
  4. { href: '/app/dashboard', label: 'Dashboard', section: 'dashboard' },
  5. { href: '/app/ips', label: 'IPs', section: 'ips' },
  6. { href: '/app/subnets', label: 'Subnets', section: 'subnets' },
  7. { href: '/app/manual-blocks', label: 'Manual blocks', section: 'manual-blocks' },
  8. { href: '/app/allowlist', label: 'Allowlist', section: 'allowlist' },
  9. { href: '/app/policies', label: 'Policies', section: 'policies' },
  10. { href: '/app/reporters', label: 'Reporters', section: 'reporters' },
  11. { href: '/app/consumers', label: 'Consumers', section: 'consumers' },
  12. { href: '/app/tokens', label: 'Tokens', section: 'tokens' },
  13. { href: '/app/categories', label: 'Categories', section: 'categories' },
  14. { href: '#', label: 'Audit', upcoming: 'M12' },
  15. { href: '#', label: 'Settings', upcoming: 'M12' },
  16. { href: '/app/me', label: 'My identity', section: 'me' },
  17. ] %}
  18. {% for link in links %}
  19. {% if link.upcoming is defined %}
  20. <span class="flex items-center justify-between rounded-md px-3 py-1.5 text-slate-400 dark:text-slate-600">
  21. <span>{{ link.label }}</span>
  22. <span class="font-mono text-[0.6rem] uppercase tracking-wider">{{ link.upcoming }}</span>
  23. </span>
  24. {% else %}
  25. {% set is_active = (active_section is defined and active_section == link.section) %}
  26. <a href="{{ link.href }}"
  27. class="rounded-md px-3 py-1.5 {% if is_active %}bg-indigo-50 text-indigo-700 dark:bg-indigo-950 dark:text-indigo-300{% else %}text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-slate-800{% endif %}"
  28. {% if is_active %}aria-current="page"{% endif %}>
  29. {{ link.label }}
  30. </a>
  31. {% endif %}
  32. {% endfor %}
  33. </nav>
  34. </aside>