mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 14:45:56 +08:00
Merge pull request #6320 from wandji20/wb-SCI-9406
Add helper method to show grey layout background [SCI-9406]
This commit is contained in:
commit
5960446401
|
@ -236,4 +236,10 @@ module ApplicationHelper
|
|||
# login_disclaimer: { title: "...", body: "...", action: "..." }
|
||||
ApplicationSettings.instance.values['login_disclaimer']
|
||||
end
|
||||
|
||||
def show_grey_background?
|
||||
return false unless controller_name && action_name
|
||||
|
||||
Extends::COLORED_BACKGROUND_ACTIONS.include?("#{controller_name}/#{action_name}")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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? %>
|
||||
|
|
|
@ -609,6 +609,14 @@ class Extends
|
|||
www.recaptcha.net/
|
||||
www.gstatic.com/recaptcha/
|
||||
)
|
||||
|
||||
COLORED_BACKGROUND_ACTIONS = %w(
|
||||
my_modules/protocols
|
||||
my_modules/signatures
|
||||
my_modules/activities
|
||||
results/index
|
||||
protocols/show
|
||||
)
|
||||
end
|
||||
|
||||
# rubocop:enable Style/MutableConstant
|
||||
|
|
Loading…
Reference in a new issue