{% extends 'creme_core/bricks/base/table.html' %} {% load i18n creme_bricks %}{% load is_ajax url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} creme_core-job-brick{% endblock %} {% block brick_script %}{# TODO: in .js ?? #} {% if not request|is_ajax and not job.is_finished %} {% endif %} {% endblock %} {% block brick_header_title %} {% brick_header_title title=verbose_name %}{# TODO: change icon ? icon by job type ? #} {% endblock %} {% block brick_header_actions %} {% if job.get_config_form_class %} {% brick_header_action id='edit' url=job.get_edit_absolute_url label=_("Edit the job's configuration") %} {% endif %} {% if job.is_finished and job.user %} {% brick_header_action id='update-redirect' url=job.get_delete_absolute_url type='delete' label=_('Delete the job') __back_url=list_url %} {% endif %} {% if not job.user %} {% if job.enabled %} {% brick_header_action id='update' url='creme_core__disable_job'|url:job.id label=_('Disable') icon='cancel' enabled=user.is_superuser %} {% else %} {% brick_header_action id='update' url='creme_core__enable_job'|url:job.id label=_('Enable') icon='ok' enabled=user.is_superuser %} {% endif %} {% endif %} {% endblock %} {% block brick_table_head %}{% endblock %} {% block brick_before_content %}
{% if job.enabled and not job.user and user.is_superuser and job.status == JOB_WAIT %}