feat(user): dossier résumé with commentaire about corrections

This commit is contained in:
Colin Darie 2023-04-19 16:47:40 +02:00
parent 0fc09bb42c
commit b495e0aff0
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
2 changed files with 11 additions and 0 deletions

View file

@ -27,6 +27,10 @@ module DossierCorrectableConcern
corrections.pending.exists?
end
def pending_correction
corrections.pending.first
end
def resolve_pending_correction!
corrections.pending.update(resolved_at: Time.current)
end

View file

@ -8,6 +8,9 @@
= t('views.users.dossiers.show.status_overview.status_draft')
%li.en-construction{ class: dossier.en_construction? ? 'active' : nil }
= t('views.users.dossiers.show.status_overview.status_in_progress')
- if dossier.pending_correction.present?
= "(#{Dossier.human_attribute_name("pending_correction.for_user")})"
%li.en-instruction{ class: dossier.en_instruction? ? 'active' : nil }
= t('views.users.dossiers.show.status_overview.status_review')
%li.termine{ class: dossier.termine? ? 'active' : nil }
@ -23,6 +26,10 @@
-# brouillon does not occure
- if dossier.en_construction?
.en-construction
- if dossier.pending_correction.present?
.message.inverted-background
= render Dossiers::MessageComponent.new(commentaire: dossier.pending_correction.commentaire, connected_user: current_user)
%p{ role: 'status' }
= t('views.users.dossiers.show.status_overview.en_construction_html')