{% macro render_time_and_location(obj, editable, use_event_tz, is_session_timetable=false) %}
    {% set tt_entry = obj.timetable_entry %}
    {% set event = tt_entry.event %}
    {% set tz = event.tzinfo if use_event_tz else event.display_tzinfo %}
    <dl class="i-data-list">
        {% if editable and not event.is_locked %}
            <dt>
                <a class="i-link icon-time js-edit-time"
                   title="{% trans %}Change time{% endtrans %}"></a>
            </dt>
            <dd>
                <div class="duration">
                    <a class="js-edit-time"
                       title="{% trans %}Change time{% endtrans %}">
                        {{- tt_entry.start_dt | format_time(timezone=tz) }} -
                        {{ tt_entry.end_dt | format_time(timezone=tz) -}}
                    </a>
                </div>
            </dd>
        {% else %}
            <dt class="icon-time"></dt>
            <dd>
                {{- tt_entry.start_dt | format_time(timezone=tz) }} -
                {{ tt_entry.end_dt | format_time(timezone=tz) -}}
            </dd>
        {% endif %}
        {% block venue_info_balloon scoped %}
            {% if obj.venue_name %}
                <dt><i class='icon-location'></i></dt>
                <dd>
                    <div>{{ obj.room_name }} ({{ obj.venue_name }})</div>
                    {% if obj.address %}
                        <div class="address">{{ obj.address }}</div>
                    {% endif %}
                </dd>
            {% endif %}
        {% endblock %}
    </dl>
{% endmacro %}

{% macro render_palette_picker(obj, endpoint, color_list, is_session_timetable) %}
    <button class="i-button color-button palette-picker palette-picker-trigger"
            style="{{ obj.colors.css }}"
            data-method="PATCH"
            data-href="{{ url_for(endpoint, obj, is_session_timetable=is_session_timetable|int) }}"
            data-palette="{{ color_list | tojson | forceescape }}"
            data-initial-color="{{ obj.colors | tojson | forceescape }}"
            title="{% trans %}Change color{% endtrans %}">
    </button>
{% endmacro %}
