Add tab to group all commentaires files in one (for gestionnaire)

This commit is contained in:
Xavier J 2016-07-18 18:48:59 +02:00
parent d26ae9539d
commit 9221a0bb26
3 changed files with 32 additions and 0 deletions

View file

@ -45,4 +45,8 @@ class DossierFacades
def invites
@dossier.invites
end
def commentaires_files
PieceJustificative.where(dossier_id: @dossier.id, type_de_piece_justificative_id: nil)
end
end

View file

@ -21,6 +21,9 @@
%li{role: "presentation", class: "active"}
%a{href: "#commentaires", 'aria-controls' => "commentaires", role: "tab", 'data-toggle' => "tab"}
Commentaires
%li{role: "presentation"}
%a{href: "#commentaires_files", 'aria-controls' => "commentaires_files", role: "tab", 'data-toggle' => "tab"}
Fichiers
%li{role: "presentation"}
%a{href: "#invites", 'aria-controls' => "invites", role: "tab", 'data-toggle' => "tab"}
Invités
@ -30,6 +33,8 @@
%h3 Flux de commentaires
%br
= render partial: '/users/recapitulatif/commentaires_flux'
%div{role: "tabpanel", class: "tab-pane fade", id:"commentaires_files"}
= render partial: '/dossiers/commentaires_files'
%div{role: "tabpanel", class: "tab-pane fade", id:"invites"}
= render partial: '/dossiers/invites'

View file

@ -0,0 +1,23 @@
%h3 Fichiers des commentaires
%br
- if @facade.commentaires_files.size > 0
%table.table
%thead
%th.col-md-3
Email
%th.col-md-2
Date
%th.col-md-6
Fichier
- @facade.commentaires_files.each do |file|
%tr
%td= file.user.nil? ? 'Accompagnateur' : file.user.email
%td= file.created_at.localtime
%td= link_to file.original_filename, file.content_url, style:'color: green', target: '_blank'
- else
%h4.text-primary
Pas de fichier dans le flux de commentaires.