From afae3b58c28cb0dd2eaa70a98154e1e0b9e96e92 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 10 Jan 2022 12:44:08 +0100 Subject: [PATCH] notification form integration (create/edit) --- .../views/Notification/create.html.twig | 26 ++++++++++++++----- .../views/Notification/edit.html.twig | 20 ++++++++++---- .../translations/messages.fr.yml | 3 +++ 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/create.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/create.html.twig index 2e0dbdd77..33d59f404 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Notification/create.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/create.html.twig @@ -1,5 +1,7 @@ {% extends "@ChillMain/layout.html.twig" %} +{% block title 'notification.Notify'|trans %} + {% block js %} {{ parent() }} {{ encore_entry_script_tags('mod_pickentity_type') }} @@ -11,23 +13,33 @@ {% endblock %} {% block content %} -
- {% include handler.template(notification) with handler.templateData(notification) %} +
+

{{ block('title') }}

{{ form_start(form, { 'attr': { 'id': 'notification' }}) }} - {{ form_row(form.title) }} - {{ form_row(form.addressees) }} - {{ form_row(form.message) }} + {{ form_row(form.title, { 'label': 'notification.subject'|trans }) }} + {{ form_row(form.addressees, { 'label': 'notification.sent_to'|trans }) }} + + {% include handler.template(notification) with handler.templateData(notification) %} + +
+ +
+ {{ form_widget(form.message) }} +
+
{{ form_end(form) }} - +
diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/edit.html.twig index b2aaa7842..9388d2656 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Notification/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/edit.html.twig @@ -1,5 +1,7 @@ {% extends "@ChillMain/layout.html.twig" %} +{% block title 'notification.Edit notification'|trans %} + {% block js %} {{ parent() }} {{ encore_entry_script_tags('mod_pickentity_type') }} @@ -11,14 +13,22 @@ {% endblock %} {% block content %} -
- {% include handler.template(notification) with handler.templateData(notification) %} +
+

{{ block('title') }}

{{ form_start(form, { 'attr': { 'id': 'notification' }}) }} - {{ form_row(form.title) }} - {{ form_row(form.addressees) }} - {{ form_row(form.message) }} + {{ form_row(form.title, { 'label': 'notification.subject'|trans }) }} + {{ form_row(form.addressees, { 'label': 'notification.sent_to'|trans }) }} + + {% include handler.template(notification) with handler.templateData(notification) %} + +
+ +
+ {{ form_widget(form.message) }} +
+
{{ form_end(form) }} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 73bbb5014..547ea2bd5 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -356,6 +356,8 @@ notification: Notification: Notification My own notifications: Mes notifications Notify: Envoyer une notification + Send: Envoyer + Edit notification: Modifier une notification Notification created: Notification envoyée Any notification received: Aucune notification reçue Any notification sent: Aucune notification envoyée @@ -375,4 +377,5 @@ notification: received_from: Expéditeur you were notified by %sender%: Vous avez été notifié par %sender% you were notified by system: Vous avez été notifié automatiquement + subject: Objet