Nouvelle organisation de la page récapitulatif

This commit is contained in:
Xavier J 2015-09-24 10:17:59 +02:00
parent 888ac8b336
commit a9109f8b2b
15 changed files with 242 additions and 149 deletions

View file

@ -13,35 +13,7 @@
%br
.content.row
#map_qp.col-lg-6.col-md-6{style: 'height:500px'}
#pieces_justificatives.col-lg-6.col-md-6
%h3.text-info Liste des pièces justificatives
%br
%table.table
-if @procedure.lien_demarche != nil
%tr{id: "piece_justificative_0"}
%th{class:'col-lg-6'}
='CERFA'
%td.col-lg-4.col-md-4
- if !@dossier.cerfa.empty?
%a{ href: "#{@dossier.cerfa.content}", target: '_blank' } Consulter
- else
= 'Pièce non fournie'
- @dossier.pieces_justificatives.each do |piece_justificative|
%tr{ id: "piece_justificative_#{piece_justificative.type}" }
%th.col-lg-6
= piece_justificative.libelle
%td.col-lg-4.col-md-4
- if piece_justificative.api_entreprise
%a{ href: '' } Récupérer
- elsif !piece_justificative.empty?
%a{ href: "#{piece_justificative.content}", target: '_blank' } Consulter
- else
= 'Pièce non fournie'
= render partial: '/carte/carte_sources_CSS'
= render partial: '/carte/carte_sources_JS_backend'
=render partial: '/dossiers/pieces_justificatives'
%br
= render partial: '/recapitulatif/commentaires_flux'

View file

@ -1,9 +1,30 @@
= javascript_include_tag "https://code.highcharts.com/highcharts.js", "chartkick"
.row#infos_dossier
.col-md-6
%h4.text-info
= @dossier.nom_projet
%div
#infos_dossier
%div.row
.col-lg-6.col-md-6
%h3.text-info
= @dossier.nom_projet
%br
%div.row
.col-lg-6.col-md-6
%h4 Montant total
%p{style:'margin-left:5%'}
=number_to_currency(@dossier.montant_projet.to_f, :unit => " ", :separator => ",", :delimiter => " ")
!='€'
.col-lg-6.col-md-6
%h4 Début du projet souhaité
%p{style:'margin-left:5%'}
= @dossier.date_fr
%div.row
.col-lg-6.col-md-6
%h4 Montant souhaité
%p{style:'margin-left:5%'}
=number_to_currency(@dossier.montant_aide_demande.to_f, :unit => " ", :separator => ",", :delimiter => " ")
!='€'
%br
.description
- begin
- @dossier.description.split(/(?:\n\r?|\r\n?')/).each do |line|
@ -11,28 +32,11 @@
%br
- rescue
=''
%br
.col-lg-6.col-md-6
%h4 Montant total
%p
=number_to_currency(@dossier.montant_projet.to_f, :unit => " ", :separator => ",", :delimiter => " ")
!='€'
.col-lg-6.col-md-6
%h4 Début du projet souhaité
%p
= @dossier.date_fr
/ -if !request.url.include?('admin')
- unless gestionnaire_signed_in?
.col-lg-6.col-md-6
%br
%br
%a#modif_description{href: "/dossiers/#{@dossier.id}/description?back_url=recapitulatif"} Modifier la description
.col-md-6
= pie_chart({"Montant à charge #{(100 - @dossier.montant_aide_demande.to_f/@dossier.montant_projet.to_f*100).round(2)}%" => (@dossier.montant_projet.to_f - @dossier.montant_aide_demande.to_f), "Montant souhaité #{(@dossier.montant_aide_demande.to_f/@dossier.montant_projet.to_f*100).round(2)}%" => @dossier.montant_aide_demande})
.col-lg-6.col-md-6
=render partial: '/dossiers/pieces_justificatives'
-#= pie_chart({"Montant à charge #{(100 - @dossier.montant_aide_demande.to_f/@dossier.montant_projet.to_f*100).round(2)}%" => (@dossier.montant_projet.to_f - @dossier.montant_aide_demande.to_f), "Montant souhaité #{(@dossier.montant_aide_demande.to_f/@dossier.montant_projet.to_f*100).round(2)}%" => @dossier.montant_aide_demande})
%div.row{style: 'text-align:right'}
%a#maj_infos.btn.btn-info{href: "/dossiers/#{@dossier.id}/description?back_url=recapitulatif"}
= 'Editer mon dossier'

View file

@ -0,0 +1,30 @@
#pieces_justificatives
%h3.text-info Liste des pièces justificatives
%br
%table.table
-if @procedure.lien_demarche != nil
%tr{id: "piece_justificative_0"}
%th{class:'col-lg-6'}
='CERFA'
-if @procedure.lien_demarche != nil
%a{style:'font-size:0.9em; padding-left:3px', id: 'lien_cerfa' ,href: "#{@procedure.lien_demarche}", :target => '_blank'} Lien CERFA
%td.col-lg-6.col-md-6
- if !@dossier.cerfa.empty?
- if user_signed_in?
= 'Pièce fournie'
- elsif gestionnaire_signed_in?
%a{ href: "#{@dossier.cerfa.content}", target: '_blank' } Consulter
- else
= 'Pièce non fournie'
- @dossier.pieces_justificatives.each do |piece_justificative|
%tr{ id: "piece_justificative_#{piece_justificative.type}" }
%th.col-lg-6
= piece_justificative.libelle
%td.col-lg-6.col-md-6
- if piece_justificative.api_entreprise
%span.text-success Nous l'avons récupéré pour vous.
- elsif !piece_justificative.empty?
%a{ href: "#{piece_justificative.content}", target: '_blank' } Consulter
- else
= 'Pièce non fournie'

View file

@ -1,24 +1,18 @@
.content#commentaires_flux
%h3 Commentaires
%div{style: 'margin-left:3%; width:80%'}
-@commentaires.each do |com|
%span.text-info#email_contact{style: 'font-weight:bold'}
=com.email
%span#created_at
\-
=com.created_at_fr
%br
.description#body
=com.body
%br
%h4{style: 'margin-bottom:2%'} Nouveau
.content#commentaires_flux{style:'width:100%;'}
%div#commentaire_new{style: 'width:80%; margin-left:auto; margin-right:auto'}
= form_tag(url_for({ controller: :commentaires, action: :create, dossier_id: @dossier.id }), class: 'form-inline', method: 'POST') do
%input.form-control{:type => 'text', style: 'width: 30%; margin-bottom:2%', :id => 'email_commentaire', :name => 'email_commentaire', :value => @commentaire_email}
%textarea.form-control{:id => 'texte_commentaire', :name => 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', maxlength: '255'}
%br
%input.form-control.btn.btn-success{:type => 'submit', :value => 'Poster', style: 'float:right'}
%br
%br
%br
%textarea.form-control{id: 'texte_commentaire', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', maxlength: '255', placeholder:"Dialoguer avec votre interlocuteur privilégié en charge de votre dossier."}
%input.form-control.btn.btn-primary{:type => 'submit', :value => 'Poster', style: 'float:right'}
%br
%br
-@commentaires.each do |com|
%span.text-info#email_contact{style: 'font-weight:bold'}
=com.email
%span#created_at
\-
=com.created_at_fr
%br
.description#body
=com.body
%br

View file

@ -1,24 +1,25 @@
%h2
='Récapitulatif'
%div.row
%div.col-md-2.col-lg-2
%h2
='Récapitulatif'
%div.col-md-8.col-lg-8
%div.col-md-2.col-lg-2
%h2#dossier_id{:class => 'text-info', :style => 'text-align:right; margin-bottom:15px'}
= "Dossier n°#{@dossier.id}"
-#%h3{:class => 'text-success', :style => 'text-align:right'}
-# = @dossier.state_fr
- unless gestionnaire_signed_in?
%button#action_button.btn.btn-success
= 'Soumettre mon dossier'
%div{style: 'text-align:center'}
-if request.referer != nil
-if (request.referer.include?'/description') && !(request.referer.include?'back_url=recapitulatif')
%h4.text-success Félicitation, votre demande a bien été enregistrée.
-if (request.referer != nil) && (request.referer.include?'/description') && !(request.referer.include?'back_url=recapitulatif')
%h3.text-success Félicitation, votre demande a bien été enregistrée.
%h3{style: 'text-align:center; line-height:1.5em'}
='Votre dossier est le '
%br
%span{id: 'dossier_id', style: 'font-weight:bold;', class: 'text-success'}
="n°#{@dossier.id}"
-else
%h2#dossier_id{:class => 'text-info', :style => 'text-align:right'}
= "Dossier n°#{@dossier.id}"
-else
%h2#dossier_id{:class => 'text-info', :style => 'text-align:right'}
= "Dossier n°#{@dossier.id}"
%br
= render partial: '/dossiers/infos_dossier'
%br
= render partial: 'commentaires_flux'