notification form integration (create/edit)

This commit is contained in:
Mathieu Jaumotte 2022-01-10 12:44:08 +01:00
parent 95027e93c6
commit afae3b58c2
3 changed files with 37 additions and 12 deletions

View File

@ -1,5 +1,7 @@
{% extends "@ChillMain/layout.html.twig" %} {% extends "@ChillMain/layout.html.twig" %}
{% block title 'notification.Notify'|trans %}
{% block js %} {% block js %}
{{ parent() }} {{ parent() }}
{{ encore_entry_script_tags('mod_pickentity_type') }} {{ encore_entry_script_tags('mod_pickentity_type') }}
@ -11,23 +13,33 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="col-10"> <div class="col-8 notification notification-new">
{% include handler.template(notification) with handler.templateData(notification) %} <h1 class="mb-3">{{ block('title') }}</h1>
{{ form_start(form, { 'attr': { 'id': 'notification' }}) }} {{ form_start(form, { 'attr': { 'id': 'notification' }}) }}
{{ form_row(form.title) }} {{ form_row(form.title, { 'label': 'notification.subject'|trans }) }}
{{ form_row(form.addressees) }} {{ form_row(form.addressees, { 'label': 'notification.sent_to'|trans }) }}
{{ form_row(form.message) }}
{% include handler.template(notification) with handler.templateData(notification) %}
<div class="mb-3 row">
<label class="col-form-label col-sm-4" for="notification_message">{{ form_label(form.message) }}</label>
<div class="col-12">
{{ form_widget(form.message) }}
</div>
</div>
{{ form_end(form) }} {{ form_end(form) }}
<ul class="record_actions sticky-form-buttons"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a href="{{ chill_return_path_or('chill_main_homepage') }}" class="btn btn-cancel">{{ 'Cancel'|trans|chill_return_path_label }}</a> <a href="{{ chill_return_path_or('chill_main_homepage') }}" class="btn btn-cancel">{{ 'Cancel'|trans|chill_return_path_label }}</a>
</li> </li>
<li> <li>
<button type="submit" form="notification" class="btn btn-save">{{ 'Save'|trans }}</button> <button type="submit" form="notification" class="btn btn-save change-icon">
<i class="fa fa-paper-plane fa-fw"></i> {{ 'notification.Send'|trans }}
</button>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -1,5 +1,7 @@
{% extends "@ChillMain/layout.html.twig" %} {% extends "@ChillMain/layout.html.twig" %}
{% block title 'notification.Edit notification'|trans %}
{% block js %} {% block js %}
{{ parent() }} {{ parent() }}
{{ encore_entry_script_tags('mod_pickentity_type') }} {{ encore_entry_script_tags('mod_pickentity_type') }}
@ -11,14 +13,22 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="col-10"> <div class="col-8 notification notification-edit">
{% include handler.template(notification) with handler.templateData(notification) %} <h1 class="mb-3">{{ block('title') }}</h1>
{{ form_start(form, { 'attr': { 'id': 'notification' }}) }} {{ form_start(form, { 'attr': { 'id': 'notification' }}) }}
{{ form_row(form.title) }} {{ form_row(form.title, { 'label': 'notification.subject'|trans }) }}
{{ form_row(form.addressees) }} {{ form_row(form.addressees, { 'label': 'notification.sent_to'|trans }) }}
{{ form_row(form.message) }}
{% include handler.template(notification) with handler.templateData(notification) %}
<div class="mb-3 row">
<label class="col-form-label col-sm-4" for="notification_message">{{ form_label(form.message) }}</label>
<div class="col-12">
{{ form_widget(form.message) }}
</div>
</div>
{{ form_end(form) }} {{ form_end(form) }}

View File

@ -356,6 +356,8 @@ notification:
Notification: Notification Notification: Notification
My own notifications: Mes notifications My own notifications: Mes notifications
Notify: Envoyer une notification Notify: Envoyer une notification
Send: Envoyer
Edit notification: Modifier une notification
Notification created: Notification envoyée Notification created: Notification envoyée
Any notification received: Aucune notification reçue Any notification received: Aucune notification reçue
Any notification sent: Aucune notification envoyée Any notification sent: Aucune notification envoyée
@ -375,4 +377,5 @@ notification:
received_from: Expéditeur received_from: Expéditeur
you were notified by %sender%: Vous avez été notifié par %sender% you were notified by %sender%: Vous avez été notifié par %sender%
you were notified by system: Vous avez été notifié automatiquement you were notified by system: Vous avez été notifié automatiquement
subject: Objet