demarches-normaliennes/app/views/recherche/index.html.haml

93 lines
3.4 KiB
Text
Raw Normal View History

2021-04-29 09:33:23 +02:00
- content_for(:title, "Recherche : #{@search_terms}")
- pagination = paginate @paginated_ids
.container
.page-title
Résultat de la recherche :
= t('pluralize.dossier_trouve', count: @dossiers_count)
2021-05-17 15:42:21 +02:00
= pagination
2021-04-29 09:33:23 +02:00
- if @projected_dossiers.present?
%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|
2021-05-17 15:42:21 +02:00
- 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?
- 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])
2021-04-29 09:33:23 +02:00
2021-05-17 15:42:21 +02:00
%tr
- 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
2021-05-17 15:42:21 +02:00
%td.status-col
2021-05-17 15:42:21 +02:00
.cell-link= status_badge(p.state)
2021-04-29 09:33:23 +02:00
2021-05-17 15:42:21 +02:00
- else
2021-04-29 09:33:23 +02:00
%td.folder-col
2021-05-17 15:42:21 +02:00
%a.cell-link{ href: path }
2021-04-29 09:33:23 +02:00
%span.icon.folder
2021-05-17 15:42:21 +02:00
%td.number-col
%a.cell-link{ href: path }= p.dossier_id
2021-04-29 09:33:23 +02:00
2021-05-17 15:42:21 +02:00
%td
%a.cell-link{ href: path }= procedure_libelle
2021-04-29 09:33:23 +02:00
2021-05-17 15:42:21 +02:00
%td
%a.cell-link{ href: path }= user_email
2021-04-29 09:33:23 +02:00
2021-05-17 15:42:21 +02:00
%td.status-col
%a.cell-link{ href: path }= status_badge(p.state)
2021-04-29 09:33:23 +02:00
2021-05-17 15:42:21 +02:00
- if instructeur_dossier && expert_dossier
2021-04-29 09:33:23 +02:00
%td.action-col.follow-col
.dropdown
.button.dropdown-button
Actions
2021-05-17 15:42:21 +02:00
.dropdown-content.fade-in-down
%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
2021-05-17 15:42:21 +02:00
- elsif instructeur_dossier
%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) }
2021-05-17 15:42:21 +02:00
- else
%td
2021-04-29 09:33:23 +02:00
= pagination
- else
2021-05-26 15:16:30 +02:00
%h2 Aucun dossier correspondant à votre recherche na été trouvé