a11yist/app/views/layouts/_sidebar.html.erb

32 lines
1.5 KiB
Text
Raw Normal View History

<div class="col col-auto px-0 d-none d-md-block">
2024-09-22 21:57:05 +02:00
<div id="sidebar" class="collapse collapse-horizontal show border-0">
2024-09-23 00:14:33 +02:00
<div id="sidebar-nav" class="list-group border-0 rounded-0 text-sm-start" style="min-height: 90vh">
2024-09-22 21:57:05 +02:00
<% if @sidebar_items %>
<% @sidebar_items.each do |sidebar_item| %>
<% if sidebar_item[:method].present? && sidebar_item[:method] != :get %>
<%= button_to(sidebar_item[:path], method: sidebar_item[:method], class: "list-group-item border-end-0 d-inline-block text-truncate") do %>
<% if sidebar_item[:icon] %>
<span aria-hidden="true" class="bi-<%= sidebar_item[:icon] %>"></span>
<% end %>
<%= sidebar_item[:label] %>
<% end %>
<% else %>
<a class="list-group-item border-0 d-inline-block text-truncate <%= (sidebar_item[:active] || @nav_path.to_s == sidebar_item[:path].to_s) && "active" %>" <%= @nav_path.to_s == sidebar_item[:path].to_s && "aria-current=\"page\"" %> href="<%= url_for(sidebar_item[:path]) %>">
<% if sidebar_item[:icon] %>
<span aria-hidden="true" class="bi-<%= sidebar_item[:icon] %>"></span>
<% end %>
<%= sidebar_item[:label] %>
</a>
<% end %>
<% end %>
2024-10-29 01:42:07 +01:00
<!--div class="mt-auto ms-auto me-2">
<%= link_to("hide") do %>
<span class="bi-chevron-left"></span>
<% end %>
2024-10-29 01:42:07 +01:00
</div-->
2024-09-22 21:57:05 +02:00
<% else %>
<div class="me-auto"></div>
<% end %>
</div>
</div>
</div>