
<%page args="app"/>

<%
def application(app):
    id_query = u'?id=' + app['id']
    unstoppable = ''
    if app['unstoppable']:
        unstoppable = 'unstoppable'
    q = app.get('queued')
    qa = app.get('active')
    qf = app.get('failed')
    qs = app.get('success')
    return u'''
        <tr class="{unstoppable}">
            <td class="path">{q}</td>
            <td class="path">{qa}</td>
            <td class="path">
                <a class="failed" href="/failed{id_query}">{qf}</a>
            </td>
            <td class="path">{qs}</td>
            <td class="actions">
                <a href="/trace{id_query}">Trace</a> |
                <a class="action start" data-action="start" href="/unpause{id_query}">Start</a> |
                <a class="action stop" data-action="stop" href="/pause{id_query}">Stop</a> |
                <a class="action unload" data-action="unload" href="/unload{id_query}">Remove</a>
            </td>
            <td class="status">{app[status]}</td>
            <td class="queue">{app[queue]}</td>
            <td class="name">{app[name]}</td>
            <td class="entry">{app[entry]}</td>
            <td class="path">{app[path]}</td>
            <td class="id">{app[id]}</td>

        </tr>
    '''.format(**vars())
%>
${application(app)}