Merge pull request #3329 from consul/admin-ui

[Backport] Improve UX on admin section
This commit is contained in:
Alberto
2019-02-26 19:13:01 +01:00
committed by GitHub
13 changed files with 60 additions and 58 deletions

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 %>>

View File

@@ -23,7 +23,7 @@
<% @budgets.each do |budget| %>
<tr id="<%= dom_id(budget) %>" class="budget">
<td>
<%= link_to budget.name, admin_budget_path(budget) %>
<%= budget.name %>
</td>
<td class="small">
<%= t("budgets.phase.#{budget.phase}") %>

View File

@@ -11,7 +11,7 @@
<% @polls.each do |poll| %>
<tr id="<%= dom_id(poll) %>" class="poll">
<td>
<strong><%= link_to poll.name, admin_poll_path(poll) %></strong>
<%= link_to poll.name, manage_admin_poll_booth_assignments_path(poll) %>
</td>
<td>
<%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %>