<commit_before>{% extends 'Layout.twig' %}

{% block content %}

    <script>
        $(document).ready(function() {
            $('#show_ssh_keys').on('click', function() {
                $(this).parent().hide();
                $('#ssh_keys').show();
            });

            $('#edit_project').on('click', function() {
                $('#edit_project_form').toggle();
            });
        });
    </script>

    <h1 class="lead pull-left" style="margin-top:0">
        {% if project.provider %}
            <i class="icon-{{ project.provider }}"></i>
        {% endif %}
        {{ project.short_repo }}
    </h1>
    <div class="pull-right">
        <a href="/project/run/{{ project._id }}" class="btn btn-success btn-mini">
            <i class="icon-play"></i> Run Test
        </a>
        <a class="btn btn-primary btn-mini" id="edit_project" href="javascript::void(0)">
            <i class="icon-cog"></i> Edit Project
        </a>
    </div>
    <div style="clear:both"></div>

    <form method="post" action="" class="well hide" id="edit_project_form">
        <fieldset>
            <label>Repository</label>
            <input name="repo" class="span11" type="text" value="{{ project.repo }}">
            <p>
                <a id="show_ssh_keys" href="javascript:void(0)">View SSH Keys</a>
            </p>
            <div class="hide" id="ssh_keys">
                <label>Public SSH Key</label>
                <textarea class="span11" rows="5" name="ssh_key.public">{{ project.ssh_key.public }}</textarea>
                <label>Private SSH Key</label>
                <textarea class="span11" rows="5" name="ssh_key.private">{{ project.ssh_key.private }}</textarea>
            </div>
        </fieldset>
        <button type="submit" class="btn btn-small btn-info">Save</button>
    </form>

    {% if project.status.code == '0' %}
        <p class="alert alert-danger">
            Please be aware that the latest test in this project failed.
        </p>
    {% endif %}

    {% if tests|length > 0 %}

        <table class="table">
            <thead>
                <tr>
                    <th>Commit</th>
                    <th class="hidden-phone">Author</th>
                    <th class="hidden-phone">Branch</th>
                    <th class="hidden-phone">Started</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                {% for test in tests %}

                    {% if test.status.code == '0' %}
                        {% set status_class = 'error' %}
                    {% elseif test.status.code == '1' %}
                        {% set status_class = 'success' %}
                    {% elseif test.status.code == '3' %}
                        {% set status_class = 'warning' %}
                    {% elseif test.status.code == '4' %}
                        {% set status_class = 'info' %}
                    {% endif %}

                    <tr class="{{status_class}}" >
                        <td>
                            {% if test.commit is defined %}
                                {% if test.commit.url %}
                                    <a href="{{ test.commit.url }}">
                                        {{ test.commit.hash.short }}
                                    </a>
                                {% else %}
                                    {{test.commit.hash.short}}
                                {% endif %}
                            {% else %}
                                N/A
                            {% endif %}
                        </td>
                        <td class="hidden-phone">{% if test.commit is defined %} {{test.commit.author.name}}  {% else %} N/A {% endif %}</td>
                        <td class="hidden-phone">
                            {% if test.commit is defined %}
                                {% if test.commit.url %}
                                    <a href="{{ test.commit.branch.url }}">
                                        {{test.commit.branch.name}}
                                    </a>
                                {% else %}
                                    {{test.commit.branch.name}}
                                {% endif %}

                            {% else %}
                                N/A
                            {% endif %}
                        </td>
                        <td class="hidden-phone">
                            <span class="timeago" title="{{ test.started.sec|date('c') }}">
                                {{ test.started.sec|date('jS M Y') }}
                            </span>
                        </td>
                        <td width="16%">
                            <a class="btn btn-danger btn-mini hidden-phone" href="/test/delete/{{ test._id }}">
                                <i class="icon-remove"></i> Delete
                            </a>

                            <a class="btn btn-success btn-mini" href="/test/{{ test._id }}">
                                <i class="icon-zoom-in"></i> <span class="hidden-phone">View</span>
                            </a>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p class="alert alert-danger">There are no tests for this project yet.</p>
    {% endif %}


{% endblock %}
<commit_msg>Show branch on mobile on project test list<commit_after>{% extends 'Layout.twig' %}

{% block content %}

    <script>
        $(document).ready(function() {
            $('#show_ssh_keys').on('click', function() {
                $(this).parent().hide();
                $('#ssh_keys').show();
            });

            $('#edit_project').on('click', function() {
                $('#edit_project_form').toggle();
            });
        });
    </script>

    <h1 class="lead pull-left" style="margin-top:0">
        {% if project.provider %}
            <i class="icon-{{ project.provider }}"></i>
        {% endif %}
        {{ project.short_repo }}
    </h1>
    <div class="pull-right">
        <a href="/project/run/{{ project._id }}" class="btn btn-success btn-mini">
            <i class="icon-play"></i> Run Test
        </a>
        <a class="btn btn-primary btn-mini" id="edit_project" href="javascript::void(0)">
            <i class="icon-cog"></i> Edit Project
        </a>
    </div>
    <div style="clear:both"></div>

    <form method="post" action="" class="well hide" id="edit_project_form">
        <fieldset>
            <label>Repository</label>
            <input name="repo" class="span11" type="text" value="{{ project.repo }}">
            <p>
                <a id="show_ssh_keys" href="javascript:void(0)">View SSH Keys</a>
            </p>
            <div class="hide" id="ssh_keys">
                <label>Public SSH Key</label>
                <textarea class="span11" rows="5" name="ssh_key.public">{{ project.ssh_key.public }}</textarea>
                <label>Private SSH Key</label>
                <textarea class="span11" rows="5" name="ssh_key.private">{{ project.ssh_key.private }}</textarea>
            </div>
        </fieldset>
        <button type="submit" class="btn btn-small btn-info">Save</button>
    </form>

    {% if project.status.code == '0' %}
        <p class="alert alert-danger">
            Please be aware that the latest test in this project failed.
        </p>
    {% endif %}

    {% if tests|length > 0 %}

        <table class="table">
            <thead>
                <tr>
                    <th>Commit</th>
                    <th class="hidden-phone">Author</th>
                    <th>Branch</th>
                    <th class="hidden-phone">Started</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                {% for test in tests %}

                    {% if test.status.code == '0' %}
                        {% set status_class = 'error' %}
                    {% elseif test.status.code == '1' %}
                        {% set status_class = 'success' %}
                    {% elseif test.status.code == '3' %}
                        {% set status_class = 'warning' %}
                    {% elseif test.status.code == '4' %}
                        {% set status_class = 'info' %}
                    {% endif %}

                    <tr class="{{status_class}}" >
                        <td>
                            {% if test.commit is defined %}
                                {% if test.commit.url %}
                                    <a href="{{ test.commit.url }}">
                                        {{ test.commit.hash.short }}
                                    </a>
                                {% else %}
                                    {{test.commit.hash.short}}
                                {% endif %}
                            {% else %}
                                N/A
                            {% endif %}
                        </td>
                        <td class="hidden-phone">{% if test.commit is defined %} {{test.commit.author.name}}  {% else %} N/A {% endif %}</td>
                        <td>
                            {% if test.commit is defined %}
                                {% if test.commit.url %}
                                    <a href="{{ test.commit.branch.url }}">
                                        {{test.commit.branch.name}}
                                    </a>
                                {% else %}
                                    {{test.commit.branch.name}}
                                {% endif %}
                            {% else %}
                                N/A
                            {% endif %}
                        </td>
                        <td class="hidden-phone">
                            <span class="timeago" title="{{ test.started.sec|date('c') }}">
                                {{ test.started.sec|date('jS M Y') }}
                            </span>
                        </td>
                        <td width="16%">
                            <a class="btn btn-danger btn-mini hidden-phone" href="/test/delete/{{ test._id }}">
                                <i class="icon-remove"></i> Delete
                            </a>

                            <a class="btn btn-success btn-mini" href="/test/{{ test._id }}">
                                <i class="icon-zoom-in"></i> <span class="hidden-phone">View</span>
                            </a>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p class="alert alert-danger">There are no tests for this project yet.</p>
    {% endif %}


{% endblock %}

{'fraction_non_alphanumeric': 0.1536189069423929, 'fraction_numerical': 0.003877400295420975, 'mean_word_length': 1.0237250140108352, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 0, '>': 187, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5701835', 'n_tokens_mistral': 2983, 'n_tokens_neox': 2641, 'n_words': 557}