<commit_before>{% if initial %}

    {% include "snippets/read/read-endless-initial-loading.html" %}
    {% include "snippets/read/read-endless-no-items.html" %}

    {% comment %}
        At first, I used the lazy paginate mechanism to generate an official
        "show_more" div, to allow the whole mecanism to be completely DRY,
        without creating any exception for the first page.

        But then, the 1st page gets munged and never displays; results start
        at page 2… Besides, instanciating the `lazy_paginate` just for a <div>
        make the first page loading "not so fast", because `endless` is acting.

        Thus, this is a completely fake "show_more". Hard-coded. With this,
        the first page comes blazingly fast, and results are loaded totally
        asynchronously.
    {% endcomment %}

    <div id="initial-endless-container" class="endless_container">
        <a class="endless_more" href="{{ request.path }}?page=1"
            rel="page"> {% trans "Load more entries" %}"</a>
        <div class="endless_loading">{% trans "Loading…" %}</div>
    </div>

{% else %}

    {% with items_per_fetch=config.READ_INFINITE_ITEMS_PER_FETCH %}

        {% lazy_paginate items_per_fetch reads %}

            {% for read in reads %}
                {% if read.article.url_absolute and not read.article.duplicate_of %}

                    {% include preferences.home.get_read_list_item_template %}

                {% elif user.is_superuser and preferences.staff.super_powers_enabled and preferences.staff.reading_lists_show_bad_articles %}
                    <li class="read-list-item">
                        {% with read.article as article %}

                            {% include "snippets/read/read-admin-informations.html" with nohide=1 %}

                            <div style="text-align: center">

                                {% if article.url_absolute %}
                                    <code style="color: green">absolute</code>

                                {% else %}
                                    <code style="color: red">NOT-absolute</code>, {{ article.url_error }}

                                {% endif %}

                                {% if article.orphaned %}
                                    <code style="color: red">orphaned</code>
                                {% endif %}

                                {% if article.duplicate_of %}
                                    duplicate of: <a
                                    href="{{ NONREL_ADMIN }}article/{{ article.duplicate_of.id }}/"
                                    target="_blank">{{ article.duplicate_of.id }}</a>
                                {% endif %}

                            </div>
                        {% endwith %}
                    <li>
                {% endif %}
            {% endfor %}

        {% comment %}
            The 'show_more' button is hidden via CSS, don't try to find
            it in the page. But it must be present because it holds the
            necessary data to load the next page.
        {% endcomment %}

        {% show_more _('Load more items') _('<i class="icon-spinner icon-spin icon-large"></i>&nbsp;&nbsp;Loading more items…') %}

    {% endwith %}

{% endif %}
<commit_msg>Refresh the display of "bad" articles for staff users.<commit_after>{% if initial %}

    {% include "snippets/read/read-endless-initial-loading.html" %}
    {% include "snippets/read/read-endless-no-items.html" %}

    {% comment %}
        At first, I used the lazy paginate mechanism to generate an official
        "show_more" div, to allow the whole mecanism to be completely DRY,
        without creating any exception for the first page.

        But then, the 1st page gets munged and never displays; results start
        at page 2… Besides, instanciating the `lazy_paginate` just for a <div>
        make the first page loading "not so fast", because `endless` is acting.

        Thus, this is a completely fake "show_more". Hard-coded. With this,
        the first page comes blazingly fast, and results are loaded totally
        asynchronously.
    {% endcomment %}

    <div id="initial-endless-container" class="endless_container">
        <a class="endless_more" href="{{ request.path }}?page=1"
            rel="page"> {% trans "Load more entries" %}"</a>
        <div class="endless_loading">{% trans "Loading…" %}</div>
    </div>

{% else %}

    {% with items_per_fetch=config.READ_INFINITE_ITEMS_PER_FETCH %}

        {% lazy_paginate items_per_fetch reads %}

            {% for read in reads %}
                {% if read.article.is_good %}

                    {% include preferences.home.get_read_list_item_template %}

                {% elif mongodb_user.is_staff_or_superuser_and_enabled and preferences.staff.reading_lists_show_bad_articles %}

                    <li class="read-list-item">
                        {% with read.article as article %}

                            {% include "snippets/read/read-admin-informations.html" with nohide=1 %}

                            <div style="text-align: center">

                                {% if article.url_absolute %}
                                    <code style="color: green">absolute</code>

                                {% else %}
                                    <code style="color: red">NOT-absolute</code>

                                {% endif %}

                                {% if article.orphaned %}
                                    <code style="color: red">orphaned</code>
                                {% endif %}

                                {% if article.duplicate_of %}
                                    duplicate of: <a
                                    href="{{ NONREL_ADMIN }}article/{{ article.duplicate_of.id }}/"
                                    target="_blank">{{ article.duplicate_of.id }}</a>
                                {% endif %}

                                {% if article.url_error %}
                                    <div class="url_error">{{ article.url_error }}</div>
                                {% endif %}

                                {% if article.content_error %}
                                    <div class="content_error">{{ article.content_error }}</div>
                                {% endif %}
                            </div>
                        {% endwith %}
                    <li>
                {% endif %}
            {% endfor %}

        {% comment %}
            The 'show_more' button is hidden via CSS, don't try to find
            it in the page. But it must be present because it holds the
            necessary data to load the next page.
        {% endcomment %}

        {% show_more _('Load more items') _('<i class="icon-spinner icon-spin icon-large"></i>&nbsp;&nbsp;Loading more items…') %}

    {% endwith %}

{% endif %}

{'fraction_non_alphanumeric': 0.10883075588957943, 'fraction_numerical': 0.0011562364503540975, 'mean_word_length': 1.4687834463075276, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 34, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2558473', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1668, 'n_words': 482}