Add mail templates to manager

This commit is contained in:
Mathieu Magnin 2018-10-02 15:38:57 +02:00
parent a6910d668e
commit 1dc2c30b24
3 changed files with 24 additions and 0 deletions

View file

@ -29,6 +29,11 @@ class ProcedureDashboard < Administrate::BaseDashboard
archived_at: Field::DateTime,
whitelisted_at: Field::DateTime,
service: Field::BelongsTo,
initiated_mail_template: MailTemplateField,
received_mail_template: MailTemplateField,
closed_mail_template: MailTemplateField,
refused_mail_template: MailTemplateField,
without_continuation_mail_template: MailTemplateField,
}.freeze
# COLLECTION_ATTRIBUTES
@ -68,6 +73,11 @@ class ProcedureDashboard < Administrate::BaseDashboard
:individual_with_siret,
:auto_archive_on,
:gestionnaires,
:initiated_mail_template,
:received_mail_template,
:closed_mail_template,
:refused_mail_template,
:without_continuation_mail_template,
].freeze
# FORM_ATTRIBUTES

View file

@ -0,0 +1,7 @@
require "administrate/field/base"
class MailTemplateField < Administrate::Field::Base
def name
data.class::DISPLAYED_NAME
end
end

View file

@ -0,0 +1,7 @@
%strong Sujet
%pre
= field.data.subject
%strong Corps
%pre
= field.data.body