From 9f9e8ca176cac5223b6d85eb86ff3fd981e650e7 Mon Sep 17 00:00:00 2001 From: Xavier J Date: Tue, 8 Dec 2015 11:32:29 +0100 Subject: [PATCH] Fix bug : QP not appears on mini carte in infos_dossier page --- app/assets/stylesheets/carte.scss | 39 +++++++++++---------- app/decorators/dossier_decorator.rb | 4 +++ app/views/dossiers/_infos_dossier.html.haml | 4 ++- app/views/users/carte/show.html.haml | 2 +- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/app/assets/stylesheets/carte.scss b/app/assets/stylesheets/carte.scss index f34792c9c..1175313f9 100644 --- a/app/assets/stylesheets/carte.scss +++ b/app/assets/stylesheets/carte.scss @@ -7,16 +7,25 @@ table { font-size: 13px; } -#map{ - @extend .col-md-12; - @extend .col-lg-12; +#carte_page { + #map { + @extend .col-md-12; + @extend .col-lg-12; - height:600px; + height: 600px; + } + + #map.qp { + @extend .col-md-9; + @extend .col-lg-9; + } } -#map.qp { - @extend .col-md-9; - @extend .col-lg-9; +#infos_dossier { + #map.mini { + height: 300px; + width: 100%; + } } #qp_list { @@ -24,19 +33,14 @@ table { @extend .col-lg-3; h3 { - margin-top:0px; + margin-top: 0px; } ul li { - margin-bottom:10px; + margin-bottom: 10px; } } -#map.mini{ - height:300px; - width:100%; -} - #map section.overlay { position: absolute; top: 0; @@ -107,16 +111,15 @@ table { pointer-events: none; } - - .info { padding: 6px 8px; font: 14px/16px Arial, Helvetica, sans-serif; background: white; - background: rgba(255,255,255,0.8); - box-shadow: 0 0 15px rgba(0,0,0,0.2); + background: rgba(255, 255, 255, 0.8); + box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); border-radius: 5px; } + .info h4 { margin: 0 0 5px; color: #777; diff --git a/app/decorators/dossier_decorator.rb b/app/decorators/dossier_decorator.rb index 7e9fb8e20..53fd8a718 100644 --- a/app/decorators/dossier_decorator.rb +++ b/app/decorators/dossier_decorator.rb @@ -16,6 +16,10 @@ class DossierDecorator < Draper::Decorator DossierDecorator.case_state_fr state end + def class_qp_active + 'qp' if procedure.module_api_carto.quartiers_prioritaires + end + def state_color_class return 'text-danger' if waiting_for_gestionnaire? return 'text-info' if waiting_for_user? diff --git a/app/views/dossiers/_infos_dossier.html.haml b/app/views/dossiers/_infos_dossier.html.haml index 93b0f7b4b..f04b5ac11 100644 --- a/app/views/dossiers/_infos_dossier.html.haml +++ b/app/views/dossiers/_infos_dossier.html.haml @@ -14,7 +14,9 @@ ='' - if @dossier.procedure.module_api_carto.use_api_carto .col-lg-6.col-md-6 - #map.mini + + #map.mini{class: @dossier.class_qp_active} + %input{id: 'json_latlngs', type:'hidden', value: "#{@dossier.json_latlngs}"} %input{id: 'quartier_prioritaires', type:'hidden', value: "#{@dossier.quartier_prioritaires.to_json}"} %script{type: 'text/javascript'} diff --git a/app/views/users/carte/show.html.haml b/app/views/users/carte/show.html.haml index f68a588b4..74e2cfabd 100644 --- a/app/views/users/carte/show.html.haml +++ b/app/views/users/carte/show.html.haml @@ -11,7 +11,7 @@ %br %br - .row + #carte_page.row - if @dossier.procedure.module_api_carto.quartiers_prioritaires #map.qp #qp_list