From 1b84c07111efef819714111a0b56e5ecb942c2fa Mon Sep 17 00:00:00 2001 From: gamecat2d Date: Sat, 22 May 2021 12:14:14 +0200 Subject: [PATCH] add the condition --- app/controllers/asks_controller.rb | 6 +++++- app/controllers/offers_controller.rb | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/asks_controller.rb b/app/controllers/asks_controller.rb index c6ba0cfd..c4ab5e44 100644 --- a/app/controllers/asks_controller.rb +++ b/app/controllers/asks_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class AsksController < PublicController - layout 'without_navbar', only: %i[new create] + layout :determine_layout, only: %i[new create] def index redirect_to contributions_path @@ -47,4 +47,8 @@ def render_form(submission) render :new end + + def determine_layout + 'without_navbar' unless context.system_settings.display_navbar? + end end diff --git a/app/controllers/offers_controller.rb b/app/controllers/offers_controller.rb index 808def61..434fff9b 100644 --- a/app/controllers/offers_controller.rb +++ b/app/controllers/offers_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class OffersController < PublicController - layout 'without_navbar', only: %i[new create] + layout :determine_layout, only: %i[new create] def index redirect_to contributions_path @@ -47,4 +47,8 @@ def render_form(submission) render :new end + + def determine_layout + 'without_navbar' unless context.system_settings.display_navbar? + end end