remove dropped tests, separate list item in external include

This commit is contained in:
Mathieu Jaumotte 2022-01-06 19:02:25 +01:00
parent 442e2a1ede
commit 7d4ca8d149
3 changed files with 88 additions and 163 deletions

View File

@ -0,0 +1,86 @@
<div class="item-bloc {% if not notification.isReadBy(app.user) %}unread{% else %}read{% endif %}">
<div class="item-row title">
<h2>
<a href="{{ chill_path_add_return_path('chill_main_notification_show', {'id': notification.id}) }}">
{{ notification.title }}
</a>
</h2>
</div>
<div class="item-row mt-2 header">
<div class="item-col">
<ul class="small_in_title">
{% if step == 'inbox' %}
<li class="notification-from">
<span class="item-key">
<abbr title="{{ 'notification.received_from'|trans }}">
{{ 'notification.from'|trans }} :
</abbr>
</span>
{% if not notification.isSystem %}
<span class="badge-user">
{{ notification.sender|chill_entity_render_string }}
</span>
{% else %}
<span class="badge-user system">{{ 'notification.is_system'|trans }}</span>
{% endif %}
</li>
{% endif %}
{% if notification.addressees|length > 0 %}
<li class="notification-to">
<span class="item-key">
<abbr title="{{ 'notification.sent_to'|trans }}">
{{ 'notification.to'|trans }} :
</abbr>
</span>
{% for a in notification.addressees %}
<span class="badge-user">
{{ a|chill_entity_render_string }}
</span>
{% endfor %}
</li>
{% endif %}
</ul>
</div>
<div class="item-col">
{{ notification.date|format_datetime('long', 'short') }}
</div>
</div>
<div class="item-row separator">
<div class="m-3">
{% include data.template with data.template_data %}
</div>
</div>
<div class="item-row row">
<div>
<blockquote class="chill-user-quote">
{{ notification.message|u.truncate(250, '…', false)|chill_markdown_to_html }}
</blockquote>
</div>
</div>
<div class="item-row separator">
<ul class="record_actions">
<li>
{# Vue component #}
<span class="notification_toggle_read_status"
data-notification-id="{{ notification.id }}"
data-notification-current-is-read="{{ notification.isReadBy(app.user) }}"
></span>
</li>
{% if is_granted('CHILL_MAIN_NOTIFICATION_UPDATE', notification) %}
<li>
<a href="{{ chill_path_add_return_path('chill_main_notification_edit', {'id': notification.id}) }}"
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
</li>
{% endif %}
{% if is_granted('CHILL_MAIN_NOTIFICATION_SEE', notification) %}
<li>
<a href="{{ chill_path_add_return_path('chill_main_notification_show', {'id': notification.id}) }}"
class="btn btn-show" title="{{ 'Show'|trans }}"></a>
</li>
{% endif %}
</ul>
</div>
</div>

View File

@ -14,7 +14,6 @@
{% block content %} {% block content %}
<div class="col-10 notification notification-list"> <div class="col-10 notification notification-list">
<h1>{{ block('title') }}</h1> <h1>{{ block('title') }}</h1>
<ul class="nav nav-pills justify-content-center"> <ul class="nav nav-pills justify-content-center">
@ -50,168 +49,8 @@
<div class="flex-table"> <div class="flex-table">
{% for data in datas %} {% for data in datas %}
{% set notification = data.notification %} {% set notification = data.notification %}
<div class="item-bloc {% if not notification.isReadBy(app.user) %}unread{% else %}read{% endif %}"> {% include 'ChillMainBundle:Notification:_list_item.html.twig' %}
<div class="item-row title">
<h2>
<a href="{{ chill_path_add_return_path('chill_main_notification_show', {'id': notification.id}) }}">
{{ notification.title }}
</a>
</h2>
</div>
<div class="item-row mt-2 header">
{# 1
<div class="item-col">
<div class="notification-from">
{% if step == 'inbox' %}
<abbr title="{{ 'notification.received_from'|trans }}">
{{ 'notification.from'|trans }}:
</abbr>
{% if not notification.isSystem %}
<span class="badge-user">
{{ notification.sender|chill_entity_render_string }}
</span>
{% else %}
<span class="badge-user system">{{ 'notification.is_system'|trans }}</span>
{% endif %}
{% endif %}
</div>
<div class="notification-to">
{% if notification.addressees|length > 0 %}
<abbr title="{{ 'notification.sent_to'|trans }}">
{{ 'notification.to'|trans }}:
</abbr>
{% endif %}
{% for a in notification.addressees %}
<span class="badge-user">
{{ a|chill_entity_render_string }}
</span>
{% endfor %}
</div>
</div>
<div class="item-col">{{ notification.date|format_datetime('long', 'short') }}</div>
#}
{# 2
#}
<div class="item-col">
<ul class="small_in_title">
{% if step == 'inbox' %}
<li class="notification-from">
<span class="item-key">
<abbr title="{{ 'notification.received_from'|trans }}">
{{ 'notification.from'|trans }}:
</abbr>
</span>
{% if not notification.isSystem %}
<span class="badge-user">
{{ notification.sender|chill_entity_render_string }}
</span>
{% else %}
<span class="badge-user system">{{ 'notification.is_system'|trans }}</span>
{% endif %}
</li>
{% endif %}
{% if notification.addressees|length > 0 %}
<li class="notification-to">
<span class="item-key">
<abbr title="{{ 'notification.sent_to'|trans }}">
{{ 'notification.to'|trans }}:
</abbr>
</span>
{% for a in notification.addressees %}
<span class="badge-user">
{{ a|chill_entity_render_string }}
</span>
{% endfor %}
</li>
{% endif %}
</ul>
</div>
<div class="item-col">
{{ notification.date|format_datetime('long', 'short') }}
</div>
{# 3
<div class="item-col">
<div class="wrap-list">
{% if step == 'inbox' %}
<div class="wl-row notification-from">
<div class="wl-col title">
<abbr title="{{ 'notification.received_from'|trans }}">
{{ 'notification.from'|trans }}:
</abbr>
</div>
<div class="wl-col list">
{% if not notification.isSystem %}
<span class="wl-item badge-user">
{{ notification.sender|chill_entity_render_string }}
</span>
{% else %}
<span class="wl-item badge-user system">{{ 'notification.is_system'|trans }}</span>
{% endif %}
</div>
</div>
{% endif %}
{% if notification.addressees|length > 0 %}
<div class="wl-row notification-to">
<div class="wl-col title">
<abbr title="{{ 'notification.sent_to'|trans }}">
{{ 'notification.to'|trans }}:
</abbr>
</div>
<div class="wl-col list">
{% for a in notification.addressees %}
<span class="wl-item badge-user">
{{ a|chill_entity_render_string }}
</span>
{% endfor %}
</div>
</div>
{% endif %}
</div>
</div>
<div class="item-col">{{ notification.date|format_datetime('long', 'short') }}</div>
#}
</div>
<div class="item-row separator">
{% include data.template with data.template_data %}
</div>
<div class="item-row row">
<div>
<blockquote class="chill-user-quote">
{{ notification.message|u.truncate(250, '…', false)|chill_markdown_to_html }}
</blockquote>
</div>
</div>
<div class="item-row separator">
<ul class="record_actions">
<li>
{# Vue component #}
<span class="notification_toggle_read_status"
data-notification-id="{{ notification.id }}"
data-notification-current-is-read="{{ notification.isReadBy(app.user) }}"
></span>
</li>
{% if is_granted('CHILL_MAIN_NOTIFICATION_UPDATE', notification) %}
<li>
<a href="{{ chill_path_add_return_path('chill_main_notification_edit', {'id': notification.id}) }}"
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
</li>
{% endif %}
{% if is_granted('CHILL_MAIN_NOTIFICATION_SEE', notification) %}
<li>
<a href="{{ chill_path_add_return_path('chill_main_notification_show', {'id': notification.id}) }}"
class="btn btn-show" title="{{ 'Show'|trans }}"></a>
</li>
{% endif %}
</ul>
</div>
</div>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
</div> </div>

View File

@ -2,7 +2,7 @@
{% if period is not null %} {% if period is not null %}
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', period) %} {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', period) %}
<a href="{{ path('chill_person_accompanying_course_index', {'accompanying_period_id': notification.relatedEntityId }) }}"> <a href="{{ path('chill_person_accompanying_course_index', {'accompanying_period_id': notification.relatedEntityId }) }}">
Show and Go to Accompanying Course Resume Accompanying Course (renderbox + links)
</a> </a>
{% else %} {% else %}
You are getting a notification for a period you are not allowed to see. This is the minimal details: {{ period.id }} You are getting a notification for a period you are not allowed to see. This is the minimal details: {{ period.id }}