{% extends "components/base.html" %}
{% block main_area %}
<h1>Ansible Jobs</h1>
<table class="table table-striped">
    <thead>
        <tr>
            <th>#</th>
            <th>Name</th>
            <th>Status</th>
            <th>Created</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
        {% for job in jobs %}
        <tr>
            <td>{{ forloop.counter }}</td>
            <td>{{ job.name }}</td>
            <td>{{ job.status }}</td>
            <td>{{ job.created_at }}</td>
            <td>
                <a href="{% url 'ansible_manager:job_detail' job.id %}" class="btn btn-info">View</a>
                <a href="{% url 'ansible_manager:run_job' job.id %}" class="btn btn-success">Run</a>
                <a href="{% url 'ansible_manager:edit_job' job.id %}" class="btn btn-warning">Edit</a>
                <a href="{% url 'ansible_manager:delete_job' job.id %}" class="btn btn-danger">Delete</a>
            </td>
        </tr>
        {% empty %}
        <tr>
            <td colspan="5">No jobs available.</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
<a href="{% url 'ansible_manager:create_job' %}" class="btn btn-primary">Create New Job</a>
{% endblock %}
