2020-04-03 17:15:35 +02:00
|
|
|
- if @search_terms.present?
|
2022-11-30 17:21:11 +01:00
|
|
|
- content_for(:title, t(".title_search", scope: :metas, terms: @search_terms))
|
2020-04-03 17:15:35 +02:00
|
|
|
- else
|
2022-11-30 17:21:11 +01:00
|
|
|
- content_for(:title, t(".title", scope: :metas))
|
2018-08-29 17:09:48 +02:00
|
|
|
|
2018-09-12 13:29:15 +02:00
|
|
|
- content_for :footer do
|
2019-03-25 10:53:45 +01:00
|
|
|
= render partial: "users/dossiers/index_footer"
|
2018-09-12 13:29:15 +02:00
|
|
|
|
2018-04-23 17:22:20 +02:00
|
|
|
.dossiers-headers.sub-header
|
2023-06-29 15:03:22 +02:00
|
|
|
.fr-container
|
2023-04-25 13:01:40 +02:00
|
|
|
%h1.page-title.fr-h2= t('views.users.dossiers.index.dossiers')
|
2023-07-19 17:57:24 +02:00
|
|
|
|
|
|
|
.fr-grid-row.fr-grid-row--gutters
|
|
|
|
- if current_user.dossiers.count > 2 || current_user.dossiers_invites.count > 2
|
|
|
|
.fr-col
|
|
|
|
#search-2.fr-search-bar
|
2023-07-26 17:51:04 +02:00
|
|
|
= form_tag dossiers_path, method: :get, :role => "search", class: "flex width-100 fr-mb-5w" do
|
|
|
|
= hidden_field_tag :procedure_id, params[:procedure_id]
|
2023-07-19 17:57:24 +02:00
|
|
|
= label_tag "q", t('views.users.dossiers.search.search_file'), class: 'fr-label'
|
|
|
|
= text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.search_file'), class: "fr-input"
|
|
|
|
%button.fr-btn.fr-btn--sm
|
|
|
|
= t('views.users.dossiers.search.simple')
|
2023-07-24 16:48:05 +02:00
|
|
|
- if @procedures_for_select.present?
|
2023-07-19 17:57:24 +02:00
|
|
|
.fr-col
|
2023-07-24 16:48:05 +02:00
|
|
|
= render Dossiers::UserProcedureFilterComponent.new(procedures_for_select: @procedures_for_select)
|
2018-04-03 10:49:16 +02:00
|
|
|
|
2023-04-14 16:24:50 +02:00
|
|
|
- if @search_terms.blank?
|
2023-11-09 15:02:43 +01:00
|
|
|
%nav.fr-tabs{ role: 'navigation', 'aria-label': t('views.users.dossiers.secondary_menu') }
|
2023-11-14 12:05:17 +01:00
|
|
|
%ul.fr-tabs__list{ role: 'tablist' }
|
2021-12-24 18:10:50 +01:00
|
|
|
- if @user_dossiers.present?
|
|
|
|
= tab_item(t('pluralize.en_cours', count: @user_dossiers.count),
|
2023-07-19 17:57:24 +02:00
|
|
|
dossiers_path(statut: 'en-cours', procedure_id: params[:procedure_id]),
|
2021-12-24 18:10:50 +01:00
|
|
|
active: @statut == 'en-cours',
|
|
|
|
badge: number_with_html_delimiter(@user_dossiers.count))
|
|
|
|
- if @dossiers_traites.present?
|
2023-01-03 14:50:36 +01:00
|
|
|
// TODO: when renaming this tab in "Terminé", update notify_near_deletion_to_user email wording accordingly.
|
2021-12-24 18:10:50 +01:00
|
|
|
= tab_item(t('pluralize.traites', count: @dossiers_traites.count),
|
2023-07-19 17:57:24 +02:00
|
|
|
dossiers_path(statut: 'traites', procedure_id: params[:procedure_id]),
|
2021-12-24 18:10:50 +01:00
|
|
|
active: @statut == 'traites',
|
|
|
|
badge: number_with_html_delimiter(@dossiers_traites.count))
|
2021-11-10 17:36:24 +01:00
|
|
|
|
2021-12-24 18:10:50 +01:00
|
|
|
- if @dossiers_invites.present?
|
|
|
|
= tab_item(t('pluralize.dossiers_invites', count: @dossiers_invites.count),
|
2023-07-19 17:57:24 +02:00
|
|
|
dossiers_path(statut: 'dossiers-invites', procedure_id: params[:procedure_id]),
|
2021-12-24 18:10:50 +01:00
|
|
|
active: @statut == 'dossiers-invites',
|
|
|
|
badge: number_with_html_delimiter(@dossiers_invites.count))
|
2020-11-26 15:13:32 +01:00
|
|
|
|
2021-12-24 18:10:50 +01:00
|
|
|
- if @dossiers_close_to_expiration.count > 0
|
|
|
|
= tab_item(t('pluralize.dossiers_close_to_expiration', count: @dossiers_close_to_expiration.count),
|
2023-07-19 17:57:24 +02:00
|
|
|
dossiers_path(statut: 'dossiers-expirant', procedure_id: params[:procedure_id]),
|
2021-12-24 18:10:50 +01:00
|
|
|
active: @statut == 'dossiers-expirant',
|
|
|
|
badge: number_with_html_delimiter(@dossiers_close_to_expiration.count))
|
2021-12-02 15:56:34 +01:00
|
|
|
|
2022-01-05 10:43:13 +01:00
|
|
|
- if @dossiers_supprimes_recemment.present?
|
|
|
|
= tab_item(t('pluralize.dossiers_supprimes_recemment', count: @dossiers_supprimes_recemment.count),
|
2023-07-19 17:57:24 +02:00
|
|
|
dossiers_path(statut: 'dossiers-supprimes-recemment', procedure_id: params[:procedure_id]),
|
2022-01-05 10:43:13 +01:00
|
|
|
active: @statut == 'dossiers-supprimes-recemment',
|
|
|
|
badge: number_with_html_delimiter(@dossiers_supprimes_recemment.count))
|
|
|
|
|
|
|
|
- if @dossiers_supprimes_definitivement.present?
|
|
|
|
= tab_item(t('pluralize.dossiers_supprimes_definitivement', count: @dossiers_supprimes_definitivement.count),
|
2023-07-19 17:57:24 +02:00
|
|
|
dossiers_path(statut: 'dossiers-supprimes-definitivement', procedure_id: params[:procedure_id]),
|
2022-01-05 10:43:13 +01:00
|
|
|
active: @statut == 'dossiers-supprimes-definitivement',
|
|
|
|
badge: number_with_html_delimiter(@dossiers_supprimes_definitivement.count))
|
2020-11-17 13:25:35 +01:00
|
|
|
|
2023-06-28 11:53:41 +02:00
|
|
|
- if @dossier_transferes.present?
|
|
|
|
= tab_item(t('pluralize.dossiers_transferes', count: @dossier_transferes.count),
|
2023-07-19 17:57:24 +02:00
|
|
|
dossiers_path(statut: 'dossiers-transferes', procedure_id: params[:procedure_id]),
|
2021-12-24 18:10:50 +01:00
|
|
|
active: @statut == 'dossiers-transferes',
|
2023-06-28 11:53:41 +02:00
|
|
|
badge: number_with_html_delimiter(@dossier_transferes.count))
|
2018-03-28 15:02:37 +02:00
|
|
|
|
2023-04-26 11:05:15 +02:00
|
|
|
.fr-container
|
2023-07-06 17:36:28 +02:00
|
|
|
.fr-grid-row.fr-grid-row--center
|
|
|
|
.fr-col-xl-10
|
2023-07-26 17:51:04 +02:00
|
|
|
- if @statut == "en-cours" && @search_terms.blank?
|
2023-07-06 17:36:28 +02:00
|
|
|
- if @first_brouillon_recently_updated.present?
|
|
|
|
= render Dsfr::CalloutComponent.new(title: t('users.dossiers.header.callout.first_brouillon_recently_updated_title'), heading_level: 'h2') do |c|
|
|
|
|
- c.with_body do
|
|
|
|
%p
|
|
|
|
= t('users.dossiers.header.callout.first_brouillon_recently_updated_text', time_ago: time_ago_in_words(@first_brouillon_recently_updated.created_at), libelle: @first_brouillon_recently_updated.procedure.libelle )
|
|
|
|
= link_to t('users.dossiers.header.callout.first_brouillon_recently_updated_button'), url_for_dossier(@first_brouillon_recently_updated), class: 'fr-btn'
|
2023-06-15 18:08:44 +02:00
|
|
|
|
2023-07-06 17:36:28 +02:00
|
|
|
- if @search_terms.present?
|
2023-07-26 17:51:04 +02:00
|
|
|
%h2.page-title
|
|
|
|
= t('views.users.dossiers.search.result_term_title', search_terms: @search_terms)
|
|
|
|
- if @procedure_id.present?
|
|
|
|
= t('views.users.dossiers.search.result_procedure_title', procedure_libelle: @procedures_for_select.rassoc(@procedure_id.to_i).first)
|
|
|
|
= render partial: "dossiers_list", locals: { dossiers: @dossiers_visibles, filter: nil, search: true }
|
2018-03-28 15:02:37 +02:00
|
|
|
|
2023-07-06 17:36:28 +02:00
|
|
|
- else
|
2023-07-19 17:57:24 +02:00
|
|
|
= render Dossiers::UserFilterComponent.new(statut: @statut, filter: @filter, procedure_id: @procedure_id )
|
2023-04-28 15:28:04 +02:00
|
|
|
|
2023-07-06 17:36:28 +02:00
|
|
|
- if @statut == "dossiers-supprimes-definitivement"
|
|
|
|
-# /!\ in this context, @dossiers is a collection of DeletedDossier not Dossier
|
|
|
|
= render partial: "deleted_dossiers_list", locals: { deleted_dossiers: @dossiers }
|
|
|
|
- else
|
2023-07-26 17:51:04 +02:00
|
|
|
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut, search: false }
|