demarches-normaliennes/app/views/instructeurs/procedures/_dossier_actions.html.haml

64 lines
3.8 KiB
Text

- if hidden_by_administration && hidden_by_expired
%li
= button_to repousser_expiration_and_restore_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: "fr-btn fr-icon-refresh-line" do
= t('views.instructeurs.dossiers.restore_and_extend')
- elsif hidden_by_administration
%li
= button_to restore_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: "fr-btn fr-icon-refresh-line" do
= t('views.instructeurs.dossiers.restore')
- elsif close_to_expiration || Dossier::TERMINE.include?(state)
%li
- if close_to_expiration
= button_to repasser_en_instruction_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: 'fr-btn fr-btn--secondary fr-icon-edit-line', form: { data: { turbo: turbo ? 'true' : 'false' } } do
Repasser en instruction
= button_to repousser_expiration_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: "fr-btn" do
= t('instructeurs.dossiers.header.banner.button_delay_expiration')
- elsif archived
= button_to unarchive_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: "fr-btn fr-icon-upload-2-line" do
Désarchiver le dossier
= button_to instructeur_dossier_path(procedure_id, dossier_id), method: :delete, class: 'fr-btn fr-btn--secondary fr-icon-delete-line icon-only danger', title: t('views.instructeurs.dossiers.delete_dossier') do
= ""
- else
= button_to repasser_en_instruction_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: 'fr-btn fr-btn--secondary fr-icon-edit-line', form: { data: { turbo: turbo ? 'true' : 'false' } } do
Repasser en instruction
= button_to archive_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'fr-btn fr-icon-folder-2-line' do
Archiver le dossier
= button_to instructeur_dossier_path(procedure_id, dossier_id), method: :delete, class: 'fr-btn fr-btn--secondary fr-icon-delete-line icon-only danger', title: t('views.instructeurs.dossiers.delete_dossier') do
= ""
- elsif Dossier::EN_CONSTRUCTION_OU_INSTRUCTION.include?(state)
- if dossier_is_followed
%li
= button_to unfollow_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'fr-btn fr-btn--secondary fr-icon-star-fill' do
= t('views.instructeurs.dossiers.stop_follow')
- else
%li
= button_to follow_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'fr-btn fr-btn--secondary fr-icon-star-line' do
= t('views.instructeurs.dossiers.follow_file')
- if with_menu
%li.en-construction-menu{ 'data-turbo': turbo ? 'true' : 'false' }
= render Instructeurs::EnConstructionMenuComponent.new(dossier:)
- if Dossier.states[:en_construction] == state
%li{ 'data-turbo': turbo ? 'true' : 'false' }
= button_to passer_en_instruction_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: 'fr-btn fr-icon-edit-line',
disabled: has_blocking_pending_correction, "aria-describedby" => has_blocking_pending_correction ? "tooltip-passer-en-instruction" : nil do
= t('views.instructeurs.dossiers.passer_en_instruction')
- if has_blocking_pending_correction
%span#tooltip-passer-en-instruction.fr-tooltip.fr-placement{ role: :tooltip, "aria-hidden" => "true" }
= t('views.instructeurs.dossiers.passer_en_instruction_blocked_by_pending_correction')
- elsif Dossier.states[:en_instruction] == state && !with_menu && !sva_svr
%li{ 'data-turbo': turbo ? 'true' : 'false' }
= button_to repasser_en_construction_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: 'fr-btn fr-btn--secondary fr-icon-draft-line' do
= t('views.instructeurs.dossiers.repasser_en_construction')