Add historic for piece justificative

This commit is contained in:
Xavier J 2016-03-17 14:50:10 +01:00
parent 4b7e6426b3
commit bb79aca58a
14 changed files with 99 additions and 76 deletions

View file

@ -8,7 +8,7 @@
Historique des
%span#PJmodal_title
.modal-body
%table.table#cerfa
%table.table
%thead
%th
Utilisateur
@ -16,16 +16,28 @@
Date d'envoi
%th
Lien
-if @facade.procedure.cerfa_flag?
- if @facade.dossier.cerfa_available?
- @facade.cerfas_ordered.each do |cerfa|
%thead.tr_content#cerfa
-if @facade.procedure.cerfa_flag?
- if @facade.dossier.cerfa_available?
- @facade.cerfas_ordered.each do |cerfa|
%tr
%td.col-md-6.col-lg-4
= cerfa.dossier.user.email
%td.col-md-6.col-lg-4
= cerfa.created_at
%td.col-md-6.col-lg-4
=link_to 'Récupérer', cerfa.content_url, {target: :blank}
- @facade.dossier.types_de_piece_justificative.each do |type_de_piece_justificative|
%tbody.tr_content{id: "type_de_pj_#{type_de_piece_justificative.id}"}
- @facade.dossier.retrieve_all_piece_justificative_by_type(type_de_piece_justificative.id).each do |piece_justificative|
%tr
%td.col-md-6.col-lg-4
= cerfa.dossier.user.email
= piece_justificative.dossier.user.email
%td.col-md-6.col-lg-4
= cerfa.created_at
= piece_justificative.created_at
%td.col-md-6.col-lg-4
=link_to 'Récupérer', cerfa.content_url, {target: :blank}
=link_to 'Récupérer', piece_justificative.content_url, {target: :blank}
.modal-footer

View file

@ -18,22 +18,30 @@
"data-toggle" => "modal",
:type => "button",
"data-modal_title" => 'formulaires',
"data-modal_type" => 'cerfa'}
"data-modal_index" => 'cerfa'}
- else
= 'Pièce non fournie'
- @facade.dossier.pieces_justificatives.each do |piece_justificative|
%tr{ id: "piece_justificative_#{piece_justificative.type}" }
- @facade.dossier.types_de_piece_justificative.each do |type_de_piece_justificative|
%tr{ id: "piece_justificative_#{type_de_piece_justificative.id}" }
%th.col-lg-6
= piece_justificative.libelle
= type_de_piece_justificative.libelle
%td.col-lg-6.col-md-6
- if piece_justificative.api_entreprise
- if type_de_piece_justificative.api_entreprise
%span.text-success Nous l'avons récupéré pour vous.
- elsif !piece_justificative.empty?
- elsif !(@pj = @facade.dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id)).nil?
- if user_signed_in?
= 'Pièce fournie'
- elsif gestionnaire_signed_in?
%a{ href: "#{piece_justificative.content_url}", target: '_blank' } Consulter
%a{ href: "#{@pj.content_url}", target: '_blank' } Consulter
%span{style:'margin-left:12px'}
\-
%a.btn.glyphicon.glyphicon-time{style:'color: black; padding-top: 0',
"data-target" => "#PJmodal",
"data-toggle" => "modal",
:type => "button",
"data-modal_title" => type_de_piece_justificative.libelle,
"data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}"}
- else
= 'Pièce non fournie'

View file

@ -94,16 +94,16 @@
application/vnd.oasis.opendocument.presentation,
application/vnd.oasis.opendocument.spreadsheet", :max_file_size => 3.megabytes }
- @dossier.pieces_justificatives.each do |piece_justificative|
- @dossier.types_de_piece_justificative.each do |type_de_piece_justificative|
%tr
%th.col-lg-6
= piece_justificative.libelle
= type_de_piece_justificative.libelle
%td.col-lg-5
-if piece_justificative.api_entreprise
%span.text-success{ id: "piece_justificative_#{piece_justificative.type}" } Nous l'avons récupéré pour vous.
-if type_de_piece_justificative.api_entreprise
%span.text-success{ id: "piece_justificative_#{type_de_piece_justificative.id}" } Nous l'avons récupéré pour vous.
-else
-if piece_justificative.empty?
= file_field_tag "piece_justificative_#{piece_justificative.type}", accept: " application/pdf,
-if @dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id).nil?
= file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: " application/pdf,
application/msword,
application/vnd.openxmlformats-officedocument.wordprocessingml.document,
application/vnd.ms-excel,
@ -116,7 +116,7 @@
-else
%span.btn.btn-sm.btn-file.btn-success
Modifier
= file_field_tag "piece_justificative_#{piece_justificative.type}", accept: " application/pdf,
= file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: " application/pdf,
application/msword,
application/vnd.openxmlformats-officedocument.wordprocessingml.document,
application/vnd.ms-excel,