From 727c263f726578c891d4a1d80ec7d5c56158cb3e Mon Sep 17 00:00:00 2001 From: Xavier J Date: Thu, 22 Dec 2016 10:36:18 +0100 Subject: [PATCH] =?UTF-8?q?-=20Fix=20bug=20pr=C3=A9visualisation=20header?= =?UTF-8?q?=20-=20Fix=20bug=20header=20section=20visualization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin/previsualisations_controller.rb | 5 +++++ app/views/users/description/_champs.html.haml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/controllers/admin/previsualisations_controller.rb b/app/controllers/admin/previsualisations_controller.rb index a5c873e7f..257de657b 100644 --- a/app/controllers/admin/previsualisations_controller.rb +++ b/app/controllers/admin/previsualisations_controller.rb @@ -9,5 +9,10 @@ class Admin::PrevisualisationsController < AdminController @dossier.build_default_champs @champs = @dossier.ordered_champs + + @headers = @champs.inject([]) do |acc, champ| + acc.push(champ) if champ.type_champ == 'header_section' + acc + end end end \ No newline at end of file diff --git a/app/views/users/description/_champs.html.haml b/app/views/users/description/_champs.html.haml index ed89b3b3c..c8ea6df55 100644 --- a/app/views/users/description/_champs.html.haml +++ b/app/views/users/description/_champs.html.haml @@ -1,5 +1,7 @@ - render_partial_url = private ? 'users/description/champs/header_private_section' : 'users/description/champs/header_section' - unless @headers.blank? + - if @champs.first.type_champ != 'header_section' + =render partial: render_partial_url, locals: {libelle: 'Dossier', order_place: -1, champs: @champs} - @headers.each do |header| .row %div{class: "type_champ-#{header.type_champ}"}