{% extends 'Layout.twig' %}

{% block content %}
    <h1 class="lead">Projects</h1>

    <hr />

    {% if projects|length > 0 %}

        <table class="table table-bordered">
            <thead>
                <tr>
                    <th>Repo</th>
                    <th>Last Run</th>
                    <th>Status</th>
                </tr>
            </thead>
            <tbody>
                {% for project in projects %}

                    {% if project.status.code == '0' %}
                        {% set project_class = 'error' %}
                    {% elseif project.status.code == '1' %}
                        {% set project_class = 'success' %}
                    {% elseif project.status.code == '2' %}
                        {% set project_class = 'warning' %}
                    {% endif %}

                    <tr class="{{ project_class }}" >
                        <td>
                            <a href="/project/{{ project._id }}">
                                {{ project.repo }}
                            </a>
                        </td>
                        <td>{{ project.last_run.sec|date('H:i - jS F Y') }}</td>
                        <td>{{ project.status.message }}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p class="alert alert-danger">There are no projects yet.</p>
    {% endif %}


{% endblock %}

{% extends 'Layout.twig' %}

{% block content %}
    <h1 class="lead">Projects</h1>

    <hr />

    {% if projects|length > 0 %}

        <table class="table table-bordered">
            <thead>
                <tr>
                    <th>Repo</th>
                    <th>Last Run</th>
                    <th>Status</th>
                    <th>Test</th>
                </tr>
            </thead>
            <tbody>
                {% for project in projects %}

                    {% if project.status.code == '0' %}
                        {% set project_class = 'error' %}
                    {% elseif project.status.code == '1' %}
                        {% set project_class = 'success' %}
                    {% elseif project.status.code == '2' %}
                        {% set project_class = 'warning' %}
                    {% endif %}

                    <tr class="{{ project_class }}" >
                        <td>
                            <a href="/project/{{ project._id }}">
                                {{ project.repo }}
                            </a>
                        </td>
                        <td>{{ project.last_run.sec|date('H:i - jS F Y') }}</td>
                        <td>{{ project.status.message }}</td>
                        <td>
                            <a class="btn btn-success btn-mini" href="/project/run/{{ project._id }}">
                                <i class="icon-play"></i> Test
                            </a>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p class="alert alert-danger">There are no projects yet.</p>
    {% endif %}


{% endblock %}

Add a "test" button to home page for project
Add a "test" button to home page for project
