dossier: add a messagerie_available? method
This commit is contained in:
parent
ad57c6ef99
commit
ce9c5da6e1
2 changed files with 5 additions and 1 deletions
|
@ -170,6 +170,10 @@ class Dossier < ApplicationRecord
|
||||||
brouillon? || en_construction?
|
brouillon? || en_construction?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def messagerie_available?
|
||||||
|
!brouillon? && !archived
|
||||||
|
end
|
||||||
|
|
||||||
def retention_end_date
|
def retention_end_date
|
||||||
if instruction_commencee?
|
if instruction_commencee?
|
||||||
en_instruction_at + procedure.duree_conservation_dossiers_dans_ds.months
|
en_instruction_at + procedure.duree_conservation_dossiers_dans_ds.months
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
%li.footer-column
|
%li.footer-column
|
||||||
%h3.footer-header Poser une question sur votre dossier :
|
%h3.footer-header Poser une question sur votre dossier :
|
||||||
%p
|
%p
|
||||||
- if dossier.present? && !dossier.brouillon?
|
- if dossier.present? && dossier.messagerie_available?
|
||||||
Directement
|
Directement
|
||||||
= link_to "par la messagerie", messagerie_dossier_path(dossier)
|
= link_to "par la messagerie", messagerie_dossier_path(dossier)
|
||||||
- else
|
- else
|
||||||
|
|
Loading…
Reference in a new issue