Add helper method to show grey layout background [SCI-9406]

This commit is contained in:
wandji20 2023-09-29 12:49:12 +01:00
parent 9966229324
commit dd34e72fb9
2 changed files with 14 additions and 9 deletions

View file

@ -236,4 +236,17 @@ module ApplicationHelper
# login_disclaimer: { title: "...", body: "...", action: "..." }
ApplicationSettings.instance.values['login_disclaimer']
end
def show_grey_background?
return false unless controller_name && action_name
%w(
my_modules/protocols
my_modules/signatures
my_modules/activities
results/index
protocols/show
organization/index
).include?("#{controller_name}/#{action_name}")
end
end

View file

@ -69,15 +69,7 @@
<span style="display: none;" data-hook="application-body-html"></span>
<div class="sci--layout"
data-grey-background="<%= [
'my_modules/protocols',
'my_modules/signatures',
'my_modules/activities',
'results/index',
'protocols/show',
'organization/index'
].include?(controller_name + '/' + action_name)
%>"
data-grey-background="<%= show_grey_background? %>"
data-breadcrumbs-collapsed="<%= !@breadcrumbs_items.present? %>"
data-navigator-collapsed="<%= !@navigator || session[:navigator_collapsed] %>"
data-left-navigation-collapsed=<%= !user_signed_in? %>