Allow accompagnateurs to print a Dossier

This commit is contained in:
gregoirenovel 2017-10-05 23:27:02 +02:00
parent 38c226a659
commit 316d8e09b5
12 changed files with 169 additions and 1 deletions

View file

@ -0,0 +1,18 @@
%html
%head
%meta{ "http-equiv": "Content-Type", content: "text/html; charset=UTF-8" }
%meta{ "http-equiv": "X-UA-Compatible", content: "IE=edge" }
%meta{ name: "viewport", content: "width=device-width, initial-scale=1" }
= csrf_meta_tags
%title
= t("dynamics.page_title")
= favicon_link_tag(image_url("favicons/16x16.png"), type: "image/png", sizes: "16x16")
= favicon_link_tag(image_url("favicons/32x32.png"), type: "image/png", sizes: "32x32")
= favicon_link_tag(image_url("favicons/96x96.png"), type: "image/png", sizes: "96x96")
= stylesheet_link_tag "new_design/print", media: "all"
%body
= yield

View file

@ -7,6 +7,8 @@
%li
= "Dossier nº #{dossier.id}"
%div
= link_to print_dossier_path(dossier.procedure, dossier), target: "_blank", class: "button icon-only" do
%i.printer>
= render partial: "new_gestionnaire/procedures/dossier_actions", locals: { procedure: dossier.procedure, dossier: dossier, dossier_is_followed: current_gestionnaire&.follow?(dossier) }
= render partial: "state_button", locals: { dossier: dossier }
%ul.tabs

View file

@ -0,0 +1,106 @@
%h1= "Dossier nº #{@dossier.id}"
%h1.subtitle= "Procédure : #{@dossier.procedure.libelle}"
%h2 Identité du demandeur
- if @dossier.entreprise.present?
= render partial: "identite_entreprise", locals: { entreprise: @dossier.entreprise }
- if @dossier.individual.present?
= render partial: "identite_individual", locals: { individual: @dossier.individual }
%h2 Formulaire
- champs = @dossier.ordered_champs.decorate
- if champs.any?
= render partial: "champs", locals: { champs: champs }
- if @dossier.procedure.use_api_carto
%h3 Cartographie
- if @dossier.quartier_prioritaires.any?
%h4 Quartiers prioritaires
%table
- @dossier.quartier_prioritaires.each do |q|
%tr
%td= q.nom
- if @dossier.cadastres.any?
%h4 Parcelles cadastrales
%table
- @dossier.cadastres.each do |p|
%tr
%td= "Parcelle n° #{p.numero} - Feuille #{p.code_arr} #{p.section} #{p.feuille}"
- if @dossier.procedure.cerfa_flag? || @dossier.types_de_piece_justificative.any?
%h3 Pièces jointes
%table
- if @dossier.procedure.cerfa_flag?
%tr
%th Formulaire :
%td
- if @dossier.cerfa_available?
Pièce fournie
- else
Pièce non fournie
- @dossier.procedure.types_de_piece_justificative.each do |type_de_piece_justificative|
%tr
%th= "#{type_de_piece_justificative.libelle} :"
%td
- pj = @dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id)
- if pj.present?
Pièce fournie
- else
Pièce non fournie
%h2 Annotations privées
- if @dossier.ordered_champs_private.present?
%table
- @dossier.champs_private.each do |champ|
%tr
%th
= champ.libelle
%td
= champ.value
- else
Aucune annotation privée
%h2 Avis
- if @dossier.avis.present?
%table
- @dossier.avis.each do |avis|
%tr
%th
= "Avis de #{avis.email_to_display}"
- if avis.confidentiel?
(confidentiel)
%td
- if avis.answer.present?
= avis.answer
- else
En attente de réponse
- else
Aucun avis
%h2 Messagerie
%table
- @dossier.commentaires.each do |commentaire|
%tr
%th
= render partial: 'commentaire_issuer', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
- if ![current_gestionnaire.email, @dossier.user.email, 'contact@tps.apientreprise.fr'].include?(commentaire.email)
(invité)
%br
= I18n.l(commentaire.created_at.localtime, format: 'le %d/%m/%Y à %H:%M')
%td
%p= sanitize(commentaire.body)
- if file = commentaire.piece_justificative
%br
= file.original_filename
%script{ type: "text/javascript" }
window.print();

View file

@ -15,6 +15,7 @@
%i.bubble
%i.attachment
%i.lock
%i.printer
%h1 Formulaires