From 6232f5fcde454f63822788cecb26ab00d44c62a5 Mon Sep 17 00:00:00 2001 From: Martin Povolny Date: Fri, 6 Jan 2017 15:55:27 +0100 Subject: [PATCH] Split the "content" partial based on layout used. --- ..._center_div_dashboard_no_listnav.html.haml | 12 +++ .../layouts/_center_div_no_listnav.html.haml | 25 ++++++ .../_center_div_with_listnav.html.haml | 38 +++++++++ app/views/layouts/_content.html.haml | 78 +------------------ 4 files changed, 78 insertions(+), 75 deletions(-) create mode 100644 app/views/layouts/_center_div_dashboard_no_listnav.html.haml create mode 100644 app/views/layouts/_center_div_no_listnav.html.haml create mode 100644 app/views/layouts/_center_div_with_listnav.html.haml diff --git a/app/views/layouts/_center_div_dashboard_no_listnav.html.haml b/app/views/layouts/_center_div_dashboard_no_listnav.html.haml new file mode 100644 index 00000000000..959289611c3 --- /dev/null +++ b/app/views/layouts/_center_div_dashboard_no_listnav.html.haml @@ -0,0 +1,12 @@ += render :partial => "layouts/vertical_navbar" +.container-fluid.container-cards-pf.container-pf-nav-pf-vertical.container-pf-nav-pf-vertical-with-sub-menus{:style => "overflow: hidden; height: 100%;"} + .row.toolbar-pf#toolbar + .col-md-12 + - if @widgets_menu + = render :partial => "layouts/angular/toolbar" + .row#main-content + .col-md-12 + .spacer + = render :partial => 'layouts/tabs' + .col-md-12 + = yield diff --git a/app/views/layouts/_center_div_no_listnav.html.haml b/app/views/layouts/_center_div_no_listnav.html.haml new file mode 100644 index 00000000000..78d5e3091bf --- /dev/null +++ b/app/views/layouts/_center_div_no_listnav.html.haml @@ -0,0 +1,25 @@ += render :partial => "layouts/vertical_navbar" +.container-fluid.container-pf-nav-pf-vertical.container-pf-nav-pf-vertical-with-sub-menus{:style => "overflow: hidden !important; height: 100%;"} + .row.max-height + .col-md-12.max-height + - if !@in_a_form && taskbar_in_header? + .row.toolbar-pf#toolbar + .col-md-12 + = render :partial => "layouts/angular/toolbar" + .row#main-content + .col-md-12 + = render :partial => "layouts/breadcrumbs" + - if layout_uses_tabs? + .col-md-12 + = render :partial => 'layouts/tabs' + .col-md-12 + = yield + - if layout_uses_paging? && !@in_a_form + .col-md-12.no-padding + .row.toolbar-pf#paging_div + = render(:partial => 'layouts/pagingcontrols', + :locals => {:pages => @pages, + :action_url => action_url_for_views, + :db => @view.try(:db), + :headers => @view.try(:headers), + :button_div => 'center_tb'}) diff --git a/app/views/layouts/_center_div_with_listnav.html.haml b/app/views/layouts/_center_div_with_listnav.html.haml new file mode 100644 index 00000000000..4f918e51abb --- /dev/null +++ b/app/views/layouts/_center_div_with_listnav.html.haml @@ -0,0 +1,38 @@ += render :partial => "layouts/vertical_navbar" +.container-fluid.container-pf-nav-pf-vertical.container-pf-nav-pf-vertical-with-sub-menus.max-height{:style => "overflow: hidden !important"} + - if !@in_a_form && taskbar_in_header? + .row.toolbar-pf#toolbar.miq-toolbar-menu + .col-md-12 + .toolbar-pf-actions + - if @layout == "dashboard" + = render :partial => "/layouts/tabs" + = render :partial => "layouts/angular/toolbar" + .row.max-height + .col-sm-10.col-md-9.col-sm-push-2.col-md-push-3.max-height + #main-content.row + .col-md-12 + .row + .col-md-7 + = render :partial => "layouts/breadcrumbs" + - if layout_uses_tabs? + = render :partial => 'layouts/tabs' + .col-md-5 + %br + = render :partial => 'layouts/searchbar' + .row + .col-md-12 + = yield + - unless @in_a_form + .col-md-12.no-padding + .row.toolbar-pf#paging_div + = render(:partial => 'layouts/pagingcontrols', + :locals => {:pages => @pages, + :action_url => action_url_for_views, + :db => @view.try(:db), + :headers => @view.try(:headers), + :button_div => 'center_tb'}) + + .col-sm-2.col-md-3.col-sm-pull-10.col-md-pull-9.sidebar-pf.sidebar-pf-left.max-height + -# listnav_div + = render :partial => "layouts/listnav" + diff --git a/app/views/layouts/_content.html.haml b/app/views/layouts/_content.html.haml index c177b0c50c6..5675af23312 100644 --- a/app/views/layouts/_content.html.haml +++ b/app/views/layouts/_content.html.haml @@ -72,83 +72,11 @@ - else #center_div{:style => "height: 100%;"} - if layout_uses_listnav? - = render :partial => "layouts/vertical_navbar" - .container-fluid.container-pf-nav-pf-vertical.container-pf-nav-pf-vertical-with-sub-menus.max-height{:style => "overflow: hidden !important"} - - if !@in_a_form && taskbar_in_header? - .row.toolbar-pf#toolbar.miq-toolbar-menu - .col-md-12 - .toolbar-pf-actions - - if @layout == "dashboard" - = render :partial => "/layouts/tabs" - = render :partial => "layouts/angular/toolbar" - .row.max-height - .col-sm-10.col-md-9.col-sm-push-2.col-md-push-3.max-height - #main-content.row - .col-md-12 - .row - .col-md-7 - = render :partial => "layouts/breadcrumbs" - - if layout_uses_tabs? - = render :partial => 'layouts/tabs' - .col-md-5 - %br - = render :partial => 'layouts/searchbar' - .row - .col-md-12 - = yield - - unless @in_a_form - .col-md-12.no-padding - .row.toolbar-pf#paging_div - = render(:partial => 'layouts/pagingcontrols', - :locals => {:pages => @pages, - :action_url => action_url_for_views, - :db => @view.try(:db), - :headers => @view.try(:headers), - :button_div => 'center_tb'}) - - .col-sm-2.col-md-3.col-sm-pull-10.col-md-pull-9.sidebar-pf.sidebar-pf-left.max-height - = render :partial => "layouts/listnav" - + = render :partial => "layouts/center_div_with_listnav" - elsif dashboard_no_listnav? - = render :partial => "layouts/vertical_navbar" - .container-fluid.container-cards-pf.container-pf-nav-pf-vertical.container-pf-nav-pf-vertical-with-sub-menus{:style => "overflow: hidden; height: 100%;"} - .row.toolbar-pf#toolbar - .col-md-12 - - if @widgets_menu - = render :partial => "layouts/angular/toolbar" - .row#main-content - .col-md-12 - .spacer - = render :partial => 'layouts/tabs' - .col-md-12 - = yield - + = render :partial => "layouts/center_div_dashboard_no_listnav" - else - = render :partial => "layouts/vertical_navbar" - .container-fluid.container-pf-nav-pf-vertical.container-pf-nav-pf-vertical-with-sub-menus{:style => "overflow: hidden !important; height: 100%;"} - .row.max-height - .col-md-12.max-height - - if !@in_a_form && taskbar_in_header? - .row.toolbar-pf#toolbar - .col-md-12 - = render :partial => "layouts/angular/toolbar" - .row#main-content - .col-md-12 - = render :partial => "layouts/breadcrumbs" - - if layout_uses_tabs? - .col-md-12 - = render :partial => 'layouts/tabs' - .col-md-12 - = yield - - if layout_uses_paging? && !@in_a_form - .col-md-12.no-padding - .row.toolbar-pf#paging_div - = render(:partial => 'layouts/pagingcontrols', - :locals => {:pages => @pages, - :action_url => action_url_for_views, - :db => @view.try(:db), - :headers => @view.try(:headers), - :button_div => 'center_tb'}) + = render :partial => "layouts/center_div_no_listnav" - if show_advanced_search? :javascript