Merge pull request #2736 from betagouv/add-mail-templates-to-manager

Add mail templates to manager
This commit is contained in:
Mathieu Magnin 2018-10-02 17:38:07 +02:00 committed by GitHub
commit 32bdd79f8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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