display all aside activities created for and created by user with temporary badge

This commit is contained in:
Julie Lenaerts 2021-09-21 11:42:18 +02:00
parent 601c16ac27
commit d2ce4865c0
3 changed files with 19 additions and 25 deletions

View File

@ -17,7 +17,8 @@ final class AsideActivityController extends CRUDController
$qb = parent::buildQueryEntities($action, $request);
if ('index' === $action) {
$qb->andWhere($qb->expr()->eq('e.agent', ':user'));
$qb->where($qb->expr()->eq('e.agent', ':user'));
$qb->orWhere($qb->expr()->eq('e.createdBy', ':user'));
$qb->setParameter('user', $this->getUser());
}

View File

@ -19,7 +19,6 @@
class="flex-table my-4 list-records">
{# Sort activities according to date in descending order #}
{% for entity in entities %}
{% set t = entity.type %}
<div class="item-bloc">
<div class="item-row main">
@ -29,6 +28,10 @@
<b>{{ entity.type.title | localize_translatable_string }}</b>
</h3>
<p>{{ 'Created for' | trans }}
:
{{ entity.agent }}</p>
{% if entity.date %}
<p>{{ entity.date|format_date('long') }}</p>
{% endif %}
@ -43,34 +46,23 @@
</div>
<div class="item-col">
<ul class="list-content">
{% if entity.createdBy %}
<li>
<b>{{ 'Created by: '|trans }}{{ entity.createdBy.usernameCanonical }}</b>
</li>
{% endif %}
<li style="list-style-type: none;">
<span class="{{ entity.createdBy is same as app.user ? 'badge bg-chill-pink' : 'badge bg-chill-yellow' }}">
<b>{{ 'Created by'|trans }}
:
{{ entity.createdBy.usernameCanonical }}</b>
</span>
</li>
</ul>
</div>
</div>
{# {%
if entity.note is not empty
or entity.createdBy|length > 0
%}
<div class="item-row details">
{% if entity.note is not empty %}
<div class="item-col comment">
{{ entity.note|chill_markdown_to_html }}
</div>
{% endif %}
</div>
{% endif %} #}
<div class="item-col">
<ul class="list-content">
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_aside_activity_edit', { 'id': entity.id }) }}" class="btn btn-update btn-mini "></a>
</li>
<li>
<a href="{{ chill_path_add_return_path('chill_crud_aside_activity_edit', { 'id': entity.id }) }}" class="btn btn-update btn-mini "></a>
</li>
<li>
<a href="{{ chill_path_add_return_path('chill_crud_aside_activity_delete', { 'id': entity.id } ) }}" class="btn btn-delete btn-mini"></a>
</li>
@ -82,7 +74,7 @@
{% endfor %}
</div>
{{ chill_pagination(paginator) }}
{{ chill_pagination(paginator) }}
<ul class="record_actions">
<li>

View File

@ -62,7 +62,8 @@ Note: Note
#list
My aside activities: Mes activités annexes
Date: Date
Created by: Creér par
Created by: Créé par
Created for: Créé pour
#Aside activity delete
Delete aside activity: Supprimer une activité annexe