From b3f41eb626e20d3ed9de5b93d213dc04f8d320fd Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 7 May 2018 17:49:36 +0200 Subject: [PATCH] Reorders admin menu sections --- app/helpers/admin_helper.rb | 14 +- app/views/admin/_menu.html.erb | 282 +++++++++++++++++---------------- 2 files changed, 148 insertions(+), 148 deletions(-) diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index c88deba56..ce92b0da5 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -12,12 +12,8 @@ module AdminHelper t("#{namespace}.header.title") end - def menu_tags? - ["tags"].include?(controller_name) - end - def menu_moderated_content? - ["proposals", "debates", "comments", "hidden_users"].include?(controller_name) && controller.class.parent != Admin::Legislation + ["proposals", "debates", "comments", "hidden_users", "activity"].include?(controller_name) && controller.class.parent != Admin::Legislation end def menu_budget? @@ -29,15 +25,15 @@ module AdminHelper end def menu_profiles? - %w[administrators organizations officials moderators valuators managers users activity].include?(controller_name) + %w[administrators organizations officials moderators valuators managers users].include?(controller_name) end - def menu_banners? - ["banners"].include?(controller_name) + def menu_settings? + ["settings", "tags", "geozones", "images", "content_blocks"].include?(controller_name) end def menu_customization? - ["pages", "images", "content_blocks"].include?(controller_name) || menu_homepage? + ["pages", "banners"].include?(controller_name) || menu_homepage? end def menu_homepage? diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index d1663652c..7b1dd9044 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -1,18 +1,130 @@
- <% if feature?(:legislation) %> -
  • "> - <%= link_to admin_legislation_processes_path do %> - - <%= t("admin.menu.legislation") %> - <% end %> -
  • - <% end %> - -
  • - - - <%= t("admin.menu.title_banners") %> - -
      > -
    • > - <%= link_to t("admin.menu.banner"), admin_banners_path %> -
    • -
    +
  • > + <%= link_to admin_stats_path do %> + <%= t("admin.menu.stats") %> + <% end %>
  • - - <%= t("admin.menu.title_site_customization") %> + + <%= t("admin.menu.title_settings") %> -
      > -
    • > - <%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %> +
        > +
      • > + <%= link_to t("admin.menu.settings"), admin_settings_path %>
      • -
      • > - <%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %> +
      • > + <%= link_to t("admin.menu.proposals_topics"), admin_tags_path %> +
      • + +
      • > + <%= link_to t("admin.menu.geozones"), admin_geozones_path %>
      • - -
      • "> - <%= link_to admin_geozones_path do %> - - <%= t('admin.menu.geozones') %> - <% end %> -
      • - - <% if feature?(:signature_sheets) %> -
      • "> - <%= link_to admin_signature_sheets_path do %> - - <%= t("admin.menu.signature_sheets") %> - <% end %> -
      • - <% end %> - -
      • > - - - <%= t("admin.menu.emails") %> - -
          > -
        • > - <%= link_to t("admin.menu.newsletters"), admin_newsletters_path %> -
        • -
        • > - <%= link_to t("admin.menu.emails_download"), admin_emails_download_index_path %> -
        • -
        -
      • - -
      • "> - <%= link_to admin_settings_path do %> - - <%= t("admin.settings.index.title") %> - <% end %> -