mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
notificaiton: add title to list and forms
This commit is contained in:
parent
0edd5667e0
commit
5bb5468198
@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\Notification;
|
|||||||
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
||||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
@ -23,6 +24,10 @@ class NotificationType extends AbstractType
|
|||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
|
->add('title', TextType::class, [
|
||||||
|
'label' => 'Title',
|
||||||
|
'required' => true,
|
||||||
|
])
|
||||||
->add('addressees', PickUserDynamicType::class, [
|
->add('addressees', PickUserDynamicType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
])
|
])
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
{{ form_start(form, { 'attr': { 'id': 'notification' }}) }}
|
{{ form_start(form, { 'attr': { 'id': 'notification' }}) }}
|
||||||
|
|
||||||
|
{{ form_row(form.title) }}
|
||||||
{{ form_row(form.addressees) }}
|
{{ form_row(form.addressees) }}
|
||||||
{{ form_row(form.message) }}
|
{{ form_row(form.message) }}
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
{{ form_start(form, { 'attr': { 'id': 'notification' }}) }}
|
{{ form_start(form, { 'attr': { 'id': 'notification' }}) }}
|
||||||
|
|
||||||
|
{{ form_row(form.title) }}
|
||||||
{{ form_row(form.addressees) }}
|
{{ form_row(form.addressees) }}
|
||||||
{{ form_row(form.message) }}
|
{{ form_row(form.message) }}
|
||||||
|
|
||||||
|
@ -53,16 +53,23 @@
|
|||||||
{% set notification = data.notification %}
|
{% set notification = data.notification %}
|
||||||
<div class="item-bloc {% if not notification.isReadBy(app.user) %}unread{% else %}read{% endif %}">
|
<div class="item-bloc {% if not notification.isReadBy(app.user) %}unread{% else %}read{% endif %}">
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<div>
|
<h2>
|
||||||
{% if step == 'inbox' %}
|
<a href="{{ chill_path_add_return_path('chill_main_notification_show', {'id': notification.id}) }}">
|
||||||
{{ 'notification.from'|trans }}: {{ notification.sender|chill_entity_render_string }}
|
{{ notification.title }}
|
||||||
{% endif %}
|
</a>
|
||||||
{% if not notification.isReadBy(app.user) %}
|
{% if not notification.isReadBy(app.user) %}
|
||||||
<div class="badge bg-danger">{{ 'notification.is_unread'|trans }}</div>
|
<div class="badge bg-danger">{{ 'notification.is_unread'|trans }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ 'notification.adressees'|trans }}{% for a in notification.addressees %}{{ a|chill_entity_render_string }}{% if not loop.last %}, {% endif %}{% endfor %}</div>
|
<div class="item-row">
|
||||||
<div>{{ notification.date|format_datetime('long', 'short') }}</div>
|
<div class="item-col">
|
||||||
|
{% if step == 'inbox' %}
|
||||||
|
{{ 'notification.from'|trans }}: {{ notification.sender|chill_entity_render_string }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="item-col">{{ 'notification.adressees'|trans }}{% for a in notification.addressees %}{{ a|chill_entity_render_string }}{% if not loop.last %}, {% endif %}{% endfor %}</div>
|
||||||
|
<div class="item-col">{{ notification.date|format_datetime('long', 'short') }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<div>
|
<div>
|
||||||
@ -71,10 +78,10 @@
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-row">
|
<div class="item-row separator">
|
||||||
{% include data.template with data.template_data %}
|
{% include data.template with data.template_data %}
|
||||||
</div>
|
</div>
|
||||||
<div class="item-row">
|
<div class="item-row separator">
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<span class="notification_toggle_read_status" data-notification-id="{{ notification.id }}" data-notification-current-is-read="{{ notification.isReadBy(app.user) }}"></span>
|
<span class="notification_toggle_read_status" data-notification-id="{{ notification.id }}" data-notification-current-is-read="{{ notification.isReadBy(app.user) }}"></span>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends "@ChillMain/layout.html.twig" %}
|
{% extends "@ChillMain/layout.html.twig" %}
|
||||||
|
|
||||||
{% block title 'notification.show notification from %sender%'|trans({ '%sender%': notification.sender|chill_entity_render_string }) %}
|
{% block title 'notification.show notification from %sender%'|trans({ '%sender%': notification.sender|chill_entity_render_string })~' '~notification.title %}
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
@ -15,7 +15,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<h1>{{ 'notification.Notification'|trans }}</h1>
|
<h1>{{ notification.title }}</h1>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{% include handler.getTemplate(notification) with handler.getTemplateData(notification) %}
|
{% include handler.getTemplate(notification) with handler.getTemplateData(notification) %}
|
||||||
|
@ -361,4 +361,5 @@ notification:
|
|||||||
Notifications sent: Notification envoyées
|
Notifications sent: Notification envoyées
|
||||||
comment_appended: Commentaire ajouté
|
comment_appended: Commentaire ajouté
|
||||||
comment_updated: Commentaire mis à jour
|
comment_updated: Commentaire mis à jour
|
||||||
|
is_unread: Non-lue
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user