Merge branch 'develop' into staging

This commit is contained in:
Xavier J 2016-12-22 11:39:57 +01:00
commit 1541550de0
12 changed files with 42 additions and 82 deletions

View file

@ -1,6 +1,5 @@
.default_data_block {
font-family: Arial;
margin-top: 40px;
.show-block {
width: 840px;

View file

@ -41,8 +41,6 @@
.type_champ-header_section {
@extend .col-md-12;
@extend .col-lg-12;
margin-bottom: -25px;
}
.type_champ-address {

View file

@ -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

View file

@ -19,7 +19,12 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
def show
create_dossier_facade params[:id]
@champs = @facade.champs_private unless @facade.nil?
@champs_private = @facade.champs_private unless @facade.nil?
@headers_private = @champs_private.inject([]) do |acc, champ|
acc.push(champ) if champ.type_champ == 'header_section'
acc
end
end
def filter

View file

@ -26,6 +26,10 @@ class DossierFacades
@dossier.ordered_pieces_justificatives
end
def types_de_pieces_justificatives
@dossier.types_de_piece_justificative.order('order_place ASC')
end
def champ_id
@champ_id
end

View file

@ -1,4 +1,4 @@
.default_data_block
.default_data_block{style:'margin-top: 40px'}
.row.show-block#messages
%div.header
%div.col-lg-10.col-md-10.title
@ -100,16 +100,16 @@
= render partial: 'users/carte/init_carto', locals: {dossier: @facade.dossier}
- if @current_gestionnaire && gestionnaire_signed_in? && @champs.count > 0
.default_data_block
- if @current_gestionnaire && gestionnaire_signed_in? && @champs_private.count > 0
.default_data_block.default_visible
%div.row.show-block#private-fields
%div.header
%div.col-lg-10.col-md-10.title
%div.carret-right
%div.carret-down
= "champs".upcase
= "formulaire privé".upcase
%div.col-lg-2.col-md-2.count
- private_fields_count = @champs.count
- private_fields_count = @champs_private.count
= (private_fields_count == 1) ? "1 champ" : "#{private_fields_count} champs"
%div.body
= render partial: '/dossiers/infos_private_fields'

View file

@ -56,12 +56,13 @@
="#{@facade.dossier.user.given_name} #{@facade.dossier.user.family_name}"
=")"
%div.row
.col-lg-12.col-md-12
- if @facade.procedure.for_individual?
- if @facade.procedure.cerfa_flag? || @facade.dossier.types_de_piece_justificative.count > 0
.col-lg-12.col-md-12
.row.title-row
%div.col-md-4.col-lg-4.split-hr
%div.col-md-4.col-lg-4.dossier-title= t('utils.pieces').upcase
%div.col-md-4.col-lg-4.split-hr
.col-lg-12.col-md-12#pieces_justificatives.margin-bot-40
.row
- if @facade.procedure.cerfa_flag?
@ -80,7 +81,7 @@
= 'Pièce non fournie'
.row
.col-md-12.col-lg-12
- @facade.dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative|
- @facade.types_de_pieces_justificatives.each do |type_de_piece_justificative|
.row.piece-row
.col-md-12.col-lg-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" }
.row
@ -97,6 +98,7 @@
%span.fa.fa-clock-o
- else
= 'Pièce non fournie'
- unless @facade.dossier.read_only?
- if user_signed_in? && (@facade.dossier.owner?(current_user.email) || @facade.dossier.invite_by_user?(current_user.email))
- if @facade.procedure.cerfa_flag? || @facade.dossier.types_de_piece_justificative.size > 0

View file

@ -1,12 +1,6 @@
.row
.row{style: 'margin-top: -20px'}
.col-md-12.col-lg-12
- if @champs.nil? || @champs.empty?
%h4.text-primary.center
Pas de champ privé pour ce dossier
- else
= form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do
= render partial: '/users/description/champs', locals:{private: true}
.row
.col-md-4.col-lg-4
.col-md-4.col-lg-4= submit_tag :Enregistrer, {class: 'btn-action'}
.col-md-4.col-lg-4
= form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do
= render partial: '/users/description/champs', locals:{private: true}
.row.center
= submit_tag :Enregistrer, {class: 'btn-action'}

View file

@ -1,5 +1,10 @@
- render_partial_url = private ? 'users/description/champs/header_private_section' : 'users/description/champs/header_section'
- @champs = @champs_private if private
- @headers = @headers_private if private
- 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}"}

View file

@ -16,9 +16,8 @@
-#TODO use form_for
= form_tag(url_for({controller: 'users/description', action: :create, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST', multipart: true) do
#liste_champs
-unless @champs.nil?
-unless @champs.nil?
#liste_champs
=render partial: 'users/description/champs', locals:{private: false}
-if !@procedure.lien_demarche.blank? || @procedure.cerfa_flag || @dossier.types_de_piece_justificative.size > 0

View file

@ -1,4 +1,6 @@
.row
.col-lg-2.col-md-2
.col-lg-8.col-md-8
.col-lg-12.col-md-12
%br
%h3.text-info
=libelle
= render partial: 'users/description/champs/render_list_champs', locals: {champs: champs, order_place: order_place}

View file

@ -6,57 +6,4 @@
%div.carret-down
=libelle
%div.body
-champs.each do |champ|
- if champ.order_place > order_place
- if champ.type_champ == 'header_section'
- break
- unless champ.type_champ == 'checkbox' || champ.type_champ == 'engagement'
%h4
= champ.libelle
- if champ.mandatory?
= '*'
-if champ.type_champ == 'textarea'
=render partial: 'users/description/champs/textarea', locals: {champ: champ}
-elsif champ.type_champ == 'checkbox'
= render partial: 'users/description/champs/checkbox', locals: {champ: champ}
-elsif champ.type_champ == 'civilite'
=render partial: 'users/description/champs/civilite', locals: {champ: champ}
- elsif champ.type_champ == 'datetime'
=render partial: 'users/description/champs/datetime', locals: {champ: champ}
- elsif champ.type_champ == 'yes_no'
=render partial: 'users/description/champs/yes_no', locals: {champ: champ}
- elsif champ.type_champ == 'drop_down_list'
=render partial: 'users/description/champs/drop_down_list', locals: {champ: champ}
- elsif champ.type_champ == 'pays'
=render partial: 'users/description/champs/pays', locals: {champ: champ}
- elsif champ.type_champ == 'regions'
=render partial: 'users/description/champs/regions', locals: {champ: champ}
- elsif champ.type_champ == 'engagement'
=render partial: 'users/description/champs/engagement', locals: {champ: champ}
- elsif champ.type_champ == 'departements'
=render partial: 'users/description/champs/departements', locals: {champ: champ}
-else
%input.form-control{name:"champs['#{champ.id}']",
placeholder: champ.libelle,
id: "champs_#{champ.id}",
value: champ.value,
type: champ.type_champ,
'data-provide' => champ.data_provide,
'data-date-format' => champ.data_date_format}
- unless champ.description.empty? || champ.type_champ == 'engagement'
.row
.col-lg-8.col-md-8{class: 'description_div', id:"description_champs_#{champ.id}"}
= champ.description
= render partial: 'users/description/champs/render_list_champs', locals: {champs: champs, order_place: order_place}