{% extends 'creme_core/bricks/base/hat-card.html' %} {% load i18n creme_bricks creme_cells creme_listview creme_perms creme_widgets %} {% load inner_edition_uri listify from creme_core_tags %} {% block brick_extra_class %}{{block.super}} activities-activity-card-brick{% endblock %} {% block card_intro_name %}{{block.super}} - {{object.type}} - {{object.sub_type}}{% endblock %} {% block card_intro_content %}{% endblock %} {% block card_title %} {{object|capfirst}} {% if not object.is_deleted and not object.sandbox %} {% cell_4_regularfield instance=object field="type" as type_cell %} {% cell_4_regularfield instance=object field="title" as title_cell %} {% cell_4_regularfield instance=object field="status" as status_cell %} {% listify type_cell title_cell status_cell as cells %} {% inner_edition_uri instance=object cells=cells as edition_uri %} {% brick_card_action id='edit' url=edition_uri enabled=user|has_perm_to_change:object %} {% endif %} {% endblock %} {% block card_indicators %} {% if object.end %} {% if object.end >= today %}
{% translate 'Future' context 'activities-activity' %}
{% else %}
{% translate 'Past' context 'activities-activity' %}
{% endif %} {% endif %} {% endblock %} {% block card_secondary %}
{{object.status}}
{% endblock %} {% block card_fields_title %}{% translate 'Dates' %}{% endblock %} {% block card_fields %} {% with ftype=object.floating_type NARROW=object.FloatingType.NARROW %}
{% translate 'Start' %} {% with start=object.start %} {% if start %} {{start|date:'DATE_FORMAT'}}{% if ftype == NARROW %} {% translate 'at' %} {{start|time:'H:i'}}{% endif %} {% else %} — {% endif %} {% brick_card_action_for_field instance=object field='start' user=user %} {% endwith %}
{% translate 'End' %} {% with end=object.end %} {% if end %} {{end|date:'DATE_FORMAT'}}{% if ftype == NARROW %} {% translate 'at' %} {{end|time:'H:i'}}{% endif %} {% else %} — {% endif %} {% endwith %}
{% with ftype=object.floating_type %} {% if ftype == object.FloatingType.FLOATING_TIME %}
{% translate 'Floating time' %}
{% elif ftype == object.FloatingType.FLOATING %}
{% translate 'Floating' context 'activities-activity' %}
{% endif %} {% if object.busy %}
{% translate 'Busy' %}
{% endif %} {% if object.is_all_day %}
{% translate 'All day' %}
{% endif %} {% endwith %}
{% endwith %} {% endblock %} {% block card_summary_title %}{% translate 'Summary' %}{% endblock %} {% block card_summary %} {% if participants_count %}
{% translate 'Participants' %} {% if participants_count >= max_entities %} {% blocktranslate count counter=participants_count %}{{counter}} Participant{% plural %}{{counter}} Participants{% endblocktranslate %} {% else %} {% for participant in participants %} {% widget_entity_hyperlink participant user %}{% if not forloop.last %}, {% endif %} {% endfor %} {% endif %}
{% endif %} {% if subjects %}
{% translate 'Subjects' %} {% for subject in subjects %} {% widget_entity_hyperlink subject user %}{% if not forloop.last %}, {% endif %} {% endfor %}
{% endif %} {% with minutes=object.minutes %}
{% translate 'Minutes' %} {% if minutes %}{{minutes|widget_urlize|linebreaks}}{% else %}—{% endif %} {% brick_card_action_for_field instance=object field='minutes' user=user %}
{% endwith %} {% endblock %}