<commit_before>{% load i18n %}
{% load hq_shared_tags %}

<script>
$(function () {
        function showReadable() {
        $('.form-data-raw').hide();
        $('.form-data-readable').show();
    }
    function showRaw() {
        $('.form-data-readable').hide();
        $('.form-data-raw').show();
    }
    $('.showReadable').click(showReadable);
    $('.showRaw').click(showRaw);
    $('.formDisplayToggle a').click(function () {
        $(this).tab('show');
        return false;
    });

    // On page load, initially set show readable
    showReadable();

    function showSkipped(show) {
        if (show) {
            $('.form-data-skipped').show();
            $('.form-data-skipped-spacer').hide();
            $('.form-data-hidden-values').each(function () {
                $(this).show();
            });
        } else {
            $('.form-data-skipped').hide();
            $('.form-data-skipped-spacer').show();
            $('.form-data-hidden-values').each(function () {
                var current = $(this).next();
                while (current.is('.form-data-question')) {
                    console.log(current);
                    if (!current.is('.form-data-skipped')) {
                        return;
                    }
                    current = current.next();
                }
                $(this).hide();
            });
        }
    }
    $('.showSkippedToggle').change(function () {
        showSkipped($(this).is(':checked'));
    }).each(function () {
        if ($('.form-data-skipped').length == 0) {
            $(this).parent('label').hide();
        }
    });
    showSkipped(false);
});
</script>

<div class="container">
    {% if question_list_not_found %}
    <div class="row-fluid">
        <div class="alert alert-warning clear-fix span6">
            <strong>{{ question_list_not_found.message }}</strong>
            <br/>
            {% trans "All data is listed as Unrecognized Data." %}
        </div>
    </div>
    {% else %}
    <ul class="nav nav-pills formDisplayToggle">
        <li class="active"><a href="#" class="showReadable">{% trans "Labels" %}</a></li>
        <li><a href="#" class="showRaw">{% trans "Question IDs" %}</a></li>
    </ul>
    <label class="checkbox">
        <input type="checkbox" class="showSkippedToggle"/>
        {% trans "Show questions in form that were not shown to the user" %}
        <span class="hq-help-template"
            data-title="{% trans "Questions not shown to the user" %}"
            data-content="{% trans "These questions were not shown to the user because their display conditions were not met." %}"
        ></span>
    </label>
    {% endif %}
    <table class="table table-bordered form-data-table">
        <tr>
            <th class="span6">
                <span class="form-data-readable">{% trans "Question" %}</span>
                <span class="form-data-raw">{% trans "Question ID" %}</span>
            </th>
            <th class="span6">{% trans "Response" %}</th>
        </tr>
        {% include 'reports/form/partials/single_form_tree.html' %}
    </table>
</div>
<commit_msg>Use container-fluid instead of container<commit_after>{% load i18n %}
{% load hq_shared_tags %}

<script>
$(function () {
        function showReadable() {
        $('.form-data-raw').hide();
        $('.form-data-readable').show();
    }
    function showRaw() {
        $('.form-data-readable').hide();
        $('.form-data-raw').show();
    }
    $('.showReadable').click(showReadable);
    $('.showRaw').click(showRaw);
    $('.formDisplayToggle a').click(function () {
        $(this).tab('show');
        return false;
    });

    // On page load, initially set show readable
    showReadable();

    function showSkipped(show) {
        if (show) {
            $('.form-data-skipped').show();
            $('.form-data-skipped-spacer').hide();
            $('.form-data-hidden-values').each(function () {
                $(this).show();
            });
        } else {
            $('.form-data-skipped').hide();
            $('.form-data-skipped-spacer').show();
            $('.form-data-hidden-values').each(function () {
                var current = $(this).next();
                while (current.is('.form-data-question')) {
                    console.log(current);
                    if (!current.is('.form-data-skipped')) {
                        return;
                    }
                    current = current.next();
                }
                $(this).hide();
            });
        }
    }
    $('.showSkippedToggle').change(function () {
        showSkipped($(this).is(':checked'));
    }).each(function () {
        if ($('.form-data-skipped').length == 0) {
            $(this).parent('label').hide();
        }
    });
    showSkipped(false);
});
</script>

<div class="container-fluid">
    {% if question_list_not_found %}
    <div class="row-fluid">
        <div class="alert alert-warning clear-fix span6">
            <strong>{{ question_list_not_found.message }}</strong>
            <br/>
            {% trans "All data is listed as Unrecognized Data." %}
        </div>
    </div>
    {% else %}
    <ul class="nav nav-pills formDisplayToggle">
        <li class="active"><a href="#" class="showReadable">{% trans "Labels" %}</a></li>
        <li><a href="#" class="showRaw">{% trans "Question IDs" %}</a></li>
    </ul>
    <label class="checkbox">
        <input type="checkbox" class="showSkippedToggle"/>
        {% trans "Show questions in form that were not shown to the user" %}
        <span class="hq-help-template"
            data-title="{% trans "Questions not shown to the user" %}"
            data-content="{% trans "These questions were not shown to the user because their display conditions were not met." %}"
        ></span>
    </label>
    {% endif %}
    <table class="table table-bordered form-data-table">
        <tr>
            <th class="span6">
                <span class="form-data-readable">{% trans "Question" %}</span>
                <span class="form-data-raw">{% trans "Question ID" %}</span>
            </th>
            <th class="span6">{% trans "Response" %}</th>
        </tr>
        {% include 'reports/form/partials/single_form_tree.html' %}
    </table>
</div>

{'fraction_non_alphanumeric': 0.1898391463608855, 'fraction_numerical': 0.0019111323459149545, 'mean_word_length': 1.9087540528022233, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 79, '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': '1220065', 'n_tokens_mistral': 1889, 'n_tokens_neox': 1796, 'n_words': 372}