{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_widgets creme_bricks %}{% load has_perm_to print_field from creme_core_tags %} {% block brick_extra_class %}{{block.super}} creme_core-history-brick{% endblock %} {% block brick_script %}
{% endblock %} {% block brick_header_title %} {% brick_header_title title=verbose_name icon='history' %} {% endblock %} {% block brick_header_actions %}{% endblock %} {% block brick_table_columns %} {% brick_table_column_for_field ctype=objects_ctype field='id' status='primary' title=_('Date') %} {% if not object %} {% brick_table_column title=_('Concerned entity') %} {% endif %} {% brick_table_column_for_field ctype=objects_ctype field='type' %} {% brick_table_column title=_('Modifications') %} {% brick_table_column title=_('By') %} {% endblock %} {% block brick_table_rows %} {% for line in page.object_list %}{% with concerned_entity=line.entity %}
{% print_field object=line field='date' %} {% if not object %} {% if concerned_entity %} {% widget_icon instance=concerned_entity size='brick-table' class='ctype-icon' %} {% widget_entity_hyperlink concerned_entity user %} {% else %} {% widget_icon ctype=line.entity_ctype size='brick-table' class='ctype-icon' %} {{line.entity_repr}}{# TODO: improve credentials here !! #} {% endif %} {% endif %} {{line.get_type_str}} {% if concerned_entity %}{% has_perm_to view concerned_entity as has_perm %} {% if has_perm %}{{line.explainer.render}}{% else %}{{HIDDEN_VALUE}}{% endif %} {% else %} {{line.explainer.render}}{# TODO: improve credentials here !! #} {% endif %} {% if line.user is not None %}{% widget_hyperlink line.user %}{% else %}{{line.username}}{% endif %}
{% endwith %}{% endfor %} {% endblock %} {% block brick_table_empty %} {% translate 'No history for the moment' %} {% endblock %}