{% if services %}
    <div class="panel panel-default">
      <div class="panel-heading">Services  <a href="{% url 'ftpdeploy_service_add' %}" class="btn btn-default btn-xs pull-right"><i class="fa fa-plus"></i> Add Service</a></div>
      
    <table class="table table-hover">
        <thead>
            <tr>
                <th>Name</th>
                <th>Branch</th>
                <th class="center-text">Status</th>
                <th></th>
                <th width="110"></th>
            </tr>
        </thead>
        <tbody id="service-list">
            {% for service in services %}
                <tr>
                    <td>{{service.repo_name}}</td>
                    <td>{{service.repo_branch}}</td>
                    <td class="center-text">
                        {% if service.has_queue %}
                           <i class="fa fa-cog fa-spin c-highlight"></i>
                        {% else  %}  
                            <a href="{% url 'ftpdeploy_service_status' service.pk %}" class="service-list-status">
                                
                                {% if service.status %}
                                    <i class="fa fa-check c-ok" data-toggle="tooltip" data-placement="left" title="Last Check<br>{{service.updated}}"></i>
                                {% else %}
                                    <i class="fa fa-times c-remove" data-toggle="tooltip" data-placement="left" title="{{service.status_message}}"></i>
                                {% endif %}
                            </a>
                        {% endif %}
                    </td>
                    <td>
                        <span class="label label-success">{{service.deploys}}</span> 
                        {% if service.fail_deploys %}
                            <span class="label label-danger">{{service.fail_deploys}}</span>
                        {% endif %}
                    </td>
                    <td>
                        <div class="pull-right">
                            <a href="{% url 'ftpdeploy_service_manage' service.pk %}" class="btn btn-primary btn-xs">Manage </a>
                            <a href="{% url 'ftpdeploy_service_edit' service.pk %}" class="btn btn-primary btn-xs">Edit</a>
                        </div>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
    </div>
{% else %}
    <div class="well">
        <h4>You don't have any services yet!</h4>
         <p>Let's create some and start deploying!</p>
         
         <a href="{% url 'ftpdeploy_service_add' %}" class="btn btn-success"><i class="fa fa-plus"></i> Add Service</a>
    </div>
{% endif %}

