diff --git a/app/helpers/homescreen_helper.rb b/app/helpers/homescreen_helper.rb index ffe57286e2..7628e15fb3 100644 --- a/app/helpers/homescreen_helper.rb +++ b/app/helpers/homescreen_helper.rb @@ -59,4 +59,10 @@ module HomescreenHelper title: label, target: '_blank' end + + ## + # Determine whether we should render the onboarding modal + def show_onboarding_modal? + return OpenProject::Configuration.onboarding_enabled? && params[:first_time_user] + end end diff --git a/app/views/homescreen/index.html.erb b/app/views/homescreen/index.html.erb index d8b74b1a98..ca2d9f6bdf 100644 --- a/app/views/homescreen/index.html.erb +++ b/app/views/homescreen/index.html.erb @@ -34,7 +34,7 @@ See doc/COPYRIGHT.rdoc for more details. -<% if params[:first_time_user] %> +<% if show_onboarding_modal? %> <%= render partial: '/onboarding/starting_video_modal' %> diff --git a/lib/open_project/configuration.rb b/lib/open_project/configuration.rb index 36d7700de9..e4639be626 100644 --- a/lib/open_project/configuration.rb +++ b/lib/open_project/configuration.rb @@ -92,7 +92,8 @@ module OpenProject 'apiv2_enable_basic_auth' => true, - 'onboarding_video_url' => 'https://player.vimeo.com/video/163426858' + 'onboarding_video_url' => 'https://player.vimeo.com/video/163426858', + 'onboarding_enabled' => true } @config = nil