Merge pull request #4274 from consul/admin_menu
Simplify code in the admin menu
This commit is contained in:
@@ -408,101 +408,7 @@ code {
|
||||
// 02. Sidebar
|
||||
// -----------
|
||||
|
||||
.admin-sidebar {
|
||||
background: $sidebar;
|
||||
background: linear-gradient(to bottom, #245b80 0%, #488fb5 100%);
|
||||
border-right: 1px solid $border;
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
margin-bottom: 0;
|
||||
margin-left: 0;
|
||||
padding: 0;
|
||||
|
||||
[class^="icon-"] {
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
font-size: rem-calc(20);
|
||||
line-height: $line-height;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
width: $line-height * 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
|
||||
ul {
|
||||
margin-left: $line-height / 1.5;
|
||||
border-left: 1px solid $sidebar-hover;
|
||||
padding-left: $line-height / 2;
|
||||
}
|
||||
|
||||
&.is-active a {
|
||||
background: $sidebar-hover;
|
||||
border-left: 2px solid $sidebar-active;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&[aria-expanded="true"] {
|
||||
|
||||
> a::after {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
li a {
|
||||
color: #fff;
|
||||
display: block;
|
||||
line-height: $line-height * 2;
|
||||
padding-left: $line-height / 4;
|
||||
vertical-align: top;
|
||||
|
||||
&:hover {
|
||||
background: $sidebar-hover;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.is-accordion-submenu-parent {
|
||||
|
||||
> a::after {
|
||||
border: 0;
|
||||
content: "\f078";
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: bold;
|
||||
height: auto;
|
||||
position: absolute;
|
||||
right: 24px;
|
||||
transition: 0.25s;
|
||||
}
|
||||
}
|
||||
|
||||
.submenu {
|
||||
border-bottom: 0;
|
||||
margin-left: $line-height;
|
||||
|
||||
li:first-child {
|
||||
padding-top: $line-height / 2;
|
||||
}
|
||||
|
||||
li:last-child {
|
||||
padding-bottom: $line-height / 2;
|
||||
}
|
||||
|
||||
a {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.is-active {
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// See admin/menu.scss
|
||||
|
||||
// 03. List elements
|
||||
// -----------------
|
||||
|
||||
184
app/assets/stylesheets/admin/menu.scss
Normal file
184
app/assets/stylesheets/admin/menu.scss
Normal file
@@ -0,0 +1,184 @@
|
||||
.admin-sidebar {
|
||||
background: $sidebar;
|
||||
background: linear-gradient(to bottom, #245b80 0%, #488fb5 100%);
|
||||
border-right: 1px solid $border;
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
margin-bottom: 0;
|
||||
margin-left: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
> ul > li a {
|
||||
font-weight: bold;
|
||||
|
||||
@mixin icon($name, $style) {
|
||||
@include has-fa-icon($name, $style);
|
||||
|
||||
&::before {
|
||||
font-size: rem-calc(20);
|
||||
margin-left: rem-calc(8);
|
||||
margin-right: rem-calc(10);
|
||||
}
|
||||
}
|
||||
|
||||
[class^="icon-"] {
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
font-size: rem-calc(20);
|
||||
line-height: $line-height;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
width: $line-height * 1.5;
|
||||
}
|
||||
|
||||
&.booths-link {
|
||||
@include icon(archive, solid);
|
||||
}
|
||||
|
||||
&.budgets-link,
|
||||
&.investments-link {
|
||||
@include icon(chart-pie, solid);
|
||||
}
|
||||
|
||||
&.comments-link {
|
||||
@include icon(comments, regular);
|
||||
}
|
||||
|
||||
&.dashboard-link {
|
||||
@include icon(check, solid);
|
||||
}
|
||||
|
||||
&.debates-link {
|
||||
@include icon(comment-alt, solid);
|
||||
}
|
||||
|
||||
&.invitations-link {
|
||||
@include icon(envelope, regular);
|
||||
}
|
||||
|
||||
&.legislation-link {
|
||||
@include icon(file-alt, solid);
|
||||
}
|
||||
|
||||
&.messages-link {
|
||||
@include icon(file-archive, regular);
|
||||
}
|
||||
|
||||
&.moderated-content-link {
|
||||
@include icon(eye, regular);
|
||||
}
|
||||
|
||||
&.polls-link {
|
||||
@include icon(check-circle, regular);
|
||||
}
|
||||
|
||||
&.print-proposals-link,
|
||||
&.print-investments-link {
|
||||
@include icon(print, solid);
|
||||
}
|
||||
|
||||
&.profiles-link {
|
||||
@include icon(users, solid);
|
||||
}
|
||||
|
||||
&.proposals-link,
|
||||
&.proposal-notifications-link {
|
||||
@include icon(lightbulb, solid);
|
||||
}
|
||||
|
||||
&.settings-link {
|
||||
@include icon(cog, solid);
|
||||
}
|
||||
|
||||
&.signature-sheets-link {
|
||||
@include icon(file-alt, regular);
|
||||
}
|
||||
|
||||
&.site-customization-link {
|
||||
@include icon(pencil-alt, solid);
|
||||
}
|
||||
|
||||
&.stats-link {
|
||||
@include icon(chart-line, solid);
|
||||
}
|
||||
|
||||
&.users-link {
|
||||
@include icon(user, solid);
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
|
||||
ul {
|
||||
margin-left: $line-height / 1.5;
|
||||
border-left: 1px solid $sidebar-hover;
|
||||
padding-left: $line-height / 2;
|
||||
}
|
||||
|
||||
&.is-active a {
|
||||
background: $sidebar-hover;
|
||||
border-left: 2px solid $sidebar-active;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&[aria-expanded="true"] {
|
||||
|
||||
> a::after {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
li a {
|
||||
color: #fff;
|
||||
display: block;
|
||||
line-height: $line-height * 2;
|
||||
padding-left: $line-height / 4;
|
||||
vertical-align: top;
|
||||
|
||||
&:hover {
|
||||
background: $sidebar-hover;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.is-accordion-submenu-parent {
|
||||
|
||||
> a::after {
|
||||
border: 0;
|
||||
content: "\f078";
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: bold;
|
||||
height: auto;
|
||||
position: absolute;
|
||||
right: 24px;
|
||||
transition: 0.25s;
|
||||
}
|
||||
}
|
||||
|
||||
.submenu {
|
||||
border-bottom: 0;
|
||||
margin-left: $line-height;
|
||||
|
||||
li:first-child {
|
||||
padding-top: $line-height / 2;
|
||||
}
|
||||
|
||||
li:last-child {
|
||||
padding-bottom: $line-height / 2;
|
||||
}
|
||||
|
||||
a {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.is-active {
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,62 +1,41 @@
|
||||
<ul id="admin_menu" data-accordion-menu data-multi-open="true">
|
||||
<% 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>
|
||||
<%= link_to t("admin.menu.proposals"), admin_proposals_path, class: "proposals-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:debates) %>
|
||||
<li class="section-title <%= "is-active" if controller_name == "debates" %>">
|
||||
<%= link_to admin_debates_path do %>
|
||||
<span class="icon-debates"></span>
|
||||
<strong><%= t("admin.menu.debates") %></strong>
|
||||
<% end %>
|
||||
<li class="<%= "is-active" if controller_name == "debates" %>">
|
||||
<%= link_to t("admin.menu.debates"), admin_debates_path, class: "debates-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li class="section-title <%= "is-active" if controller_name == "comments" %>">
|
||||
<%= link_to admin_comments_path do %>
|
||||
<span class="icon-comments"></span>
|
||||
<strong><%= t("admin.menu.comments") %></strong>
|
||||
<% end %>
|
||||
<li class="<%= "is-active" if controller_name == "comments" %>">
|
||||
<%= link_to t("admin.menu.comments"), admin_comments_path, class: "comments-link" %>
|
||||
</li>
|
||||
|
||||
<% if feature?(:polls) %>
|
||||
<li class="section-title <%= "is-active" if menu_polls? %>">
|
||||
<%= link_to admin_polls_path do %>
|
||||
<span class="icon-checkmark-circle"></span>
|
||||
<strong><%= t("admin.menu.polls") %></strong>
|
||||
<% end %>
|
||||
<li class="<%= "is-active" if polls? %>">
|
||||
<%= link_to t("admin.menu.polls"), admin_polls_path, class: "polls-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:legislation) %>
|
||||
<li class="section-title <%= "is-active" if controller.class.parent == Admin::Legislation %>">
|
||||
<%= link_to admin_legislation_processes_path do %>
|
||||
<span class="icon-file-text"></span>
|
||||
<strong><%= t("admin.menu.legislation") %></strong>
|
||||
<% end %>
|
||||
<li class="<%= "is-active" if controller.class.parent == Admin::Legislation %>">
|
||||
<%= link_to t("admin.menu.legislation"), admin_legislation_processes_path, class: "legislation-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:budgets) %>
|
||||
<li class="section-title <%= "is-active" if menu_budgets? %>">
|
||||
<%= link_to admin_budgets_path do %>
|
||||
<span class="icon-budget"></span>
|
||||
<strong><%= t("admin.menu.budgets") %></strong>
|
||||
<% end %>
|
||||
<li class="<%= "is-active" if budgets? %>">
|
||||
<%= link_to t("admin.menu.budgets"), admin_budgets_path, class: "budgets-link" %>
|
||||
</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? %>>
|
||||
<li>
|
||||
<a href="#" class="booths-link"><%= t("admin.menu.title_booths") %></a>
|
||||
<ul id="booths_menu" <%= "class=is-active" if booths? %>>
|
||||
<li <%= "class=is-active" if %w[officers officer_assignments].include?(controller_name) %>>
|
||||
<%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
|
||||
</li>
|
||||
@@ -81,22 +60,14 @@
|
||||
</li>
|
||||
|
||||
<% if feature?(:signature_sheets) %>
|
||||
<li class="section-title <%= "is-active" if controller_name == "signature_sheets" %>">
|
||||
<%= link_to admin_signature_sheets_path do %>
|
||||
<span class="icon-file-text-o"></span>
|
||||
<strong><%= t("admin.menu.signature_sheets") %></strong>
|
||||
<% end %>
|
||||
<li class="<%= "is-active" if controller_name == "signature_sheets" %>">
|
||||
<%= link_to t("admin.menu.signature_sheets"), admin_signature_sheets_path, class: "signature-sheets-link" %>
|
||||
</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 %>>
|
||||
<a href="#">
|
||||
<span class="icon-zip"></span>
|
||||
<strong><%= t("admin.menu.messaging_users") %></strong>
|
||||
</a>
|
||||
<ul id="messaging_users_menu" <%= "class=is-active" if messages_menu_active %>>
|
||||
<li>
|
||||
<a href="#" class="messages-link"><%= t("admin.menu.messaging_users") %></a>
|
||||
<ul id="messaging_users_menu" <%= "class=is-active" if messages_menu_active? %>>
|
||||
<li <%= "class=is-active" if controller_name == "newsletters" %>>
|
||||
<%= link_to t("admin.menu.newsletters"), admin_newsletters_path %>
|
||||
</li>
|
||||
@@ -112,19 +83,16 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="section-title">
|
||||
<a href="#">
|
||||
<span class="icon-edit"></span>
|
||||
<strong><%= t("admin.menu.title_site_customization") %></strong>
|
||||
</a>
|
||||
<ul <%= "class=is-active" if menu_customization? &&
|
||||
<li>
|
||||
<a href="#" class="site-customization-link"><%= t("admin.menu.title_site_customization") %></a>
|
||||
<ul <%= "class=is-active" if customization? &&
|
||||
controller.class.parent != Admin::Poll::Questions::Answers %>>
|
||||
|
||||
<li <%= "class=is-active" if menu_homepage? %>>
|
||||
<li <%= "class=is-active" if homepage? %>>
|
||||
<%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=is-active" if menu_pages? || controller_name == "pages" %>>
|
||||
<li <%= "class=is-active" if pages? || controller_name == "pages" %>>
|
||||
<%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %>
|
||||
</li>
|
||||
|
||||
@@ -143,12 +111,9 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="section-title">
|
||||
<a href="#">
|
||||
<span class="icon-eye"></span>
|
||||
<strong><%= t("admin.menu.title_moderated_content") %></strong>
|
||||
</a>
|
||||
<ul <%= "class=is-active" if menu_moderated_content? %>>
|
||||
<li>
|
||||
<a href="#" class="moderated-content-link"><%= t("admin.menu.title_moderated_content") %></a>
|
||||
<ul <%= "class=is-active" if moderated_content? %>>
|
||||
<% if feature?(:proposals) %>
|
||||
<li <%= "class=is-active" if controller_name == "hidden_proposals" %>>
|
||||
<%= link_to t("admin.menu.hidden_proposals"), admin_hidden_proposals_path %>
|
||||
@@ -185,12 +150,9 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="section-title">
|
||||
<a href="#">
|
||||
<span class="icon-organizations"></span>
|
||||
<strong><%= t("admin.menu.title_profiles") %></strong>
|
||||
</a>
|
||||
<ul <%= "class=is-active" if menu_profiles? %>>
|
||||
<li>
|
||||
<a href="#" class="profiles-link"><%= t("admin.menu.title_profiles") %></a>
|
||||
<ul <%= "class=is-active" if profiles? %>>
|
||||
<li <%= "class=is-active" if controller_name == "administrators" %>>
|
||||
<%= link_to t("admin.menu.administrators"), admin_administrators_path %>
|
||||
</li>
|
||||
@@ -221,18 +183,13 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="section-title" <%= "class=is-active" if controller_name == "stats" %>>
|
||||
<%= link_to admin_stats_path do %>
|
||||
<span class="icon-stats"></span><%= t("admin.menu.stats") %>
|
||||
<% end %>
|
||||
<li class="<%= "is-active" if controller_name == "stats" %>">
|
||||
<%= link_to t("admin.menu.stats"), admin_stats_path, class: "stats-link" %>
|
||||
</li>
|
||||
|
||||
<li class="section-title">
|
||||
<a href="#">
|
||||
<span class="icon-settings"></span>
|
||||
<strong><%= t("admin.menu.title_settings") %></strong>
|
||||
</a>
|
||||
<ul <%= "class=is-active" if menu_settings? %>>
|
||||
<li>
|
||||
<a href="#" class="settings-link"><%= t("admin.menu.title_settings") %></a>
|
||||
<ul <%= "class=is-active" if settings? %>>
|
||||
<li <%= "class=is-active" if controller_name == "settings" %>>
|
||||
<%= link_to t("admin.menu.settings"), admin_settings_path %>
|
||||
</li>
|
||||
@@ -254,17 +211,14 @@
|
||||
<%= link_to t("admin.menu.site_customization.content_blocks"), admin_site_customization_content_blocks_path %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=is-active" if submenu_local_census_records? %>>
|
||||
<li <%= "class=is-active" if local_census_records? %>>
|
||||
<%= link_to t("admin.menu.local_census_records"), admin_local_census_records_path %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="section-title">
|
||||
<a href="#">
|
||||
<span class="icon-check"></span>
|
||||
<strong><%= t("admin.menu.dashboard") %></strong>
|
||||
</a>
|
||||
<ul <%= "class=is-active" if menu_dashboard? %>>
|
||||
<li>
|
||||
<a href="#" class="dashboard-link"><%= t("admin.menu.dashboard") %></a>
|
||||
<ul <%= "class=is-active" if dashboard? %>>
|
||||
<li <%= "class=is-active" if controller_name == "actions" %>>
|
||||
<%= link_to t("admin.menu.dashboard_actions"), admin_dashboard_actions_path %>
|
||||
</li>
|
||||
68
app/components/admin/menu_component.rb
Normal file
68
app/components/admin/menu_component.rb
Normal file
@@ -0,0 +1,68 @@
|
||||
class Admin::MenuComponent < ApplicationComponent
|
||||
private
|
||||
|
||||
def moderated_content?
|
||||
moderated_sections.include?(controller_name) && controller.class.parent != Admin::Legislation
|
||||
end
|
||||
|
||||
def moderated_sections
|
||||
["hidden_proposals", "hidden_debates", "hidden_comments", "hidden_users", "activity",
|
||||
"hidden_budget_investments", "hidden_proposal_notifications"]
|
||||
end
|
||||
|
||||
def budgets?
|
||||
controller_name.starts_with?("budget")
|
||||
end
|
||||
|
||||
def polls?
|
||||
controller.class.parent == Admin::Poll::Questions::Answers ||
|
||||
%w[polls active_polls recounts results questions answers].include?(controller_name) &&
|
||||
action_name != "booth_assignments"
|
||||
end
|
||||
|
||||
def booths?
|
||||
%w[officers booths shifts booth_assignments officer_assignments].include?(controller_name) ||
|
||||
controller_name == "polls" && action_name == "booth_assignments"
|
||||
end
|
||||
|
||||
def profiles?
|
||||
%w[administrators organizations officials moderators valuators managers users].include?(controller_name)
|
||||
end
|
||||
|
||||
def settings?
|
||||
controllers_names = ["settings", "tags", "geozones", "images", "content_blocks",
|
||||
"local_census_records", "imports"]
|
||||
controllers_names.include?(controller_name) &&
|
||||
controller.class.parent != Admin::Poll::Questions::Answers
|
||||
end
|
||||
|
||||
def customization?
|
||||
["pages", "banners", "information_texts", "documents"].include?(controller_name) ||
|
||||
homepage? || pages?
|
||||
end
|
||||
|
||||
def homepage?
|
||||
["homepage", "cards"].include?(controller_name) && params[:page_id].nil?
|
||||
end
|
||||
|
||||
def pages?
|
||||
["pages", "cards"].include?(controller_name) && params[:page_id].present?
|
||||
end
|
||||
|
||||
def dashboard?
|
||||
["actions", "administrator_tasks"].include?(controller_name)
|
||||
end
|
||||
|
||||
def local_census_records?
|
||||
controller_name == "local_census_records" ||
|
||||
(controller_name == "imports" && controller.class.parent == Admin::LocalCensusRecords)
|
||||
end
|
||||
|
||||
def messages_menu_active?
|
||||
messages_sections.include?(controller_name)
|
||||
end
|
||||
|
||||
def messages_sections
|
||||
%w[newsletters emails_download admin_notifications system_emails]
|
||||
end
|
||||
end
|
||||
@@ -1,2 +1,3 @@
|
||||
class ApplicationComponent < ViewComponent::Base
|
||||
include SettingsHelper
|
||||
end
|
||||
|
||||
@@ -11,63 +11,6 @@ module AdminHelper
|
||||
end
|
||||
end
|
||||
|
||||
def menu_moderated_content?
|
||||
moderated_sections.include?(controller_name) && controller.class.parent != Admin::Legislation
|
||||
end
|
||||
|
||||
def moderated_sections
|
||||
["hidden_proposals", "hidden_debates", "hidden_comments", "hidden_users", "activity",
|
||||
"hidden_budget_investments", "hidden_proposal_notifications"]
|
||||
end
|
||||
|
||||
def menu_budgets?
|
||||
controller_name.starts_with?("budget")
|
||||
end
|
||||
|
||||
def menu_polls?
|
||||
controller.class.parent == Admin::Poll::Questions::Answers ||
|
||||
%w[polls active_polls recounts results questions answers].include?(controller_name) &&
|
||||
action_name != "booth_assignments"
|
||||
end
|
||||
|
||||
def menu_booths?
|
||||
%w[officers booths shifts booth_assignments officer_assignments].include?(controller_name) ||
|
||||
controller_name == "polls" && action_name == "booth_assignments"
|
||||
end
|
||||
|
||||
def menu_profiles?
|
||||
%w[administrators organizations officials moderators valuators managers users].include?(controller_name)
|
||||
end
|
||||
|
||||
def menu_settings?
|
||||
controllers_names = ["settings", "tags", "geozones", "images", "content_blocks",
|
||||
"local_census_records", "imports"]
|
||||
controllers_names.include?(controller_name) &&
|
||||
controller.class.parent != Admin::Poll::Questions::Answers
|
||||
end
|
||||
|
||||
def menu_customization?
|
||||
["pages", "banners", "information_texts", "documents"].include?(controller_name) ||
|
||||
menu_homepage? || menu_pages?
|
||||
end
|
||||
|
||||
def menu_homepage?
|
||||
["homepage", "cards"].include?(controller_name) && params[:page_id].nil?
|
||||
end
|
||||
|
||||
def menu_pages?
|
||||
["pages", "cards"].include?(controller_name) && params[:page_id].present?
|
||||
end
|
||||
|
||||
def menu_dashboard?
|
||||
["actions", "administrator_tasks"].include?(controller_name)
|
||||
end
|
||||
|
||||
def submenu_local_census_records?
|
||||
controller_name == "local_census_records" ||
|
||||
(controller_name == "imports" && controller.class.parent == Admin::LocalCensusRecords)
|
||||
end
|
||||
|
||||
def official_level_options
|
||||
options = [["", 0]]
|
||||
(1..5).each do |i|
|
||||
|
||||
@@ -13,7 +13,11 @@
|
||||
<%= check_box_tag :show_menu, nil, false, role: "switch" %>
|
||||
|
||||
<nav id="side_menu" class="admin-sidebar">
|
||||
<%= render "/#{namespace}/menu" %>
|
||||
<% if namespace == "admin" %>
|
||||
<%= render Admin::MenuComponent.new %>
|
||||
<% else %>
|
||||
<%= render "/#{namespace}/menu" %>
|
||||
<% end %>
|
||||
</nav>
|
||||
|
||||
<div class="admin-content">
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<ul id="admin_menu" data-accordion-menu>
|
||||
<li class="section-title">
|
||||
<a href="#">
|
||||
<span class="icon-user"></span>
|
||||
<strong><%= t("management.menu.users") %></strong>
|
||||
</a>
|
||||
<a href="#" class="users-link"><%= t("management.menu.users") %></a>
|
||||
<ul class="is-active">
|
||||
|
||||
<li <%= "class=is-active" if menu_users? %>>
|
||||
@@ -43,24 +40,15 @@
|
||||
|
||||
<% if Setting["process.budgets"] %>
|
||||
<li <%= "class=is-active" if menu_print_investments? %>>
|
||||
<%= link_to print_investments_management_budgets_path do %>
|
||||
<span class="icon-print"></span>
|
||||
<%= t("management.menu.print_budget_investments") %>
|
||||
<% end %>
|
||||
<%= link_to t("management.menu.print_budget_investments"), print_investments_management_budgets_path, class: "print-investments-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li <%= "class=is-active" if menu_print_proposals? %>>
|
||||
<%= link_to print_management_proposals_path do %>
|
||||
<span class="icon-print"></span>
|
||||
<%= t("management.menu.print_proposals") %>
|
||||
<% end %>
|
||||
<%= link_to t("management.menu.print_proposals"), print_management_proposals_path, class: "print-proposals-link" %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=is-active" if menu_user_invites? %>>
|
||||
<%= link_to new_management_user_invite_path do %>
|
||||
<span class="icon-letter"></span>
|
||||
<%= t("management.menu.user_invites") %>
|
||||
<% end %>
|
||||
<%= link_to t("management.menu.user_invites"), new_management_user_invite_path, class: "invitations-link" %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -5,49 +5,31 @@
|
||||
|
||||
<% if feature?(:proposals) %>
|
||||
<li <%= "class=is-active" if controller_name == "proposals" %>>
|
||||
<%= link_to moderation_proposals_path do %>
|
||||
<span class="icon-proposals"></span>
|
||||
<%= t("moderation.menu.proposals") %>
|
||||
<% end %>
|
||||
<%= link_to t("moderation.menu.proposals"), moderation_proposals_path, class: "proposals-link" %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=is-active" if controller_name == "proposal_notifications" %>>
|
||||
<%= link_to moderation_proposal_notifications_path do %>
|
||||
<span class="icon-proposals"></span>
|
||||
<%= t("moderation.menu.proposal_notifications") %>
|
||||
<% end %>
|
||||
<%= link_to t("moderation.menu.proposal_notifications"), moderation_proposal_notifications_path, class: "proposal-notifications-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:debates) %>
|
||||
<li <%= "class=is-active" if controller_name == "debates" %>>
|
||||
<%= link_to moderation_debates_path do %>
|
||||
<span class="icon-debates"></span>
|
||||
<%= t("moderation.menu.flagged_debates") %>
|
||||
<% end %>
|
||||
<%= link_to t("moderation.menu.flagged_debates"), moderation_debates_path, class: "debates-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:budgets) %>
|
||||
<li <%= "class=is-active" if controller_name == "investments" %>>
|
||||
<%= link_to moderation_budget_investments_path do %>
|
||||
<span class="icon-budget"></span>
|
||||
<%= t("moderation.menu.flagged_investments") %>
|
||||
<% end %>
|
||||
<%= link_to t("moderation.menu.flagged_investments"), moderation_budget_investments_path, class: "investments-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li <%= "class=is-active" if controller_name == "comments" %>>
|
||||
<%= link_to moderation_comments_path do %>
|
||||
<span class="icon-comments"></span>
|
||||
<%= t("moderation.menu.flagged_comments") %>
|
||||
<% end %>
|
||||
<%= link_to t("moderation.menu.flagged_comments"), moderation_comments_path, class: "comments-link" %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=is-active" if controller_name == "users" %>>
|
||||
<%= link_to moderation_users_path do %>
|
||||
<span class="icon-user"></span>
|
||||
<%= t("moderation.menu.users") %>
|
||||
<% end %>
|
||||
<%= link_to t("moderation.menu.users"), moderation_users_path, class: "users-link" %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -4,19 +4,13 @@
|
||||
<li class="<%= "js-vote-collection" %>
|
||||
<%= " is-active" if controller_name == "voters" %>
|
||||
<%= " is-hidden" if controller_name == "voters" && Poll.votable_by(@user).any? %>">
|
||||
<%= link_to new_officing_residence_path do %>
|
||||
<span class="icon-user"></span>
|
||||
<%= t("officing.menu.voters") %>
|
||||
<% end %>
|
||||
<%= link_to t("officing.menu.voters"), new_officing_residence_path, class: "users-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if final_recount_shift? %>
|
||||
<li <%= "class=is-active" if ["results", "ballot_sheets"].include?(controller_name) || (controller_name == "polls" && action_name == "final") %>>
|
||||
<%= link_to final_officing_polls_path do %>
|
||||
<span class="icon-user"></span>
|
||||
<%= t("officing.menu.total_recounts") %>
|
||||
<% end %>
|
||||
<%= link_to t("officing.menu.total_recounts"), final_officing_polls_path, class: "users-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
@@ -6,12 +6,8 @@
|
||||
|
||||
<% if feature?(:budgets) %>
|
||||
<li <%= "class=is-active" if controller_name == "budget_investments" %>>
|
||||
<%= link_to valuation_budgets_path do %>
|
||||
<span class="icon-budget"></span>
|
||||
<%= t("valuation.menu.budgets") %>
|
||||
<% end %>
|
||||
<%= link_to t("valuation.menu.budgets"), valuation_budgets_path, class: "budgets-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user