{% extends 'OroActivityListBundle:ActivityList/js:activityItemTemplate.html.twig' %}
{% import 'OroActivityBundle::macros.html.twig' as AC %}
{% set entityClass = 'Oro\\Bundle\\CalendarBundle\\Entity\\CalendarEvent' %}
{% set entityName = oro_entity_config_value(entityClass, 'label')|trans %}
{% block activityDetails %}
{{ entityName }}
<% if (owner || owner_url) { %>
<% var template = (verb == 'create')
? {{ 'oro.calendar.calendarevent.added_by'|trans|json_encode|raw }}
: {{ 'oro.calendar.calendarevent.updated_by'|trans|json_encode|raw }}; %>
<%= _.template(template, { interpolate: /\{\{(.+?)\}\}/g })({
user: owner_url ? '' + _.escape(owner) + '' : '' + _.escape(owner) + '',
date: '' + createdAt + '',
editor: editor_url ? '' + _.escape(editor) + '' : _.escape(editor),
editor_date: '' + updatedAt + ''
}) %>
<% } %>
{% endblock %}
{% block activityActions %}
{% import 'OroActivityBundle::macros.html.twig' as AC %}
{% set action %}
{# Add button for add context in the activity list item #}
{% if is_granted('oro_calendar_event_update') %}
{{ AC.activity_context_link() }}
{% endif %}
{% endset %}
{% set actions = [action] %}
{% set action %}
{{ 'oro.calendar.calendarevent.view_event'|trans({'{{ entity }}': entityName}) }}
{{ 'oro.calendar.calendarevent.view_event'|trans({'{{ entity }}': entityName}) }}
{% endset %}
{% set actions = actions|merge([action]) %}
{% set action %}
<% if (editable) { %>
{{ 'oro.calendar.calendarevent.update_event'|trans({'{{ entity }}': entityName}) }}
{{ 'oro.calendar.calendarevent.update_event'|trans({'{{ entity }}': entityName}) }}
<% } %>
{% endset %}
{% set actions = actions|merge([action]) %}
{% set action %}
<% if (removable) { %>
{{ 'oro.calendar.calendarevent.delete_event'|trans({'{{ entity }}': entityName}) }}
{{ 'oro.calendar.calendarevent.delete_event'|trans({'{{ entity }}': entityName}) }}
<% } %>
{% endset %}
{% set actions = actions|merge([action]) %}
{{ parent() }}
{% endblock %}