sidebar.twig 2.0 KB

123456789101112131415161718192021222324252627282930313233
  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: '#', label: 'Subnets', upcoming: 'M10' },
  7. { href: '#', label: 'Allowlist', upcoming: 'M10' },
  8. { href: '#', label: 'Policies', upcoming: 'M10' },
  9. { href: '#', label: 'Reporters', upcoming: 'M10' },
  10. { href: '#', label: 'Consumers', upcoming: 'M10' },
  11. { href: '#', label: 'Tokens', upcoming: 'M10' },
  12. { href: '#', label: 'Categories', upcoming: 'M10' },
  13. { href: '#', label: 'Audit', upcoming: 'M12' },
  14. { href: '#', label: 'Settings', upcoming: 'M12' },
  15. { href: '/app/me', label: 'My identity', section: 'me' },
  16. ] %}
  17. {% for link in links %}
  18. {% if link.upcoming is defined %}
  19. <span class="flex items-center justify-between rounded-md px-3 py-1.5 text-slate-400 dark:text-slate-600">
  20. <span>{{ link.label }}</span>
  21. <span class="font-mono text-[0.6rem] uppercase tracking-wider">{{ link.upcoming }}</span>
  22. </span>
  23. {% else %}
  24. {% set is_active = (active_section is defined and active_section == link.section) %}
  25. <a href="{{ link.href }}"
  26. 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 %}"
  27. {% if is_active %}aria-current="page"{% endif %}>
  28. {{ link.label }}
  29. </a>
  30. {% endif %}
  31. {% endfor %}
  32. </nav>
  33. </aside>