diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index b986816e6..8dc11daae 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -291,10 +291,6 @@ $sidebar-active: #f4fcd0; margin-right: rem-calc(12); } - .side-menu-and-admin-content { - @include side-menu-and-content; - } - .admin-content { .proposal-form { padding-top: 0; @@ -652,7 +648,7 @@ code { border-radius: rem-calc(3); font-size: rem-calc(16); font-weight: normal; - margin: $line-height; + margin-bottom: $line-height; padding: $line-height / 2; strong { diff --git a/app/assets/stylesheets/dashboard.scss b/app/assets/stylesheets/dashboard.scss index 7de561c42..cfa1985b4 100644 --- a/app/assets/stylesheets/dashboard.scss +++ b/app/assets/stylesheets/dashboard.scss @@ -16,10 +16,6 @@ // 01. Dashboard global // -------------------- -.dashboard-menu-and-content { - @include side-menu-and-content; -} - .proposal-title { display: inline-block; diff --git a/app/assets/stylesheets/foundation_and_overrides.scss b/app/assets/stylesheets/foundation_and_overrides.scss index c4fa6944e..577b8476f 100644 --- a/app/assets/stylesheets/foundation_and_overrides.scss +++ b/app/assets/stylesheets/foundation_and_overrides.scss @@ -31,7 +31,6 @@ @include foundation-responsive-embed; @include foundation-label; @include foundation-media-object; -@include foundation-off-canvas; @include foundation-orbit; @include foundation-pagination; @include foundation-progress-bar; diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 25c769a2a..153bf1638 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -436,10 +436,6 @@ a { display: table-cell; } -.off-canvas-content { - box-shadow: none; -} - .uppercase { text-transform: uppercase; } @@ -449,6 +445,66 @@ a { 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 // ---------- diff --git a/app/assets/stylesheets/mixins.scss b/app/assets/stylesheets/mixins.scss index 289eb83a6..faef06d3f 100644 --- a/app/assets/stylesheets/mixins.scss +++ b/app/assets/stylesheets/mixins.scss @@ -1,9 +1,8 @@ // Table of Contents // // 01. Logo -// 02. Side menu and content -// 03. Orbit bullets -// 04. Direct uploads +// 02. Orbit bullets +// 03. Direct uploads // ------------------ // 01. Logo @@ -22,30 +21,8 @@ } } -// 02. Side menu and content -// ------------------------- - -@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 -// ---------------- +// 02. Orbit bullets +// ----------------- @mixin orbit-bullets { @include disable-mouse-outline; @@ -72,7 +49,7 @@ } } -// 04. Direct uploads +// 03. Direct uploads // ------------------ @mixin direct-uploads { diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 119bbe125..44a878bf1 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -1,12 +1,4 @@ module AdminHelper - def side_menu - if namespace == "moderation/budgets" - render "/moderation/menu" - else - render "/#{namespace}/menu" - end - end - def namespaced_root_path "/#{namespace}" end diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 6c61c7e84..b7a85121c 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -1,281 +1,279 @@ -
-
+ <% end %> + + <% if feature?(:budgets) %> +
  • "> + <%= link_to admin_budgets_path do %> + + <%= t("admin.menu.budgets") %> + <% end %> +
  • + <% end %> + +
  • + + + <%= t("admin.menu.title_booths") %> + + +
  • + + <% if feature?(:signature_sheets) %> +
  • "> + <%= link_to admin_signature_sheets_path do %> + + <%= t("admin.menu.signature_sheets") %> + <% end %> +
  • + <% end %> + + <% messages_sections = %w[newsletters emails_download admin_notifications system_emails] %> + <% messages_menu_active = messages_sections.include?(controller_name) %> +
  • > + + + <%= t("admin.menu.messaging_users") %> + + +
  • + +
  • + + + <%= t("admin.menu.title_site_customization") %> + + +
  • + +
  • + + + <%= t("admin.menu.title_moderated_content") %> + + +
  • + +
  • + + + <%= t("admin.menu.title_profiles") %> + + +
  • + +
  • > + <%= link_to admin_stats_path do %> + <%= t("admin.menu.stats") %> + <% end %> +
  • + +
  • + + + <%= t("admin.menu.title_settings") %> + + +
  • +
  • + + + <%= t("admin.menu.dashboard") %> + + +
  • + diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index b73dc8fae..d25288dc2 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -7,34 +7,22 @@ -
    -
    -
    + <%= render "layouts/admin_header" %> -
    - <%= side_menu %> -
    -
    + diff --git a/app/views/layouts/dashboard.html.erb b/app/views/layouts/dashboard.html.erb index 2b20ca089..9e7786812 100644 --- a/app/views/layouts/dashboard.html.erb +++ b/app/views/layouts/dashboard.html.erb @@ -25,40 +25,23 @@

    <%= setting["org_name"] %>

    -
    -
    -
    -
    -
    - <%= render "dashboard/menu" %> -
    -
    -
    + <%= render "layouts/header", with_subnavigation: false %> -
    - <%= render "layouts/header", with_subnavigation: false %> +
    diff --git a/app/views/layouts/management.html.erb b/app/views/layouts/management.html.erb index a3dc288f9..449b20a76 100644 --- a/app/views/layouts/management.html.erb +++ b/app/views/layouts/management.html.erb @@ -45,18 +45,21 @@
    -
    -
    + + - <%= render "management/account_info" %> +
    + <%= label_tag :show_menu, t("admin.menu.admin"), + "aria-hidden": true, class: "button hollow expanded" %> -
    + <%= render "management/account_info" %> <%= render "layouts/flash" %> <%= yield %> -
    -
    - +
    +
    diff --git a/app/views/layouts/proposals_dashboard.html.erb b/app/views/layouts/proposals_dashboard.html.erb deleted file mode 100644 index 050fde8a6..000000000 --- a/app/views/layouts/proposals_dashboard.html.erb +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - <%= render "layouts/tracking_data" %> - <%= render "layouts/meta_tags" %> - <%= content_for?(:title) ? yield(:title) : setting["org_name"] %> - <%= 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"] %> - - - <%= raw setting["per_page_code_body"] %> - -

    <%= setting["org_name"] %>

    - -
    -
    -
    -
    -
    - <%= render "proposals_dashboard/menu" %> -
    -
    -
    - -
    - <%= render "layouts/header", with_subnavigation: false %> - -
    -
    - -
    - -
    - -
    -
    - <%= render "proposals_dashboard/menu" %> -
    -
    -
    -
    - <%= render "layouts/flash" %> - <%= render "layouts/dashboard/proposal_totals" %> - <%= render "layouts/dashboard/proposal_header" %> - <%= yield %> -
    -
    -
    -
    -
    - - diff --git a/app/views/management/_account_info.html.erb b/app/views/management/_account_info.html.erb index 28f141ba9..cb262a9ef 100644 --- a/app/views/management/_account_info.html.erb +++ b/app/views/management/_account_info.html.erb @@ -1,43 +1,40 @@ <% if managed_user.document_number.present? %> -
    - + <% end %> + + <% if managed_user.email.present? %> +

    + <%= t("management.account_info.email_label") %> + <%= managed_user.email %> +

    + <% end %> + +

    + <%= t("management.account_info.document_type_label") %> + <%= humanize_document_type(managed_user.document_type) %> +

    + +

    + <%= t("management.account_info.document_number_label") %> + <%= managed_user.document_number %> +

    <% end %> diff --git a/app/views/management/_menu.html.erb b/app/views/management/_menu.html.erb index 213e0ece4..2eb65d5b7 100644 --- a/app/views/management/_menu.html.erb +++ b/app/views/management/_menu.html.erb @@ -1,68 +1,66 @@ -
    -
      -
    • - - - <%= t("management.menu.users") %> - -
        +
          +
        • + + + <%= t("management.menu.users") %> + +
            -
          • > - <%= link_to t("management.menu.select_user"), management_document_verifications_path %> -
          • - - <% if managed_user.email %> -
          • > - <%= link_to t("management.account.menu.reset_password_email"), edit_password_email_management_account_path %> -
          • - <% end %> - -
          • > - <%= link_to t("management.account.menu.reset_password_manually"), edit_password_manually_management_account_path %> -
          • - -
          • > - <%= link_to t("management.menu.create_proposal"), new_management_proposal_path %> -
          • - -
          • > - <%= link_to t("management.menu.support_proposals"), management_proposals_path %> -
          • - - <% if Setting["process.budgets"] %> -
          • > - <%= link_to t("management.menu.create_budget_investment"), create_investments_management_budgets_path %> -
          • - -
          • > - <%= link_to t("management.menu.support_budget_investments"), support_investments_management_budgets_path %> -
          • - <% end %> +
          • > + <%= link_to t("management.menu.select_user"), management_document_verifications_path %>
          • -
          + + <% if managed_user.email %> +
        • > + <%= link_to t("management.account.menu.reset_password_email"), edit_password_email_management_account_path %> +
        • + <% end %> + +
        • > + <%= link_to t("management.account.menu.reset_password_manually"), edit_password_manually_management_account_path %> +
        • + +
        • > + <%= link_to t("management.menu.create_proposal"), new_management_proposal_path %> +
        • + +
        • > + <%= link_to t("management.menu.support_proposals"), management_proposals_path %> +
        • + + <% if Setting["process.budgets"] %> +
        • > + <%= link_to t("management.menu.create_budget_investment"), create_investments_management_budgets_path %> +
        • + +
        • > + <%= link_to t("management.menu.support_budget_investments"), support_investments_management_budgets_path %> +
        • + <% end %> +
        + - <% if Setting["process.budgets"] %> -
      • > - <%= link_to print_investments_management_budgets_path do %> - - <%= t("management.menu.print_budget_investments") %> - <% end %> -
      • + <% if Setting["process.budgets"] %> +
      • > + <%= link_to print_investments_management_budgets_path do %> + + <%= t("management.menu.print_budget_investments") %> + <% end %> +
      • + <% end %> + +
      • > + <%= link_to print_management_proposals_path do %> + + <%= t("management.menu.print_proposals") %> <% end %> +
      • -
      • > - <%= link_to print_management_proposals_path do %> - - <%= t("management.menu.print_proposals") %> - <% end %> -
      • - -
      • > - <%= link_to new_management_user_invite_path do %> - - <%= t("management.menu.user_invites") %> - <% end %> -
      • -
      -
    +
  • > + <%= link_to new_management_user_invite_path do %> + + <%= t("management.menu.user_invites") %> + <% end %> +
  • + diff --git a/app/views/moderation/_menu.html.erb b/app/views/moderation/_menu.html.erb index 3437a731f..800b1551c 100644 --- a/app/views/moderation/_menu.html.erb +++ b/app/views/moderation/_menu.html.erb @@ -1,55 +1,53 @@ - + <% end %> + + <% if feature?(:debates) %> +
  • > + <%= link_to moderation_debates_path do %> + + <%= t("moderation.menu.flagged_debates") %> + <% end %> +
  • + <% end %> + + <% if feature?(:budgets) %> +
  • > + <%= link_to moderation_budget_investments_path do %> + + <%= t("moderation.menu.flagged_investments") %> + <% end %> +
  • + <% end %> + +
  • > + <%= link_to moderation_comments_path do %> + + <%= t("moderation.menu.flagged_comments") %> + <% end %> +
  • + +
  • > + <%= link_to moderation_users_path do %> + + <%= t("moderation.menu.users") %> + <% end %> +
  • +