From 10bbc5f9efd849f66273f941f808995ab64003db Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 20 Sep 2017 16:16:44 +1000 Subject: [PATCH] Hide the menu on embedded group pages --- app/controllers/groups_controller.rb | 1 + app/helpers/application_helper.rb | 6 ++++++ app/views/layouts/darkswarm.html.haml | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 0a3b46b342..ce72038e70 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -7,6 +7,7 @@ class GroupsController < BaseController def show enable_embedded_shopfront + @hide_menu = true if @shopfront_layout == 'embedded' @group = EnterpriseGroup.find_by_permalink(params[:id]) || EnterpriseGroup.find(params[:id]) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a9abf266dc..bec9d181c9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -20,4 +20,10 @@ module ApplicationHelper super end end + + def body_classes + classes = [] + classes << "off-canvas" unless @hide_menu + classes << @shopfront_layout + end end diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index 5bd57ea8e6..c702848e89 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -22,7 +22,7 @@ = render "layouts/bugherd_script" = csrf_meta_tags - %body.off-canvas{class: @shopfront_layout, ng: {app: "Darkswarm"}} + %body{class: body_classes, ng: {app: "Darkswarm"}} / [if lte IE 8] = render partial: "shared/ie_warning" = javascript_include_tag "iehack" @@ -39,7 +39,7 @@ .off-canvas-wrap{offcanvas: true} .inner-wrap - = render "shared/menu/menu" + = render "shared/menu/menu" unless @hide_menu %section{ role: "main" } = yield