Merge pull request #4005 from consul/off_canvas

Simplify code related to the admin menu
This commit is contained in:
Javi Martín
2020-09-21 15:51:05 +02:00
committed by GitHub
14 changed files with 509 additions and 595 deletions

View File

@@ -291,10 +291,6 @@ $sidebar-active: #f4fcd0;
margin-right: rem-calc(12); margin-right: rem-calc(12);
} }
.side-menu-and-admin-content {
@include side-menu-and-content;
}
.admin-content { .admin-content {
.proposal-form { .proposal-form {
padding-top: 0; padding-top: 0;
@@ -652,7 +648,7 @@ code {
border-radius: rem-calc(3); border-radius: rem-calc(3);
font-size: rem-calc(16); font-size: rem-calc(16);
font-weight: normal; font-weight: normal;
margin: $line-height; margin-bottom: $line-height;
padding: $line-height / 2; padding: $line-height / 2;
strong { strong {

View File

@@ -16,10 +16,6 @@
// 01. Dashboard global // 01. Dashboard global
// -------------------- // --------------------
.dashboard-menu-and-content {
@include side-menu-and-content;
}
.proposal-title { .proposal-title {
display: inline-block; display: inline-block;

View File

@@ -31,7 +31,6 @@
@include foundation-responsive-embed; @include foundation-responsive-embed;
@include foundation-label; @include foundation-label;
@include foundation-media-object; @include foundation-media-object;
@include foundation-off-canvas;
@include foundation-orbit; @include foundation-orbit;
@include foundation-pagination; @include foundation-pagination;
@include foundation-progress-bar; @include foundation-progress-bar;

View File

@@ -436,10 +436,6 @@ a {
display: table-cell; display: table-cell;
} }
.off-canvas-content {
box-shadow: none;
}
.uppercase { .uppercase {
text-transform: uppercase; text-transform: uppercase;
} }
@@ -449,6 +445,66 @@ a {
margin-top: 0; margin-top: 0;
} }
.menu-and-content {
$side-menu-min-width: 250px;
@include breakpoint(medium) {
display: flex;
> nav {
flex: 25%;
min-width: $side-menu-min-width;
+ * {
flex: 75%;
padding: $line-height !important;
}
}
[for="show_menu"] {
display: none;
}
}
@include breakpoint(small only) {
> nav {
height: 100%;
left: -$side-menu-min-width;
overflow-y: auto;
position: fixed;
top: 0;
transition: left 0.5s ease;
width: $side-menu-min-width;
z-index: 12;
+ * {
padding: $line-height !important;
}
}
[name="show_menu"]:checked + nav,
> nav:focus-within {
left: 0;
+ * {
overflow-x: hidden;
[for="show_menu"]::after {
@include reveal-overlay;
content: "";
cursor: pointer;
display: block;
z-index: 11;
}
}
}
}
[name="show_menu"] {
display: none;
}
}
// 02. Header // 02. Header
// ---------- // ----------

View File

@@ -1,9 +1,8 @@
// Table of Contents // Table of Contents
// //
// 01. Logo // 01. Logo
// 02. Side menu and content // 02. Orbit bullets
// 03. Orbit bullets // 03. Direct uploads
// 04. Direct uploads
// ------------------ // ------------------
// 01. Logo // 01. Logo
@@ -22,30 +21,8 @@
} }
} }
// 02. Side menu and content // 02. Orbit bullets
// ------------------------- // -----------------
@mixin side-menu-and-content {
display: flex;
> :first-child {
flex: 25%;
min-width: 250px;
> :first-child {
height: 100%;
}
}
> :last-child {
flex: 75%;
overflow-x: auto;
padding: $line-height !important;
}
}
// 03. Orbit bullet
// ----------------
@mixin orbit-bullets { @mixin orbit-bullets {
@include disable-mouse-outline; @include disable-mouse-outline;
@@ -72,7 +49,7 @@
} }
} }
// 04. Direct uploads // 03. Direct uploads
// ------------------ // ------------------
@mixin direct-uploads { @mixin direct-uploads {

View File

@@ -1,12 +1,4 @@
module AdminHelper module AdminHelper
def side_menu
if namespace == "moderation/budgets"
render "/moderation/menu"
else
render "/#{namespace}/menu"
end
end
def namespaced_root_path def namespaced_root_path
"/#{namespace}" "/#{namespace}"
end end

View File

@@ -1,281 +1,279 @@
<div class="admin-sidebar"> <ul id="admin_menu" data-accordion-menu data-multi-open="true">
<ul id="admin_menu" data-accordion-menu data-multi-open="true"> <% if feature?(:proposals) %>
<% if feature?(:proposals) %> <li class="section-title">
<li class="section-title"> <%= link_to admin_proposals_path do %>
<%= link_to admin_proposals_path do %> <span class="icon-proposals"></span>
<span class="icon-proposals"></span> <strong><%= t("admin.menu.proposals") %></strong>
<strong><%= t("admin.menu.proposals") %></strong>
<% end %>
</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>
<% 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 %> <% end %>
</li> </li>
<% end %>
<% if feature?(:polls) %> <% if feature?(:debates) %>
<li class="section-title <%= "is-active" if menu_polls? %>"> <li class="section-title <%= "is-active" if controller_name == "debates" %>">
<%= link_to admin_polls_path do %> <%= link_to admin_debates_path do %>
<span class="icon-checkmark-circle"></span> <span class="icon-debates"></span>
<strong><%= t("admin.menu.polls") %></strong> <strong><%= t("admin.menu.debates") %></strong>
<% end %>
</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>
<% 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>
<% 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 <%= "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?(: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>
<% 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 <%= "class=is-active" if controller_name == "newsletters" %>>
<%= link_to t("admin.menu.newsletters"), admin_newsletters_path %>
</li>
<li <%= "class=is-active" if controller_name == "admin_notifications" %>>
<%= link_to t("admin.menu.admin_notifications"), admin_admin_notifications_path %>
</li>
<li <%= "class=is-active" if controller_name == "system_emails" %>>
<%= link_to t("admin.menu.system_emails"), admin_system_emails_path %>
</li>
<li <%= "class=is-active" if controller_name == "emails_download" %>>
<%= link_to t("admin.menu.emails_download"), admin_emails_download_index_path %>
</li>
</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? &&
controller.class.parent != Admin::Poll::Questions::Answers %>>
<li <%= "class=is-active" if menu_homepage? %>>
<%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %>
</li>
<li <%= "class=is-active" if menu_pages? || controller_name == "pages" %>>
<%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %>
</li>
<li <%= "class=is-active" if controller_name == "banners" %>>
<%= link_to t("admin.menu.banner"), admin_banners_path %>
</li>
<li <%= "class=is-active" if controller_name == "information_texts" %>>
<%= link_to t("admin.menu.site_customization.information_texts"), admin_site_customization_information_texts_path %>
</li>
<li <%= "class=is-active" if controller_name == "documents" %>>
<%= link_to t("admin.menu.site_customization.documents"),
admin_site_customization_documents_path %>
</li>
</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? %>>
<% if feature?(:proposals) %>
<li <%= "class=is-active" if controller_name == "hidden_proposals" %>>
<%= link_to t("admin.menu.hidden_proposals"), admin_hidden_proposals_path %>
</li>
<% end %>
<% if feature?(:debates) %>
<li <%= "class=is-active" if controller_name == "hidden_debates" %>>
<%= link_to t("admin.menu.hidden_debates"), admin_hidden_debates_path %>
</li>
<% end %>
<% if feature?(:budgets) %>
<li <%= "class=is-active" if controller_name == "hidden_budget_investments" %>>
<%= link_to t("admin.menu.hidden_budget_investments"), admin_hidden_budget_investments_path %>
</li>
<% end %>
<li <%= "class=is-active" if controller_name == "hidden_comments" %>>
<%= link_to t("admin.menu.hidden_comments"), admin_hidden_comments_path %>
</li>
<li <%= "class=is-active" if controller_name == "hidden_proposal_notifications" %>>
<%= link_to t("admin.menu.hidden_proposal_notifications"), admin_hidden_proposal_notifications_path %>
</li>
<li <%= "class=is-active" if controller_name == "hidden_users" %>>
<%= link_to t("admin.menu.hidden_users"), admin_hidden_users_path %>
</li>
<li <%= "class=is-active" if controller_name == "activity" %>>
<%= link_to t("admin.menu.activity"), admin_activity_path %>
</li>
</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 <%= "class=is-active" if controller_name == "administrators" %>>
<%= link_to t("admin.menu.administrators"), admin_administrators_path %>
</li>
<li <%= "class=is-active" if controller_name == "organizations" %>>
<%= link_to t("admin.menu.organizations"), admin_organizations_path %>
</li>
<li <%= "class=is-active" if controller_name == "officials" %>>
<%= link_to t("admin.menu.officials"), admin_officials_path %>
</li>
<li <%= "class=is-active" if controller_name == "moderators" %>>
<%= link_to t("admin.menu.moderators"), admin_moderators_path %>
</li>
<li <%= "class=is-active" if controller_name == "valuators" %>>
<%= link_to t("admin.menu.valuators"), admin_valuators_path %>
</li>
<li <%= "class=is-active" if controller_name == "managers" %>>
<%= link_to t("admin.menu.managers"), admin_managers_path %>
</li>
<li <%= "class=is-active" if controller_name == "users" %>>
<%= link_to t("admin.menu.users"), admin_users_path %>
</li>
</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 %> <% end %>
</li> </li>
<% end %>
<li class="section-title"> <li class="section-title <%= "is-active" if controller_name == "comments" %>">
<a href="#"> <%= link_to admin_comments_path do %>
<span class="icon-settings"></span> <span class="icon-comments"></span>
<strong><%= t("admin.menu.title_settings") %></strong> <strong><%= t("admin.menu.comments") %></strong>
</a> <% end %>
<ul <%= "class=is-active" if menu_settings? %>> </li>
<li <%= "class=is-active" if controller_name == "settings" %>>
<%= link_to t("admin.menu.settings"), admin_settings_path %>
</li>
<li <%= "class=is-active" if controller_name == "tags" %>> <% if feature?(:polls) %>
<%= link_to t("admin.menu.proposals_topics"), admin_tags_path %> <li class="section-title <%= "is-active" if menu_polls? %>">
</li> <%= link_to admin_polls_path do %>
<span class="icon-checkmark-circle"></span>
<li <%= "class=is-active" if controller_name == "geozones" %>> <strong><%= t("admin.menu.polls") %></strong>
<%= link_to t("admin.menu.geozones"), admin_geozones_path %> <% end %>
</li>
<li <%= "class=is-active" if controller_name == "images" &&
controller.class.parent != Admin::Poll::Questions::Answers %>>
<%= link_to t("admin.menu.site_customization.images"), admin_site_customization_images_path %>
</li>
<li <%= "class=is-active" if controller_name == "content_blocks" %>>
<%= 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? %>>
<%= link_to t("admin.menu.local_census_records"), admin_local_census_records_path %>
</li>
</ul>
</li> </li>
<li class="section-title"> <% end %>
<a href="#">
<span class="icon-check"></span>
<strong><%= t("admin.menu.dashboard") %></strong>
</a>
<ul <%= "class=is-active" if menu_dashboard? %>>
<li <%= "class=is-active" if controller_name == "actions" %>>
<%= link_to t("admin.menu.dashboard_actions"), admin_dashboard_actions_path %>
</li>
<li <%= "class=is-active" if controller_name == "administrator_tasks" %>> <% if feature?(:legislation) %>
<%= link_to admin_dashboard_administrator_tasks_path do %> <li class="section-title <%= "is-active" if controller.class.parent == Admin::Legislation %>">
<%= t("admin.menu.administrator_tasks") %> <%= link_to admin_legislation_processes_path do %>
<% end %> <span class="icon-file-text"></span>
</li> <strong><%= t("admin.menu.legislation") %></strong>
</ul> <% end %>
</li> </li>
</ul> <% end %>
</div>
<% 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>
<% 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 <%= "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?(: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>
<% 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 <%= "class=is-active" if controller_name == "newsletters" %>>
<%= link_to t("admin.menu.newsletters"), admin_newsletters_path %>
</li>
<li <%= "class=is-active" if controller_name == "admin_notifications" %>>
<%= link_to t("admin.menu.admin_notifications"), admin_admin_notifications_path %>
</li>
<li <%= "class=is-active" if controller_name == "system_emails" %>>
<%= link_to t("admin.menu.system_emails"), admin_system_emails_path %>
</li>
<li <%= "class=is-active" if controller_name == "emails_download" %>>
<%= link_to t("admin.menu.emails_download"), admin_emails_download_index_path %>
</li>
</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? &&
controller.class.parent != Admin::Poll::Questions::Answers %>>
<li <%= "class=is-active" if menu_homepage? %>>
<%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %>
</li>
<li <%= "class=is-active" if menu_pages? || controller_name == "pages" %>>
<%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %>
</li>
<li <%= "class=is-active" if controller_name == "banners" %>>
<%= link_to t("admin.menu.banner"), admin_banners_path %>
</li>
<li <%= "class=is-active" if controller_name == "information_texts" %>>
<%= link_to t("admin.menu.site_customization.information_texts"), admin_site_customization_information_texts_path %>
</li>
<li <%= "class=is-active" if controller_name == "documents" %>>
<%= link_to t("admin.menu.site_customization.documents"),
admin_site_customization_documents_path %>
</li>
</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? %>>
<% if feature?(:proposals) %>
<li <%= "class=is-active" if controller_name == "hidden_proposals" %>>
<%= link_to t("admin.menu.hidden_proposals"), admin_hidden_proposals_path %>
</li>
<% end %>
<% if feature?(:debates) %>
<li <%= "class=is-active" if controller_name == "hidden_debates" %>>
<%= link_to t("admin.menu.hidden_debates"), admin_hidden_debates_path %>
</li>
<% end %>
<% if feature?(:budgets) %>
<li <%= "class=is-active" if controller_name == "hidden_budget_investments" %>>
<%= link_to t("admin.menu.hidden_budget_investments"), admin_hidden_budget_investments_path %>
</li>
<% end %>
<li <%= "class=is-active" if controller_name == "hidden_comments" %>>
<%= link_to t("admin.menu.hidden_comments"), admin_hidden_comments_path %>
</li>
<li <%= "class=is-active" if controller_name == "hidden_proposal_notifications" %>>
<%= link_to t("admin.menu.hidden_proposal_notifications"), admin_hidden_proposal_notifications_path %>
</li>
<li <%= "class=is-active" if controller_name == "hidden_users" %>>
<%= link_to t("admin.menu.hidden_users"), admin_hidden_users_path %>
</li>
<li <%= "class=is-active" if controller_name == "activity" %>>
<%= link_to t("admin.menu.activity"), admin_activity_path %>
</li>
</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 <%= "class=is-active" if controller_name == "administrators" %>>
<%= link_to t("admin.menu.administrators"), admin_administrators_path %>
</li>
<li <%= "class=is-active" if controller_name == "organizations" %>>
<%= link_to t("admin.menu.organizations"), admin_organizations_path %>
</li>
<li <%= "class=is-active" if controller_name == "officials" %>>
<%= link_to t("admin.menu.officials"), admin_officials_path %>
</li>
<li <%= "class=is-active" if controller_name == "moderators" %>>
<%= link_to t("admin.menu.moderators"), admin_moderators_path %>
</li>
<li <%= "class=is-active" if controller_name == "valuators" %>>
<%= link_to t("admin.menu.valuators"), admin_valuators_path %>
</li>
<li <%= "class=is-active" if controller_name == "managers" %>>
<%= link_to t("admin.menu.managers"), admin_managers_path %>
</li>
<li <%= "class=is-active" if controller_name == "users" %>>
<%= link_to t("admin.menu.users"), admin_users_path %>
</li>
</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>
<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 <%= "class=is-active" if controller_name == "settings" %>>
<%= link_to t("admin.menu.settings"), admin_settings_path %>
</li>
<li <%= "class=is-active" if controller_name == "tags" %>>
<%= link_to t("admin.menu.proposals_topics"), admin_tags_path %>
</li>
<li <%= "class=is-active" if controller_name == "geozones" %>>
<%= link_to t("admin.menu.geozones"), admin_geozones_path %>
</li>
<li <%= "class=is-active" if controller_name == "images" &&
controller.class.parent != Admin::Poll::Questions::Answers %>>
<%= link_to t("admin.menu.site_customization.images"), admin_site_customization_images_path %>
</li>
<li <%= "class=is-active" if controller_name == "content_blocks" %>>
<%= 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? %>>
<%= 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 <%= "class=is-active" if controller_name == "actions" %>>
<%= link_to t("admin.menu.dashboard_actions"), admin_dashboard_actions_path %>
</li>
<li <%= "class=is-active" if controller_name == "administrator_tasks" %>>
<%= link_to admin_dashboard_administrator_tasks_path do %>
<%= t("admin.menu.administrator_tasks") %>
<% end %>
</li>
</ul>
</li>
</ul>

View File

@@ -7,34 +7,22 @@
</head> </head>
<body class="admin"> <body class="admin">
<div class="off-canvas-wrapper"> <%= render "layouts/admin_header" %>
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
<div class="show-for-small-only"> <div class="menu-and-content no-margin-top">
<%= side_menu %> <%= check_box_tag :show_menu, nil, false, role: "switch" %>
</div>
</div>
<div class="off-canvas-content" data-off-canvas-content> <nav id="side_menu" class="admin-sidebar">
<%= render "layouts/admin_header" %> <%= render "/#{namespace}/menu" %>
</nav>
<div class="side-menu-and-admin-content no-margin-top"> <div class="admin-content">
<div id="side_menu" class="hide-for-small-only"> <%= label_tag :show_menu, t("admin.menu.admin"),
<%= side_menu %> "aria-hidden": true, class: "button hollow expanded" %>
</div>
<div class="admin-content"> <%= render "layouts/flash" %>
<div class="show-for-small-only"> <%= render "layouts/officing_booth" if controller.class.parent == Officing && session[:booth_id].present? %>
<button type="button" class="button hollow expanded" data-toggle="offCanvas"><%= t("admin.menu.admin") %></button> <%= yield %>
</div>
<%= render "layouts/flash" %>
<%= render "layouts/officing_booth" if controller.class.parent == Officing && session[:booth_id].present? %>
<%= yield %>
</div>
</div>
</div>
</div> </div>
</div> </div>
</body> </body>

View File

@@ -25,40 +25,23 @@
<h1 class="show-for-sr"><%= setting["org_name"] %></h1> <h1 class="show-for-sr"><%= setting["org_name"] %></h1>
<div class="off-canvas-wrapper"> <%= render "layouts/header", with_subnavigation: false %>
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
<div class="show-for-small-only">
<div class="dashboard-sidebar">
<%= render "dashboard/menu" %>
</div>
</div>
</div>
<div class="off-canvas-content" data-off-canvas-content> <div class="menu-and-content no-margin-top">
<%= render "layouts/header", with_subnavigation: false %> <%= check_box_tag :show_menu, nil, false, role: "switch" %>
<div class="dashboard-menu-and-content no-margin-top"> <nav id="side_menu" class="dashboard-sidebar">
<div id="side_menu" class="hide-for-small-only"> <%= render "dashboard/menu" %>
<div class="dashboard-sidebar"> </nav>
<%= render "dashboard/menu" %>
</div>
</div>
<div class="admin-content"> <div class="admin-content">
<div class="show-for-small-only"> <%= label_tag :show_menu, t("admin.menu.admin"),
<button type="button" class="button hollow expanded" data-toggle="offCanvas"> "aria-hidden": true, class: "button hollow expanded" %>
<%= t("admin.menu.admin") %>
</button>
</div>
<%= render "layouts/flash" %> <%= render "layouts/flash" %>
<%= render "layouts/dashboard/proposal_totals" %> <%= render "layouts/dashboard/proposal_totals" %>
<%= render "layouts/dashboard/proposal_header" %> <%= render "layouts/dashboard/proposal_header" %>
<%= yield %> <%= yield %>
</div>
</div>
</div>
</div> </div>
</div> </div>
</body> </body>

View File

@@ -45,18 +45,21 @@
</div> </div>
</header> </header>
<main class="no-margin-top row expanded collapse"> <div class="menu-and-content no-margin-top">
<div class="small-12 medium-3 column"> <%= check_box_tag :show_menu, nil, false, role: "switch" %>
<nav class="admin-sidebar">
<%= render "/management/menu" %> <%= render "/management/menu" %>
</div> </nav>
<%= render "management/account_info" %> <main class="admin-content">
<%= label_tag :show_menu, t("admin.menu.admin"),
"aria-hidden": true, class: "button hollow expanded" %>
<div class="admin-content small-12 medium-9 column"> <%= render "management/account_info" %>
<%= render "layouts/flash" %> <%= render "layouts/flash" %>
<%= yield %> <%= yield %>
</div> </main>
</main> </div>
</body> </body>
</html> </html>

View File

@@ -1,67 +0,0 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user.try(:id) %>">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<%= render "layouts/tracking_data" %>
<%= render "layouts/meta_tags" %>
<title><%= content_for?(:title) ? yield(:title) : setting["org_name"] %></title>
<%= content_for :canonical %>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application", "data-turbolinks-track" => "reload" %>
<%= csrf_meta_tags %>
<%= favicon_link_tag "favicon.ico" %>
<%= favicon_link_tag image_path_for("apple-touch-icon-200.png"),
rel: "icon apple-touch-icon",
sizes: "200x200",
type: "image/png" %>
<%= content_for :social_media_meta_tags %>
<%= raw setting["per_page_code_head"] %>
</head>
<body class="proposal-dashboard">
<%= raw setting["per_page_code_body"] %>
<h1 class="show-for-sr"><%= setting["org_name"] %></h1>
<div class="off-canvas-wrapper">
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
<div class="show-for-small-only">
<div class="dashboard-sidebar" data-equalizer-watch>
<%= render "proposals_dashboard/menu" %>
</div>
</div>
</div>
<div class="off-canvas-content" data-off-canvas-content>
<%= render "layouts/header", with_subnavigation: false %>
<div class="no-margin-top row expanded collapse" data-equalizer>
<div class="small-12 medium-3 column" data-equalizer-watch>
<div class="show-for-small-only">
<button type="button" class="button hollow expanded" data-toggle="offCanvas">
<%= t("admin.menu.admin") %>
</button>
</div>
<div id="side_menu" class="hide-for-small-only">
<div class="dashboard-sidebar" data-equalizer-watch>
<%= render "proposals_dashboard/menu" %>
</div>
</div>
</div>
<div class="admin-content small-12 medium-9 column" data-equalizer-watch>
<%= render "layouts/flash" %>
<%= render "layouts/dashboard/proposal_totals" %>
<%= render "layouts/dashboard/proposal_header" %>
<%= yield %>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,43 +1,40 @@
<% if managed_user.document_number.present? %> <% if managed_user.document_number.present? %>
<section class="small-12 medium-9 column"> <section class="account-info">
<div class="account-info"> <%= link_to(t("management.account_info.change_user"),
logout_management_users_path,
<%= link_to(t("management.account_info.change_user"), method: :delete,
logout_management_users_path, class: "float-right btchange-user button hollow") %>
method: :delete,
class: "float-right btchange-user button hollow") %>
<% if managed_user.level_two_or_three_verified? %>
<p>
<strong>
<%= t("management.account_info.identified_label") %>
</strong>
</p>
<% end %>
<% if managed_user.username.present? %>
<p>
<%= t("management.account_info.username_label") %>
<strong><%= managed_user.username %></strong>
</p>
<% end %>
<% if managed_user.email.present? %>
<p>
<%= t("management.account_info.email_label") %>
<strong><%= managed_user.email %></strong>
</p>
<% end %>
<% if managed_user.level_two_or_three_verified? %>
<p> <p>
<%= t("management.account_info.document_type_label") %> <strong>
<strong><%= humanize_document_type(managed_user.document_type) %></strong> <%= t("management.account_info.identified_label") %>
</strong>
</p> </p>
<% end %>
<% if managed_user.username.present? %>
<p> <p>
<%= t("management.account_info.document_number_label") %> <%= t("management.account_info.username_label") %>
<strong><%= managed_user.document_number %></strong> <strong><%= managed_user.username %></strong>
</p> </p>
</div> <% end %>
<% if managed_user.email.present? %>
<p>
<%= t("management.account_info.email_label") %>
<strong><%= managed_user.email %></strong>
</p>
<% end %>
<p>
<%= t("management.account_info.document_type_label") %>
<strong><%= humanize_document_type(managed_user.document_type) %></strong>
</p>
<p>
<%= t("management.account_info.document_number_label") %>
<strong><%= managed_user.document_number %></strong>
</p>
</section> </section>
<% end %> <% end %>

View File

@@ -1,68 +1,66 @@
<div class="admin-sidebar"> <ul id="admin_menu" data-accordion-menu>
<ul id="admin_menu" data-accordion-menu> <li class="section-title">
<li class="section-title"> <a href="#">
<a href="#"> <span class="icon-user"></span>
<span class="icon-user"></span> <strong><%= t("management.menu.users") %></strong>
<strong><%= t("management.menu.users") %></strong> </a>
</a> <ul class="is-active">
<ul class="is-active">
<li <%= "class=is-active" if menu_users? %>> <li <%= "class=is-active" if menu_users? %>>
<%= link_to t("management.menu.select_user"), management_document_verifications_path %> <%= link_to t("management.menu.select_user"), management_document_verifications_path %>
</li>
<% if managed_user.email %>
<li <%= "class=is-active" if menu_edit_password_email? %>>
<%= link_to t("management.account.menu.reset_password_email"), edit_password_email_management_account_path %>
</li>
<% end %>
<li <%= "class=is-active" if menu_edit_password_manually? %>>
<%= link_to t("management.account.menu.reset_password_manually"), edit_password_manually_management_account_path %>
</li>
<li <%= "class=is-active" if menu_create_proposal? %>>
<%= link_to t("management.menu.create_proposal"), new_management_proposal_path %>
</li>
<li <%= "class=is-active" if menu_support_proposal? %>>
<%= link_to t("management.menu.support_proposals"), management_proposals_path %>
</li>
<% if Setting["process.budgets"] %>
<li <%= "class=is-active" if menu_create_investments? %>>
<%= link_to t("management.menu.create_budget_investment"), create_investments_management_budgets_path %>
</li>
<li <%= "class=is-active" if menu_support_investments? %>>
<%= link_to t("management.menu.support_budget_investments"), support_investments_management_budgets_path %>
</li>
<% end %>
</li> </li>
</ul>
<% if managed_user.email %>
<li <%= "class=is-active" if menu_edit_password_email? %>>
<%= link_to t("management.account.menu.reset_password_email"), edit_password_email_management_account_path %>
</li>
<% end %>
<li <%= "class=is-active" if menu_edit_password_manually? %>>
<%= link_to t("management.account.menu.reset_password_manually"), edit_password_manually_management_account_path %>
</li>
<li <%= "class=is-active" if menu_create_proposal? %>>
<%= link_to t("management.menu.create_proposal"), new_management_proposal_path %>
</li>
<li <%= "class=is-active" if menu_support_proposal? %>>
<%= link_to t("management.menu.support_proposals"), management_proposals_path %>
</li>
<% if Setting["process.budgets"] %>
<li <%= "class=is-active" if menu_create_investments? %>>
<%= link_to t("management.menu.create_budget_investment"), create_investments_management_budgets_path %>
</li>
<li <%= "class=is-active" if menu_support_investments? %>>
<%= link_to t("management.menu.support_budget_investments"), support_investments_management_budgets_path %>
</li>
<% end %>
</li> </li>
</ul>
</li>
<% if Setting["process.budgets"] %> <% if Setting["process.budgets"] %>
<li <%= "class=is-active" if menu_print_investments? %>> <li <%= "class=is-active" if menu_print_investments? %>>
<%= link_to print_investments_management_budgets_path do %> <%= link_to print_investments_management_budgets_path do %>
<span class="icon-print"></span> <span class="icon-print"></span>
<%= t("management.menu.print_budget_investments") %> <%= t("management.menu.print_budget_investments") %>
<% end %> <% end %>
</li> </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 %> <% end %>
</li>
<li <%= "class=is-active" if menu_print_proposals? %>> <li <%= "class=is-active" if menu_user_invites? %>>
<%= link_to print_management_proposals_path do %> <%= link_to new_management_user_invite_path do %>
<span class="icon-print"></span> <span class="icon-letter"></span>
<%= t("management.menu.print_proposals") %> <%= t("management.menu.user_invites") %>
<% end %> <% end %>
</li> </li>
</ul>
<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 %>
</li>
</ul>
</div>

View File

@@ -1,55 +1,53 @@
<nav class="admin-sidebar"> <ul id="moderation_menu">
<ul id="moderation_menu"> <li>
<li> <%= link_to t("moderation.dashboard.index.title"), moderation_root_path %>
<%= link_to t("moderation.dashboard.index.title"), moderation_root_path %> </li>
</li>
<% if feature?(:proposals) %> <% if feature?(:proposals) %>
<li <%= "class=is-active" if controller_name == "proposals" %>> <li <%= "class=is-active" if controller_name == "proposals" %>>
<%= link_to moderation_proposals_path do %> <%= link_to moderation_proposals_path do %>
<span class="icon-proposals"></span> <span class="icon-proposals"></span>
<%= t("moderation.menu.proposals") %> <%= t("moderation.menu.proposals") %>
<% end %>
</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 %>
</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 %>
</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 %>
</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 %> <% end %>
</li> </li>
<li <%= "class=is-active" if controller_name == "users" %>> <li <%= "class=is-active" if controller_name == "proposal_notifications" %>>
<%= link_to moderation_users_path do %> <%= link_to moderation_proposal_notifications_path do %>
<span class="icon-user"></span> <span class="icon-proposals"></span>
<%= t("moderation.menu.users") %> <%= t("moderation.menu.proposal_notifications") %>
<% end %> <% end %>
</li> </li>
</ul> <% end %>
</nav>
<% 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 %>
</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 %>
</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 %>
</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 %>
</li>
</ul>