From 26db37a17fe83e9723e42098dcac901901161d82 Mon Sep 17 00:00:00 2001 From: Manu Date: Sat, 12 Jan 2019 21:36:55 -0500 Subject: [PATCH] fixed wrong menu selection inside site content --- app/helpers/admin_helper.rb | 8 ++++++-- app/views/admin/_menu.html.erb | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 55825aba0..06e8c3eb7 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -54,11 +54,15 @@ module AdminHelper end def menu_customization? - ["pages", "banners", "information_texts"].include?(controller_name) || menu_homepage? + ["pages", "banners", "information_texts"].include?(controller_name) || menu_homepage? || menu_pages? end def menu_homepage? - ["homepage", "cards"].include?(controller_name) + ["homepage", "cards"].include?(controller_name) && params[:page_id].nil? + end + + def menu_pages? + ["pages", "cards"].include?(controller_name) && params[:page_id].present? end def official_level_options diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index c6ea68172..acc59b45a 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -122,7 +122,7 @@ <%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %> -
  • > +
  • > <%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %>