Reorder admin menu links

This commit is contained in:
decabeza
2019-02-21 17:32:30 +01:00
parent 9bad103166
commit 0b61fd7827

View File

@@ -1,5 +1,14 @@
<div class="admin-sidebar" data-equalizer-watch>
<ul id="admin_menu" data-accordion-menu data-multi-open="false">
<% if feature?(:proposals) %>
<li class="section-title">
<%= link_to admin_proposals_path do %>
<span class="icon-proposals"></span>
<strong><%= t("admin.menu.proposals") %></strong>
<% end %>
</li>
<% end %>
<% if feature?(:polls) %>
<li class="section-title">
<a href="#">
@@ -19,33 +28,6 @@
</li>
<% end %>
<li class="section-title">
<a href="#">
<span class="icon-box"></span>
<strong><%= t("admin.menu.title_booths") %></strong>
</a>
<ul id="booths_menu" <%= "class=is-active" if menu_booths? || controller_name == "polls" && action_name == "booth_assignments" %>>
<li <%= "class=is-active" if %w(officers officer_assignments).include?(controller_name) %>>
<%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
</li>
<li <%= "class=is-active" if controller_name == "booths" &&
action_name != "available" %>>
<%= link_to t("admin.menu.poll_booths"), admin_booths_path %>
</li>
<li <%= "class=is-active" if (controller_name == "polls" && action_name == "booth_assignments") ||
controller_name == "booth_assignments" %>>
<%= link_to t("admin.menu.poll_booth_assignments"), booth_assignments_admin_polls_path %>
</li>
<li <%= "class=is-active" if %w(shifts booths).include?(controller_name) &&
%w(available new).include?(action_name) %>>
<%= link_to t("admin.menu.poll_shifts"), available_admin_booths_path %>
</li>
</ul>
</li>
<% if feature?(:legislation) %>
<li class="section-title <%= "is-active" if controller.class.parent == Admin::Legislation %>">
<%= link_to admin_legislation_processes_path do %>
@@ -64,6 +46,35 @@
</li>
<% end %>
<li class="section-title">
<a href="#">
<span class="icon-box"></span>
<strong><%= t("admin.menu.title_booths") %></strong>
</a>
<ul id="booths_menu" <%= "class=is-active" if menu_booths? || controller_name == "polls" && action_name == "booth_assignments" %>>
<li <%= "class=is-active" if %w(officers officer_assignments).include?(controller_name) %>>
<%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
</li>
<li <%= "class=is-active" if controller_name == "booths" &&
action_name != "available" %>>
<%= link_to t("admin.menu.poll_booths"), admin_booths_path %>
</li>
<li <%= "class=is-active" if (controller_name == "polls" &&
action_name == "booth_assignments") ||
controller_name == "booth_assignments" &&
action_name == "manage" %>>
<%= link_to t("admin.menu.poll_booth_assignments"), booth_assignments_admin_polls_path %>
</li>
<li <%= "class=is-active" if %w(shifts booths).include?(controller_name) &&
%w(available new).include?(action_name) %>>
<%= link_to t("admin.menu.poll_shifts"), available_admin_booths_path %>
</li>
</ul>
</li>
<% if feature?(:spending_proposals) %>
<li class="section-title">
<a href="#">
@@ -78,15 +89,6 @@
</li>
<% end %>
<% if feature?(:proposals) %>
<li class="section-title">
<%= link_to admin_proposals_path do %>
<span class="icon-proposals"></span>
<strong><%= t("admin.menu.proposals") %></strong>
<% end %>
</li>
<% end %>
<% messages_sections = %w(newsletters emails_download admin_notifications system_emails) %>
<% messages_menu_active = messages_sections.include?(controller_name) %>
<li class="section-title" <%= "class=is-active" if messages_menu_active %>>