Skip to content

Commit

Permalink
Split the "content" partial based on layout used.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpovolny committed Jan 9, 2017
1 parent f23f5c4 commit 6232f5f
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 75 deletions.
12 changes: 12 additions & 0 deletions app/views/layouts/_center_div_dashboard_no_listnav.html.haml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions app/views/layouts/_center_div_no_listnav.html.haml
Original file line number Diff line number Diff line change
@@ -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'})
38 changes: 38 additions & 0 deletions app/views/layouts/_center_div_with_listnav.html.haml
Original file line number Diff line number Diff line change
@@ -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"

78 changes: 3 additions & 75 deletions app/views/layouts/_content.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6232f5f

Please sign in to comment.