<commit_before>{% from 'events/display/common/_manage_button.html' import render_manage_button %}
{% from 'events/display/indico/_common.html' import render_location, render_users %}
{% from 'events/timetable/display/indico/_common.html' import render_attachments, render_notes, render_description,
                                                              render_time %}
{% from 'events/timetable/display/indico/_contribution.html' import render_contribution %}
{% from 'events/timetable/display/indico/_break.html' import render_break %}

{% macro render_session_block(block, event, parent=none, timezone=none, show_notes=false, hide_contribs=false) %}
    {% set session_ = block.session %}
    {% set entries = block.timetable_entry.children %}

    <li class="timetable-item" id="session-{{ session_.id }}">
        <span class="timetable-time top-level">
            {{ render_time(block, timezone=timezone, hide_end_time=hide_end_time) }}
        </span>
        <div class="timetable-item-body">
            <div class="timetable-item-header">
                <span class="timetable-title {{ 'top-level' if not nested }}">
                    {%- if block.title and block.title != session_.title -%}
                        {#- TODO: remove '| safe' once we start enforcing no-HTML policy -#}
                        {{- session_.title | safe -}}: {{ block.title | safe -}}
                    {%- else -%}
                        {#- TODO: remove '| safe' once we start enforcing no-HTML policy -#}
                        {{- session_.title | safe -}}
                    {%- endif -%}
                </span>
                {% if not block.inherit_location and block.has_location_info -%}
                    {{ render_location(block, parent=event) }}
                {%- endif %}
                <div class="timetable-item-actions">
                    {{ render_manage_button(block, 'SESSION_BLOCK', show_notes=show_notes,
                                            show_button=(not event.as_legacy.isClosed() and
                                                         block.can_manage_attachments(session.user))) }}
                    {{ template_hook('vc-actions', event=event, item=block) }}
                </div>
            </div>
            {% if session_.description %}
                {{ render_description(session_, class='session-description') }}
            {% endif %}

            {% set conveners = block.person_links %}
            {% if conveners %}
                <div class="convener-list">
                    <span class="label">{{ ngettext("Convener", "Conveners", conveners|length) }}</span>:
                    {{ render_users(conveners) -}}
                </div>
            {% endif %}


            <table class="timetable-item-details session-details">
                <tbody>
                    {{ render_attachments(session_) }}
                </tbody>
            </table>

            {{ render_notes(session_) }}

            {% if entries and not hide_contribs -%}
                <ul class="meeting-sub-timetable">
                    {# It's impossible to sort by `lambda:` with Jinja, hence the double-sort #}
                    {% for entry in entries|sort(attribute='object.title')|sort(attribute='start_dt') %}
                        {% if entry.type.name == 'CONTRIBUTION' and entry.object.can_access(session.user) %}
                            {{ render_contribution(entry.contribution, event, nested=true, hide_end_time=true,
                                                   show_notes=show_notes, timezone=timezone, parent=block) }}
                        {% elif entry.type.name == 'BREAK' %}
                            {{ render_break(entry.break_, event, nested=true, hide_end_time=true, timezone=timezone) }}
                        {% endif %}
                    {% endfor %}
                </ul>
            {%- endif %}
        </div>
    </li>
{% endmacro %}
<commit_msg>Fix hiding of session block location<commit_after>{% from 'events/display/common/_manage_button.html' import render_manage_button %}
{% from 'events/display/indico/_common.html' import render_location, render_users %}
{% from 'events/timetable/display/indico/_common.html' import render_attachments, render_notes, render_description,
                                                              render_time %}
{% from 'events/timetable/display/indico/_contribution.html' import render_contribution %}
{% from 'events/timetable/display/indico/_break.html' import render_break %}

{% macro render_session_block(block, event, parent=none, timezone=none, show_notes=false, hide_contribs=false) %}
    {% set session_ = block.session %}
    {% set entries = block.timetable_entry.children %}

    <li class="timetable-item" id="session-{{ session_.id }}">
        <span class="timetable-time top-level">
            {{ render_time(block, timezone=timezone, hide_end_time=hide_end_time) }}
        </span>
        <div class="timetable-item-body">
            <div class="timetable-item-header">
                <span class="timetable-title {{ 'top-level' if not nested }}">
                    {%- if block.title and block.title != session_.title -%}
                        {#- TODO: remove '| safe' once we start enforcing no-HTML policy -#}
                        {{- session_.title | safe -}}: {{ block.title | safe -}}
                    {%- else -%}
                        {#- TODO: remove '| safe' once we start enforcing no-HTML policy -#}
                        {{- session_.title | safe -}}
                    {%- endif -%}
                </span>
                {% if not (block.inherit_location and block.session.inherit_location) and block.has_location_info -%}
                    {{ render_location(block, parent=event) }}
                {%- endif %}
                <div class="timetable-item-actions">
                    {{ render_manage_button(block, 'SESSION_BLOCK', show_notes=show_notes,
                                            show_button=(not event.as_legacy.isClosed() and
                                                         block.can_manage_attachments(session.user))) }}
                    {{ template_hook('vc-actions', event=event, item=block) }}
                </div>
            </div>
            {% if session_.description %}
                {{ render_description(session_, class='session-description') }}
            {% endif %}

            {% set conveners = block.person_links %}
            {% if conveners %}
                <div class="convener-list">
                    <span class="label">{{ ngettext("Convener", "Conveners", conveners|length) }}</span>:
                    {{ render_users(conveners) -}}
                </div>
            {% endif %}


            <table class="timetable-item-details session-details">
                <tbody>
                    {{ render_attachments(session_) }}
                </tbody>
            </table>

            {{ render_notes(session_) }}

            {% if entries and not hide_contribs -%}
                <ul class="meeting-sub-timetable">
                    {# It's impossible to sort by `lambda:` with Jinja, hence the double-sort #}
                    {% for entry in entries|sort(attribute='object.title')|sort(attribute='start_dt') %}
                        {% if entry.type.name == 'CONTRIBUTION' and entry.object.can_access(session.user) %}
                            {{ render_contribution(entry.contribution, event, nested=true, hide_end_time=true,
                                                   show_notes=show_notes, timezone=timezone, parent=block) }}
                        {% elif entry.type.name == 'BREAK' %}
                            {{ render_break(entry.break_, event, nested=true, hide_end_time=true, timezone=timezone) }}
                        {% endif %}
                    {% endfor %}
                </ul>
            {%- endif %}
        </div>
    </li>
{% endmacro %}

{'fraction_non_alphanumeric': 0.12907268170426064, 'fraction_numerical': 0.0, 'mean_word_length': 1.6692307692307693, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4629713', 'n_tokens_mistral': 2214, 'n_tokens_neox': 1979, 'n_words': 389}