diff --git a/app/assets/stylesheets/dossiers.scss b/app/assets/stylesheets/dossiers.scss index 34cf65813..bbc1ae5d4 100644 --- a/app/assets/stylesheets/dossiers.scss +++ b/app/assets/stylesheets/dossiers.scss @@ -63,6 +63,6 @@ h5 span { .split-hr-left { border-bottom: 1px solid #FFFFFF; - margin: 20px 10px 20px 0; + margin: 20px 10px 0px 0; } diff --git a/app/assets/stylesheets/navbar.scss b/app/assets/stylesheets/navbar.scss index 5332a69fc..4717d1d0e 100644 --- a/app/assets/stylesheets/navbar.scss +++ b/app/assets/stylesheets/navbar.scss @@ -18,10 +18,11 @@ } #home { text-align: center; - padding: 10px; + box-shadow: 0 1px 2px 0 rgba(0,0,0,0.5); background-color: #003189; + height: 60px; .logo { - width: 118px; + margin-top: 10px; height: 40px; } #tps-title { @@ -29,13 +30,13 @@ font-size: 24px; font-weight: bold; line-height: 28px; - padding: 5px 0 0 20px; + margin-top: 17px; } } #navbar-body { height: 60px; background-color: #FFFFFF; - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.5); + box-shadow: 0 1px 2px 0 rgba(50,50,50,0.5); padding-left: 50px; .main-info { font-family: Arial; diff --git a/app/assets/stylesheets/search.scss b/app/assets/stylesheets/search.scss index cf9c94427..acfb899b9 100644 --- a/app/assets/stylesheets/search.scss +++ b/app/assets/stylesheets/search.scss @@ -1,5 +1,5 @@ #search-block{ - margin: 5px 5px 0 0; + margin: 11px 5px 0 0; height: 50px; } diff --git a/app/services/render_partial_service.rb b/app/services/render_partial_service.rb index b8c0b1f84..efb5ed2ab 100644 --- a/app/services/render_partial_service.rb +++ b/app/services/render_partial_service.rb @@ -15,6 +15,12 @@ class RenderPartialService retrieve_left_panel end + def self.left_panel_exist? left_panel_url + file = left_panel_url.split('/').last + + File.exist?(Rails.root.join('app','views', 'layouts', 'left_panels', '_'+file+'.html.haml')) + end + private def retrieve_navbar diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml index e75d00d4f..8b079a747 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -1,5 +1,5 @@ %div#footer - %p{class: "copyright col-md-push-2 col-md-10 col-lg-push-2 col-lg-10 text-muted small"} + %p{class: "copyright col-md-push-#{12-main_container_size} col-md-#{main_container_size} col-lg-push-#{12-main_container_size} col-lg-#{main_container_size} text-muted small"} =link_to 'SGMAP', "http://etatplateforme.modernisation.gouv.fr" 2016 diff --git a/app/views/layouts/_main_container.html.haml b/app/views/layouts/_main_container.html.haml new file mode 100644 index 000000000..423e27e00 --- /dev/null +++ b/app/views/layouts/_main_container.html.haml @@ -0,0 +1,6 @@ +%div#main-container{class: "col-lg-#{main_container_size} col-md-#{main_container_size}"} + %div.row + = render partial: 'layouts/flash_messages' + %div.row + = yield + %div.row \ No newline at end of file diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml index 2a9dca73c..415f6bbda 100644 --- a/app/views/layouts/_navbar.html.haml +++ b/app/views/layouts/_navbar.html.haml @@ -1,9 +1,9 @@ -%div.col-lg-2.col-md-2.no-padding +%div.col-lg-2.col-md-2 %a#title_navbar{href: '/'} %div.row#home - %div.col-lg-6 + %div.col-lg-6.no-padding = image_tag('marianne_small.png', class: 'logo') - %div.col-lg-6#tps-title + %div.col-lg-6.no-padding#tps-title TPS %div.col-lg-10.col-md-10.no-padding diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7d14bd616..fa2a2f755 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -31,22 +31,21 @@ %div#header.navbar = render partial: "layouts/navbar" %div.row.no-margin - %div.col-lg-2.col-md-2#left-pannel - - if gestionnaire_signed_in? - #search-block - = render partial: 'layouts/left_panels/search_area' - - begin + - if RenderPartialService.left_panel_exist? @left_pannel_url + %div.col-lg-2.col-md-2#left-pannel + - if gestionnaire_signed_in? + #search-block + = render partial: 'layouts/left_panels/search_area' + = render partial: @left_pannel_url - -rescue - = render partial: 'layouts/left_panels/left_panel_default' - %div.col-lg-10.col-md-10#main-container - %div.row - = render partial: 'layouts/flash_messages' - %div.row - = yield - %div.row + - main_container_size = 10 + - else + - main_container_size = 12 + + =render partial: 'layouts/main_container', locals: {main_container_size: main_container_size} #mask_search %h1 %i.fa.fa-times{style:'position: fixed; top: 10; right: 30; color: white;'} - = render partial: 'layouts/footer' + + = render partial: 'layouts/footer', locals: {main_container_size: main_container_size} = render partial: 'layouts/google_analytics' diff --git a/spec/services/render_partial_service_spec.rb b/spec/services/render_partial_service_spec.rb index 17d81697e..055847c0c 100644 --- a/spec/services/render_partial_service_spec.rb +++ b/spec/services/render_partial_service_spec.rb @@ -16,4 +16,8 @@ describe RenderPartialService do it { is_expected.to eq 'layouts/left_panel/_left_panel_'+controller.to_s.parameterize + '_' + method.to_s } end + + describe 'left_panel_exist?' do + pending + end end