<commit_before>{% load i18n %}
<div class="tab" id="sync-history-tab">
    {% if current_version %}
        <h2>{% blocktrans with version=current_version.version_number %}Current public tip is version #{{ version }}{% endblocktrans %}</h2>
    {% else %}
        <h2>{% trans "No current public tip" %}</h2>
    {% endif %}
    <h2>{% trans "Synced Versions" %}</h2>
    <table class="synced-versions">
        <tr>
            <td><h4>{% trans "Video URL" %}</h4></td>
            <td><h4>{% trans "Version" %}</h4></td>
            <td class="last"><h4>{% trans "Actions" %}</h4></td>
        </tr>
        {% for sync_info in synced_versions %}
        <tr>
            <td><a href="{{ sync_info.video_url.url }}">{{ sync_info.video_url.get_type_display }}</a></td>
            {% if sync_info.version %}
                <td> <a href="{{ sync_info.version.get_absolute_url }}">{{ sync_info.version.version_number }}</a></td>
            {% else %}
            <td>{% trans "None" %}</td>
            {% endif %}
            <td class="last">
                <form action="{% url externalsites:resync video_url_id=sync_info.video_url.id language_code=language.language_code %}" method="POST">
                    {% csrf_token %}
                    {% if current_version %}
                    <input type="submit" value="{% blocktrans with version=current_version.version_number%}resync version #{{ version }}{% endblocktrans %}">
                    {% else %}
                    <input type="submit" value="{% trans "delete subtitles" %}">
                    {% endif %}
                </form>
            </td>
        </tr>
        {% endfor %}
    </table>

    {% if sync_history %}
    <h2>{% trans "Sync History" %}</h2>
    <table class="sync-history">
        <tr>
            <td><h4>{% trans "Date" %}</h4></td>
            <td><h4>{% trans "Account" %}</h4></td>
            <td><h4>{% trans "Action" %}</h4></td>
            <td><h4>{% trans "Version" %}</h4></td>
            <td class="last"><h4>{% trans "Result" %}</h4></td>
        </tr>
        {% for item in sync_history %}
        <tr>
            <td> {{ item.datetime }}</td>
            <td> {{ item.get_account_type_display }}</td>
            <td> {{ item.get_action_display }}</td>
            <td> <a href="{{ item.version.get_absolute_url }}">{{ item.version.version_number }}</a></td>
            <td class="last"> {{ item.get_result_display }}</td>
        </tr>
         {% endfor %}
    </table>
    {% else %}
    <h3>{% trans "No Sync History" %}</h3>
    {% endif %}
</div>

<commit_msg>Show failure reason in the sync history tab (#933)<commit_after>{% load i18n %}
<div class="tab" id="sync-history-tab">
    {% if current_version %}
        <h2>{% blocktrans with version=current_version.version_number %}Current public tip is version #{{ version }}{% endblocktrans %}</h2>
    {% else %}
        <h2>{% trans "No current public tip" %}</h2>
    {% endif %}
    <h2>{% trans "Synced Versions" %}</h2>
    <table class="synced-versions">
        <tr>
            <td><h4>{% trans "Video URL" %}</h4></td>
            <td><h4>{% trans "Version" %}</h4></td>
            <td class="last"><h4>{% trans "Actions" %}</h4></td>
        </tr>
        {% for sync_info in synced_versions %}
        <tr>
            <td><a href="{{ sync_info.video_url.url }}">{{ sync_info.video_url.get_type_display }}</a></td>
            {% if sync_info.version %}
                <td> <a href="{{ sync_info.version.get_absolute_url }}">{{ sync_info.version.version_number }}</a></td>
            {% else %}
            <td>{% trans "None" %}</td>
            {% endif %}
            <td class="last">
                <form action="{% url externalsites:resync video_url_id=sync_info.video_url.id language_code=language.language_code %}" method="POST">
                    {% csrf_token %}
                    {% if current_version %}
                    <input type="submit" value="{% blocktrans with version=current_version.version_number%}resync version #{{ version }}{% endblocktrans %}">
                    {% else %}
                    <input type="submit" value="{% trans "delete subtitles" %}">
                    {% endif %}
                </form>
            </td>
        </tr>
        {% endfor %}
    </table>

    {% if sync_history %}
    <h2>{% trans "Sync History" %}</h2>
    <table class="sync-history">
        <tr>
            <td><h4>{% trans "Date" %}</h4></td>
            <td><h4>{% trans "Account" %}</h4></td>
            <td><h4>{% trans "Action" %}</h4></td>
            <td><h4>{% trans "Version" %}</h4></td>
            <td><h4>{% trans "Result" %}</h4></td>
            <td class="last"><h4>{% trans "Details" %}</h4></td>
        </tr>
        {% for item in sync_history %}
        <tr>
            <td> {{ item.datetime }}</td>
            <td> {{ item.get_account_type_display }}</td>
            <td> {{ item.get_action_display }}</td>
            <td> <a href="{{ item.version.get_absolute_url }}">{{ item.version.version_number }}</a></td>
            <td class="last"> {{ item.get_result_display }}</td>
            <td class="last"> {{ item.details }}</td>
        </tr>
         {% endfor %}
    </table>
    {% else %}
    <h3>{% trans "No Sync History" %}</h3>
    {% endif %}
</div>


{'fraction_non_alphanumeric': 0.2019212657750989, 'fraction_numerical': 0.011489922772650216, 'mean_word_length': 1.9764573991031391, 'pattern_counts': {'":': 0, '<': 177, '<?xml version=': 0, '>': 177, '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': '3393451', 'n_tokens_mistral': 1800, 'n_tokens_neox': 1683, 'n_words': 372}