nom du demandeur dans user::dossiers#index si >=2 dossiers

This commit is contained in:
clemkeirua 2020-04-09 11:31:45 +02:00
parent c5882a8b22
commit 6df927a46f
2 changed files with 19 additions and 0 deletions

View file

@ -1,4 +1,6 @@
module DossierHelper module DossierHelper
include EtablissementHelper
def button_or_label_class(dossier) def button_or_label_class(dossier)
if dossier.accepte? if dossier.accepte?
'accepted' 'accepted'
@ -101,6 +103,18 @@ module DossierHelper
content_tag(:span, status_text, class: "label #{status_class} ") content_tag(:span, status_text, class: "label #{status_class} ")
end end
def demandeur_dossier(dossier)
if dossier.procedure.for_individual?
"#{dossier&.individual&.nom} #{dossier&.individual&.prenom}"
else
if dossier.etablissement.present?
raison_sociale_or_name(dossier.etablissement)
else
""
end
end
end
private private
def dinum_instance? def dinum_instance?

View file

@ -32,6 +32,8 @@
%th.notification-col %th.notification-col
%th.number-col Nº dossier %th.number-col Nº dossier
%th Démarche %th Démarche
- if @dossiers.count > 1
%th Demandeur
%th.status-col Statut %th.status-col Statut
%th.updated-at-col Mis à jour %th.updated-at-col Mis à jour
%th %th
@ -47,6 +49,9 @@
%td %td
= link_to(url_for_dossier(dossier), class: 'cell-link') do = link_to(url_for_dossier(dossier), class: 'cell-link') do
= procedure_libelle(dossier.procedure) = procedure_libelle(dossier.procedure)
- if @dossiers.count > 1
%td.number-col
= demandeur_dossier(dossier)
%td.status-col %td.status-col
= link_to(url_for_dossier(dossier), class: 'cell-link') do = link_to(url_for_dossier(dossier), class: 'cell-link') do
= status_badge(dossier.state) = status_badge(dossier.state)