<commit_before>{% extends 'events/abstracts/management/_base.html' %}
{% from 'events/abstracts/_abstract.html' import render_abstract_public, render_abstract_comments, render_edited_hint %}

{% block content %}
    {{ render_abstract_public(abstract, management=true) }}
    <div id="abstract-private" class="i-timeline">
        <div class="i-timetable-connect-down"></div>
        <div class="i-timeline-separator"></div>
        {{ render_abstract_comments(abstract) }}
        {{ _render_abstract_reviews(abstract) }}
        <div class="i-timeline-separator"></div>
        <div class="i-timetable-connect-up"></div>
        {{ _render_decision_box(abstract) }}
    </div>
{% endblock %}

{% macro _render_abstract_reviews(abstract) %}
    <div id="abstract-reviews" class="i-timeline">
        {% set reviews = abstract.reviews|selectattr('track', 'equalto', none)|list %}
        {% if reviews %}
            <h3>{% trans %}No track{% endtrans %}</h3>
            {% for review in reviews %}
                {{ _render_review(review) }}
            {% endfor %}
        {% endif %}
        {% for track in abstract.reviewed_for_tracks %}
            {% set reviews = abstract.reviews|selectattr('track', 'equalto', track)|list %}
            {% if reviews %}
                <h3>
                    {% trans title=track.title -%}
                        Track: {{ title }}
                    {%- endtrans %}
                </h3>
                {% for review in reviews %}
                    {{ _render_review(review) }}
                {% endfor %}
            {% endif %}
        {% endfor %}
    </div>
{% endmacro %}

{% macro _render_review(review) %}
    <div class="i-timeline-item">
        <div class="i-timeline-item-label action abstract-comment-pic"></div>
        <div class="i-timeline-item-box header-indicator">
            <div class="i-box-header flex">
                <div class="stretch">
                    {% trans name=review.user.name, date=review.created_dt|format_human_date -%}
                        <strong>{{ name }}</strong> reviewed on {{ date }}
                    {%- endtrans %}
                    {% if review.modified_dt %}
                        {{ render_edited_hint(comment.modified_dt) }}
                    {% endif %}
                </div>
                <div class="abstract-comment-badges">
                    <span>
                        {% trans action=_render_review_state(review) %}
                            Proposes to {{ action }}
                        {% endtrans %}
                    </span>
                    {% if review.score %}
                        {% set score = review.score %}
                        {# TODO: show max score #}
                        <span class="i-tag text-color highlight" title="{% trans %}Score: {{ score }}/...{% endtrans %}">
                            {{ score }}
                        </span>
                    {% endif %}
                </div>
            </div>
            {% if review.ratings %}
                {% for rating in review.ratings %}
                    <div>
                        {# TODO: UI #}
                        {{ rating.question.text }}
                        {{ rating.value }}
                    </div>
                {% endfor %}
            {% endif %}
            {% if review.comment %}
                <div class="titled-rule">
                    {% trans %}Comment{% endtrans %}
                </div>
                <div class="i-box-content">
                    {{ review.comment }}
                </div>
            {% endif %}
        </div>
    </div>
{% endmacro %}

{% macro _render_decision_box(abstract) %}
    <div id="abstract-decision-box" class="i-timeline-item">
        <div class="i-timeline-item-label action icon-hammer"></div>
        <div class="i-timeline-item-box content-indicator">
            <div class="i-box-content">
                <div class="flex">
                    <div class="stretch">
                        <strong>
                            {% trans %}Review summary{% endtrans %}
                        </strong>
                    </div>
                    <div class="abstract-comment-badges">
                        {% trans state=_render_abstract_reviewing_state(abstract) -%}
                            Reviews are {{ state }}
                        {%- endtrans %}
                        {% if abstract.score %}
                            {% set score = abstract.score|round(1) %}
                            {# TODO: show max score #}
                            <span class="i-tag highlight" title="{% trans %}Score: {{ score }}/...{% endtrans %}">
                                {{ score }}
                            </span>
                        {% endif %}
                    </div>
                </div>
                {% for track in abstract.reviewed_for_tracks %}
                    <div class="track-review flex">
                        <div class="stretch">
                            {{ track.title }}
                        </div>
                        <div>
                            {{ _render_abstract_track_reviewing_state(abstract, track) }}
                            {% set score = abstract.get_track_score(track) %}
                            {% if score is not none %}<commit_msg>Sort tracks by title in abstract decision box<commit_after>{% extends 'events/abstracts/management/_base.html' %}
{% from 'events/abstracts/_abstract.html' import render_abstract_public, render_abstract_comments, render_edited_hint %}

{% block content %}
    {{ render_abstract_public(abstract, management=true) }}
    <div id="abstract-private" class="i-timeline">
        <div class="i-timetable-connect-down"></div>
        <div class="i-timeline-separator"></div>
        {{ render_abstract_comments(abstract) }}
        {{ _render_abstract_reviews(abstract) }}
        <div class="i-timeline-separator"></div>
        <div class="i-timetable-connect-up"></div>
        {{ _render_decision_box(abstract) }}
    </div>
{% endblock %}

{% macro _render_abstract_reviews(abstract) %}
    <div id="abstract-reviews" class="i-timeline">
        {% set reviews = abstract.reviews|selectattr('track', 'equalto', none)|list %}
        {% if reviews %}
            <h3>{% trans %}No track{% endtrans %}</h3>
            {% for review in reviews %}
                {{ _render_review(review) }}
            {% endfor %}
        {% endif %}
        {% for track in abstract.reviewed_for_tracks %}
            {% set reviews = abstract.reviews|selectattr('track', 'equalto', track)|list %}
            {% if reviews %}
                <h3>
                    {% trans title=track.title -%}
                        Track: {{ title }}
                    {%- endtrans %}
                </h3>
                {% for review in reviews %}
                    {{ _render_review(review) }}
                {% endfor %}
            {% endif %}
        {% endfor %}
    </div>
{% endmacro %}

{% macro _render_review(review) %}
    <div class="i-timeline-item">
        <div class="i-timeline-item-label action abstract-comment-pic"></div>
        <div class="i-timeline-item-box header-indicator">
            <div class="i-box-header flex">
                <div class="stretch">
                    {% trans name=review.user.name, date=review.created_dt|format_human_date -%}
                        <strong>{{ name }}</strong> reviewed on {{ date }}
                    {%- endtrans %}
                    {% if review.modified_dt %}
                        {{ render_edited_hint(comment.modified_dt) }}
                    {% endif %}
                </div>
                <div class="abstract-comment-badges">
                    <span>
                        {% trans action=_render_review_state(review) %}
                            Proposes to {{ action }}
                        {% endtrans %}
                    </span>
                    {% if review.score %}
                        {% set score = review.score %}
                        {# TODO: show max score #}
                        <span class="i-tag text-color highlight" title="{% trans %}Score: {{ score }}/...{% endtrans %}">
                            {{ score }}
                        </span>
                    {% endif %}
                </div>
            </div>
            {% if review.ratings %}
                {% for rating in review.ratings %}
                    <div>
                        {# TODO: UI #}
                        {{ rating.question.text }}
                        {{ rating.value }}
                    </div>
                {% endfor %}
            {% endif %}
            {% if review.comment %}
                <div class="titled-rule">
                    {% trans %}Comment{% endtrans %}
                </div>
                <div class="i-box-content">
                    {{ review.comment }}
                </div>
            {% endif %}
        </div>
    </div>
{% endmacro %}

{% macro _render_decision_box(abstract) %}
    <div id="abstract-decision-box" class="i-timeline-item">
        <div class="i-timeline-item-label action icon-hammer"></div>
        <div class="i-timeline-item-box content-indicator">
            <div class="i-box-content">
                <div class="flex">
                    <div class="stretch">
                        <strong>
                            {% trans %}Review summary{% endtrans %}
                        </strong>
                    </div>
                    <div class="abstract-comment-badges">
                        {% trans state=_render_abstract_reviewing_state(abstract) -%}
                            Reviews are {{ state }}
                        {%- endtrans %}
                        {% if abstract.score %}
                            {% set score = abstract.score|round(1) %}
                            {# TODO: show max score #}
                            <span class="i-tag highlight" title="{% trans %}Score: {{ score }}/...{% endtrans %}">
                                {{ score }}
                            </span>
                        {% endif %}
                    </div>
                </div>
                {% for track in abstract.reviewed_for_tracks|sort(attribute='title') %}
                    <div class="track-review flex">
                        <div class="stretch">
                            {{ track.title }}
                        </div>
                        <div>
                            {{ _render_abstract_track_reviewing_state(abstract, track) }}
                            {% set score = abstract.get_track_score(track) %}
                            {% if score is not none %}
{'fraction_non_alphanumeric': 0.13664249860568878, 'fraction_numerical': 0.0009295408068414204, 'mean_word_length': 1.227536231884058, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7321155', 'n_tokens_mistral': 2949, 'n_tokens_neox': 2574, 'n_words': 513}