{% extends 'admin-v2/layout.html.twig' %}

{% set script_controller='jobs/index' %}

{% set menu = 'admin_v2_jobs' %}

{% block main %}

    {{ web_macro.flash_messages() }}

    <form id="message-search-form" class="form-inline well well-sm" action="" method="get" novalidate>

        <div class="form-group">
            <input class="form-control" type="text" placeholder="{{'admin.crontab_job.name'|trans}}" name="name" value="{{ app.request.get('name') }}">
        </div>

        <div class="form-group">
            <input class="form-control" type="text" placeholder="{{'admin.crontab_job.class'|trans}}" name="class" value="{{ app.request.get('class') }}">
        </div>

        <div class="form-group">
            <input class="form-control" type="text" placeholder="{{'admin.crontab_job.resource'|trans}}" name="source" value="{{ app.request.get('source') }}">
        </div>

        <button class="btn btn-primary">{{'form.btn.search'|trans}}</button>

    </form>
    {% if jobs %}
        <table id="job-table" class="table table-striped table-hover">
            <thead>
            <tr>
                <th>{{'admin.crontab_job.name'|trans}}</th>
                <th>{{'admin.crontab_job.class'|trans}}</th>
                <th>{{'admin.crontab_job.resource'|trans}}</th>
                <th>{{'admin.crontab_job.last_time'|trans}}</th>
                <th>{{'admin.crontab_job.next_time'|trans}}</th>
                <th>{{'admin.crontab_job.enable_status'|trans}}</th>
                <th>{{'admin.crontab_job.operation'|trans}}</th>
            </tr>
            </thead>
            <tbody>
                {% for job in jobs %}
                    {% include 'admin-v2/developer/jobs/table-tr.html.twig' with {job:job} %}
                {% endfor %}
            </tbody>

        </table>
    {% else %}
        <div class="empty">{{'admin.crontab_job.empty_hint'|trans}}</div>
    {% endif %}
    {{ admin_macro.paginator(paginator) }}
{% endblock %}