diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig
new file mode 100644
index 000000000..7b46ffb67
--- /dev/null
+++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig
@@ -0,0 +1,151 @@
+{% set t = activity.type %}
+
{% if activities|length == 0 %}
@@ -8,215 +66,10 @@
{% else %}
{% for activity in activities %}
- {% set t = activity.type %}
-
-
-
-
-
-
- {% if activity.date %}
-
- {{ activity.date|format_date('short') }}
-
- {% endif %}
-
-
-
-
-
- {{ activity.type.name | localize_translatable_string }}
-
- {% if activity.emergency %}
- {{ 'Emergency'|trans|upper }}
- {% endif %}
-
-
-
-
-
-
-
-
-
- {% if activity.location and t.locationVisible %}
-
-
{{ 'location'|trans }}
-
-
- {{ activity.location.locationType.title|localize_translatable_string }}
- {{ activity.location.name }}
-
-
-
- {% endif %}
-
- {% if activity.sentReceived is not empty and t.sentReceivedVisible %}
-
-
{{ 'Sent received'|trans }}
-
-
- {{ activity.sentReceived|capitalize|trans }}
-
-
-
- {% endif %}
-
- {% if activity.user and t.userVisible %}
-
-
{{ 'Referrer'|trans }}
-
-
- {{ activity.user.usernameCanonical|chill_entity_render_string|capitalize }}
-
-
-
- {% endif %}
-
-
- {% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
- 'context': context,
- 'with_display': 'wrap-list',
- 'entity': activity,
- 'badge_person': true
- } %}
-
-
- {%- if activity.reasons is not empty and t.reasonsVisible -%}
-
-
-
{{ 'Reasons'|trans }}
-
-
- {% for r in activity.reasons %}
-
- {{ r|chill_entity_render_box }}
-
- {% endfor %}
-
-
- {% endif %}
-
- {%- if activity.socialIssues is not empty and t.socialIssuesVisible -%}
-
-
-
{{ 'Social issues'|trans }}
-
-
- {% for r in activity.socialIssues %}
-
- {{ r|chill_entity_render_box }}
-
- {% endfor %}
-
-
- {% endif %}
-
- {%- if activity.socialActions is not empty and t.socialActionsVisible -%}
-
-
-
{{ 'Social actions'|trans }}
-
-
- {% for r in activity.socialActions %}
-
- {{ r|chill_entity_render_box }}
-
- {% endfor %}
-
-
- {% endif %}
-
- {% if activity.comment.comment is not empty and is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) %}
-
-
-
{{ 'Comment'|trans }}
-
-
- {{ activity.comment|chill_entity_render_box({
- 'disable_markdown': false,
- 'limit_lines': 3,
- 'metadata': false
- }) }}
-
-
- {% endif %}
-
- {# Only if ACL SEE_DETAILS AND/OR only on template SHOW ??
- durationTime
- travelTime
- comment
- documents
- attendee
- #}
-
-
-
- {% set notifications = chill_list_notifications('Chill\\ActivityBundle\\Entity\\Activity', activity.id) %}
- {% if notifications is not empty %}
-
- {{ notifications|raw }}
-
- {% endif %}
-
-
-
- {% if no_action is not defined or no_action == false %}
- -
- {{ 'notification.Notify'|trans }}
-
- {% endif %}
- {% if context == 'person' and activity.accompanyingPeriod is not empty %}
- {#
- Disable person_id in following links, for redirect to accompanyingCourse context
- #}
- {% set person_id = null %}
- {% set accompanying_course_id = activity.accompanyingPeriod.id %}
- -
-
-
- {{ 'Period number %number%'|trans({'%number%': accompanying_course_id}) }}
-
-
- {% endif %}
- -
-
-
- {% if no_action is not defined or no_action == false %}
- {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
- -
-
-
- {% endif %}
- {% if is_granted('CHILL_ACTIVITY_DELETE', activity) %}
- -
-
-
- {% endif %}
- {% endif %}
-
-
-
-
+ {% include 'ChillActivityBundle:Activity:_list_item.html.twig' with {
+ 'context': context,
+ 'recordAction': _self.recordAction(activity, context, person_id, accompanying_course_id)
+ } %}
{% endfor %}
{% endif %}