Merge pull request #5251 from dnsos/intuitive-admin-menu-sections
Move customizations to more intuitive admin menu section
This commit is contained in:
@@ -54,15 +54,13 @@ class Admin::MenuComponent < ApplicationComponent
|
|||||||
end
|
end
|
||||||
|
|
||||||
def settings?
|
def settings?
|
||||||
controllers_names = ["settings", "tenants", "tags", "geozones", "images",
|
controllers_names = ["settings", "tenants", "tags", "geozones", "local_census_records", "imports"]
|
||||||
"content_blocks", "local_census_records", "imports"]
|
controllers_names.include?(controller_name)
|
||||||
controllers_names.include?(controller_name) &&
|
|
||||||
controller.class.module_parent != Admin::Poll::Questions::Answers
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def customization?
|
def customization?
|
||||||
["pages", "banners", "information_texts", "documents"].include?(controller_name) ||
|
controllers_names = ["pages", "banners", "information_texts", "documents", "images", "content_blocks"]
|
||||||
homepage? || pages?
|
controllers_names.include?(controller_name) || homepage? || pages?
|
||||||
end
|
end
|
||||||
|
|
||||||
def homepage?
|
def homepage?
|
||||||
@@ -256,6 +254,8 @@ class Admin::MenuComponent < ApplicationComponent
|
|||||||
banners_link,
|
banners_link,
|
||||||
information_texts_link,
|
information_texts_link,
|
||||||
documents_link,
|
documents_link,
|
||||||
|
images_link,
|
||||||
|
content_blocks_link,
|
||||||
class: ("is-active" if customization? &&
|
class: ("is-active" if customization? &&
|
||||||
controller.class.module_parent != Admin::Poll::Questions::Answers)
|
controller.class.module_parent != Admin::Poll::Questions::Answers)
|
||||||
)
|
)
|
||||||
@@ -458,8 +458,6 @@ class Admin::MenuComponent < ApplicationComponent
|
|||||||
tenants_link,
|
tenants_link,
|
||||||
tags_link,
|
tags_link,
|
||||||
geozones_link,
|
geozones_link,
|
||||||
images_link,
|
|
||||||
content_blocks_link,
|
|
||||||
local_census_records_link,
|
local_census_records_link,
|
||||||
class: ("is-active" if settings?)
|
class: ("is-active" if settings?)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ describe "Admin custom content blocks", :admin do
|
|||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
within("#side_menu") do
|
within("#side_menu") do
|
||||||
click_link "Settings"
|
click_link "Site content"
|
||||||
click_link "Custom content blocks"
|
click_link "Custom content blocks"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ describe "Admin custom content blocks", :admin do
|
|||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
within("#side_menu") do
|
within("#side_menu") do
|
||||||
click_link "Settings"
|
click_link "Site content"
|
||||||
click_link "Custom content blocks"
|
click_link "Custom content blocks"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ describe "Admin custom content blocks", :admin do
|
|||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
within("#side_menu") do
|
within("#side_menu") do
|
||||||
click_link "Settings"
|
click_link "Site content"
|
||||||
click_link "Custom content blocks"
|
click_link "Custom content blocks"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ describe "Admin custom images", :admin do
|
|||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
within("#side_menu") do
|
within("#side_menu") do
|
||||||
click_link "Settings"
|
click_link "Site content"
|
||||||
click_link "Custom images"
|
click_link "Custom images"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user