<commit_before>{% extends 'events/surveys/manage_survey_base.html' %}

{% block content %}
    {% if survey.state == states.not_ready %}
        {% include 'events/surveys/manage_survey_state/not_ready.html' %}
    {% elif survey.state == states.ready_to_open %}
        {% include 'events/surveys/manage_survey_state/ready_to_open.html' %}
    {% elif survey.state == states.active_and_clean %}
        {% include 'events/surveys/manage_survey_state/active_and_clean.html' %}
    {% elif survey.state == states.active_and_answered %}
        {% include 'events/surveys/manage_survey_state/active_and_answered.html' %}
    {% elif survey.state == states.finished %}
        {% include 'events/surveys/manage_survey_state/finished.html' %}
    {% endif %}

    {% if survey.state != states.not_ready %}
        <div class="action-box">
            <div class="section">
                <div class="icon icon-clipboard"></div>
                <div class="text">
                    <div class="label">
                        {% trans %}Questionnaire{% endtrans %}
                    </div>
                    {% trans %}Add, remove or modify questions{% endtrans %}
                </div>
                <div class="toolbar right">
                    <a href="{{ url_for('.manage_questionnaire', survey) }}" class="i-button icon-settings">
                        {% trans %}Manage{% endtrans %}
                    </a>
                </div>
            </div>
        </div>
    {% endif %}

    <div class="i-box titled">
        <div class="i-box-header">
            <div class="i-box-title">
                {% trans %}Submissions{% endtrans %}
            </div>
            <div class="i-box-buttons">
                <a href="{{ url_for('.survey_results', survey) }}" class="i-button icon-chart {{ 'disabled' if not survey.submissions }}">
                    {% trans %}Results{% endtrans %}
                </a>
                <button id="export-submissions" data-href="{{ url_for('.export_submissions', survey) }}"
                        class="i-button icon-file-excel js-submission-action" {{ 'disabled' if not survey.submissions }}>
                    {% trans %}Export{% endtrans %}
                </button>
                <button id="delete-submissions" data-href="{{ url_for('.delete_submissions', survey) }}"
                        data-title="{% trans %}Remove all selected submissions?{% endtrans %}"
                        data-confirm="{% trans %}Are you sure you want to remove all selected submissions?{% endtrans %}"
                        data-method="DELETE" class="i-button icon-remove" disabled>
                    {% trans %}Delete{% endtrans %}
                </button>
            </div>
        </div>
        <div class="i-box-content">
            <ul class="group-list with-buttons no-content-before">
                {%- for submission in survey.submissions %}
                    <li class="submission-row">
                        <input class="inline-vcentered submission-ids" type="checkbox" value="{{ submission.id }}">
                        <strong>{{ _render_submission_row(submission) }}</strong>
                        <span class="group right">
                            <a href="#" class="big icon-remove right js-delete-submission"
                               data-href="{{ url_for('.delete_submissions', survey) }}"
                               data-method="DELETE"
                               data-title="{% trans %}Remove submission?{% endtrans %}"
                               data-confirm="{% trans %}Are you sure you want to remove this submission?{% endtrans %}"
                               data-submission-id="{{ submission.id }}"></a>
                        </span>
                    </li>
                {% endfor -%}
                <li class="empty-message">{% trans %}There are no submissions.{% endtrans %}</li>
            </ul>
        </div><commit_msg>Hide submission list buttons if no submission<commit_after>{% extends 'events/surveys/manage_survey_base.html' %}

{% block content %}
    {% if survey.state == states.not_ready %}
        {% include 'events/surveys/manage_survey_state/not_ready.html' %}
    {% elif survey.state == states.ready_to_open %}
        {% include 'events/surveys/manage_survey_state/ready_to_open.html' %}
    {% elif survey.state == states.active_and_clean %}
        {% include 'events/surveys/manage_survey_state/active_and_clean.html' %}
    {% elif survey.state == states.active_and_answered %}
        {% include 'events/surveys/manage_survey_state/active_and_answered.html' %}
    {% elif survey.state == states.finished %}
        {% include 'events/surveys/manage_survey_state/finished.html' %}
    {% endif %}

    {% if survey.state != states.not_ready %}
        <div class="action-box">
            <div class="section">
                <div class="icon icon-clipboard"></div>
                <div class="text">
                    <div class="label">
                        {% trans %}Questionnaire{% endtrans %}
                    </div>
                    {% trans %}Add, remove or modify questions{% endtrans %}
                </div>
                <div class="toolbar right">
                    <a href="{{ url_for('.manage_questionnaire', survey) }}" class="i-button icon-settings">
                        {% trans %}Manage{% endtrans %}
                    </a>
                </div>
            </div>
        </div>
    {% endif %}

    <div class="i-box titled">
        <div class="i-box-header">
            <div class="i-box-title">
                {% trans %}Submissions{% endtrans %}
            </div>
            <div class="i-box-buttons">
                {% if survey.submissions %}
                    <a href="{{ url_for('.survey_results', survey) }}" class="i-button icon-chart">
                        {% trans %}Results{% endtrans %}
                    </a>
                    <button id="export-submissions" data-href="{{ url_for('.export_submissions', survey) }}"
                            class="i-button icon-file-excel js-submission-action">
                        {% trans %}Export{% endtrans %}
                    </button>
                    <button id="delete-submissions" data-href="{{ url_for('.delete_submissions', survey) }}"
                            data-title="{% trans %}Remove all selected submissions?{% endtrans %}"
                            data-confirm="{% trans %}Are you sure you want to remove all selected submissions?{% endtrans %}"
                            data-method="DELETE" class="i-button icon-remove" disabled>
                        {% trans %}Delete{% endtrans %}
                    </button>
                {% endif %}
            </div>
        </div>
        <div class="i-box-content">
            <ul class="group-list with-buttons no-content-before">
                {%- for submission in survey.submissions %}
                    <li class="submission-row">
                        <input class="inline-vcentered submission-ids" type="checkbox" value="{{ submission.id }}">
                        <strong>{{ _render_submission_row(submission) }}</strong>
                        <span class="group right">
                            <a href="#" class="big icon-remove right js-delete-submission"
                               data-href="{{ url_for('.delete_submissions', survey) }}"
                               data-method="DELETE"
                               data-title="{% trans %}Remove submission?{% endtrans %}"
                               data-confirm="{% trans %}Are you sure you want to remove this submission?{% endtrans %}"
                               data-submission-id="{{ submission.id }}"></a>
                        </span>
                    </li>
                {% endfor -%}
                <li class="empty-message">{% trans %}There are no submissions.{% endtrans %}</li>
            </ul>
        </div>
{'fraction_non_alphanumeric': 0.1447005762966675, 'fraction_numerical': 0.0, 'mean_word_length': 1.6113837095191363, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5041965', 'n_tokens_mistral': 2263, 'n_tokens_neox': 1982, 'n_words': 440}