{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_widgets assistants_tags %} {% load has_perm_to print_field url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} assistants-todos-brick{% endblock %} {% block brick_menu_actions %} {{block.super}}
{% assistants_brick_menu_hide_validated_todos_action url='assistants__hide_validated_todos'|url hidden=hide_validated %} {% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Todo') plural=_('{count} Todos') empty=verbose_name icon='todo' %} {% endblock %} {% block brick_header_actions %} {% if object %}{% has_perm_to change object as has_perm %} {% brick_header_action id='add' url='assistants__create_todo'|url:object.id label=_('New todo') enabled=has_perm %} {% endif %} {% endblock %} {% block brick_table_columns %} {% if not object %} {% brick_table_column title=_('Concerned entity') %} {% endif %} {% translate 'Created on' context 'assistants-todo' as creation_label %} {% brick_table_column_for_field ctype=objects_ctype field='user' title=_('User') status='primary' %} {% brick_table_column_for_field ctype=objects_ctype field='creation_date' title=creation_label %} {% brick_table_column_for_field ctype=objects_ctype field='title' %} {% brick_table_column_for_field ctype=objects_ctype field='description' title=_('Todo text') %} {% brick_table_column_for_field ctype=objects_ctype field='deadline' %} {% brick_table_column title=_('Status') status='action' %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% endblock %} {% block brick_table_rows %}{% url 'creme_core__delete_related_to_entity' objects_ctype.id as delete_url %} {% for todo in page.object_list %} {% has_perm_to change todo.real_entity as has_perm %} {% if not object %} {% widget_entity_hyperlink todo.real_entity user %} {% endif %} {% print_field object=todo field='user' %} {{todo.creation_date|date:'DATE_FORMAT'}} {% print_field object=todo field='title' %} {% print_field object=todo field='description' %} {% if todo.deadline %} {{todo.deadline|date:'DATETIME_FORMAT'}} {% else %} {% endif %} {% if todo.is_ok %} {% widget_icon name='ok' label=_('Validated') size='brick-table' class='brick-table-icon' %} {% else %} {% brick_table_action id='update' url='assistants__validate_todo'|url:todo.id confirm=_('Are you sure?') label=_('Validate') display='text' enabled=has_perm %} {% endif %} {% brick_table_action id='edit' url=todo.get_edit_absolute_url label=_('Edit this todo') enabled=has_perm %} {% brick_table_action id='delete' url=delete_url __id=todo.id label=_('Delete this todo') enabled=has_perm %} {% endfor %} {% endblock %} {% block brick_table_empty %} {% translate 'No Todo for the moment' %} {% endblock %}