107 lines
4.7 KiB
Text
107 lines
4.7 KiB
Text
- content_for(:title, "Recherche : #{@search_terms}")
|
||
|
||
.container
|
||
|
||
- if @dossier_not_in_instructor_group.present?
|
||
.fr-alert.fr-alert--info.fr-alert--sm.fr-mt-3w
|
||
= p t('views.instructeurs.search.dossier_not_in_instructor_group', dossier_id: @dossier_not_in_instructor_group.id, procedure_libelle: @dossier_not_in_instructor_group.procedure.libelle, groupe_instructeur_label: @dossier_not_in_instructor_group.groupe_instructeur.label)
|
||
|
||
.page-title
|
||
Résultat de la recherche :
|
||
= t('pluralize.dossier_trouve', count: @dossiers_count)
|
||
|
||
- if @projected_dossiers.present?
|
||
= paginate @paginated_ids
|
||
%table.table.dossiers-table.hoverable
|
||
%thead
|
||
%tr
|
||
%th.notification-col
|
||
%th.number-col Nº dossier
|
||
%th Démarche
|
||
%th Demandeur
|
||
%th.status-col Statut
|
||
%th.action-col.follow-col
|
||
%tbody
|
||
- @projected_dossiers.each do |p|
|
||
- procedure_libelle, user_email, procedure_id = p.columns
|
||
- instructeur_dossier = @instructeur_dossiers_ids.include?(p.dossier_id)
|
||
- expert_dossier = @dossier_avis_ids_h[p.dossier_id].present?
|
||
- hidden_by_administration = p.hidden_by_administration_at.present?
|
||
- instructeur_and_expert_dossier = instructeur_dossier && expert_dossier
|
||
- path = instructeur_dossier ? instructeur_dossier_path(procedure_id, p.dossier_id) : expert_avis_path(procedure_id, @dossier_avis_ids_h[p.dossier_id])
|
||
|
||
%tr{ class: [p.hidden_by_administration_at.present? && "file-hidden-by-user"] }
|
||
- if instructeur_and_expert_dossier
|
||
%td.folder-col.cell-link
|
||
%span.icon.folder
|
||
%td.number-col
|
||
.cell-link= p.dossier_id
|
||
%td
|
||
.cell-link= procedure_libelle
|
||
%td
|
||
.cell-link= user_email
|
||
%td.status-col
|
||
.cell-link= status_badge(p.state)
|
||
|
||
- elsif hidden_by_administration
|
||
= render partial: "recherche/hidden_dossier", locals: {p: p, procedure_libelle: procedure_libelle, user_email: user_email}
|
||
|
||
- else
|
||
|
||
%td.folder-col
|
||
%a.cell-link{ href: path }
|
||
%span.icon.folder
|
||
|
||
%td.number-col
|
||
%a.cell-link{ href: path }= p.dossier_id
|
||
|
||
%td
|
||
%a.cell-link{ href: path }= procedure_libelle
|
||
|
||
%td
|
||
%a.cell-link{ href: path }= user_email
|
||
|
||
%td.status-col
|
||
%a.cell-link{ href: path }= status_badge(p.state)
|
||
|
||
|
||
- if instructeur_dossier && expert_dossier
|
||
%td.action-col.follow-col
|
||
.dropdown{ data: { controller: 'menu-button' } }
|
||
%button.button.dropdown-button{ data: { menu_button_target: 'button' } }
|
||
Actions
|
||
.dropdown-content{ data: { menu_button_target: 'menu' } }
|
||
%ul.dropdown-items
|
||
%li
|
||
= link_to(instructeur_dossier_path(procedure_id, p.dossier_id)) do
|
||
%span.icon.in-progress>
|
||
.dropdown-description
|
||
Voir le dossier
|
||
%li
|
||
= link_to(expert_avis_path(procedure_id, @dossier_avis_ids_h[p.dossier_id])) do
|
||
%span.icon.in-progress>
|
||
.dropdown-description
|
||
Donner mon avis
|
||
|
||
- elsif instructeur_dossier
|
||
- if hidden_by_administration
|
||
%td.action-col.follow-col
|
||
= link_to restore_instructeur_dossier_path(procedure_id, p.dossier_id), method: :patch, class: "button primary" do
|
||
= t('views.instructeurs.dossiers.restore')
|
||
|
||
- else
|
||
%td.action-col.follow-col= render partial: "instructeurs/procedures/dossier_actions",
|
||
locals: { procedure_id: procedure_id,
|
||
dossier_id: p.dossier_id,
|
||
state: p.state,
|
||
archived: p.archived,
|
||
dossier_is_followed: @followed_dossiers_id.include?(p.dossier_id),
|
||
close_to_expiration: nil,
|
||
hidden_by_administration: nil }
|
||
|
||
- else
|
||
%td
|
||
= paginate @paginated_ids
|
||
|
||
- else
|
||
%h2 Aucun dossier correspondant à votre recherche n’a été trouvé
|