{% load i18n creme_cells creme_ctype creme_listview creme_query creme_widgets %} {% load get_by_index get_entity_html_attrs not_op from creme_core_tags %} {% with cells=header_filters.selected.filtered_cells %} {# TODO : replace it by a div after complete refactor of button/link bindings #}
{% listview_header_colspan cells=cells is_readonly=is_popup_view is_single_select=o2m as colspan %}
{% block lv_title %} {{list_title}} {% if list_sub_title %}{{list_sub_title}}{% endif %} {% if paginator.count > 0 %} {% if page_obj.start_index %}{# TODO: per paginator-class stats templatetag ?? #} ({{page_obj.start_index}} – {{page_obj.end_index}} / {{paginator.count}}) {% else %} ({{paginator.count}}) {% endif %} {% endif %} {% endblock %}
{% block lv_controls %}
{% listview_entity_filters model=model user=user efilters=entity_filters show_buttons=is_popup_view|not_op %}
{% listview_header_filters model=model user=user hfilters=header_filters show_buttons=is_popup_view|not_op %}
{% endblock %}
{% block lv_header_buttons %} {% if not is_popup_view %}{% listview_buttons model=model buttons=buttons %}{% endif %} {% translate 'Search' context 'creme_core-verb' as label %} {{label}} {% widget_icon name='search' label=label size='listview-button' %} {% translate 'Clear search'%} {% endblock %}
{% block lv_columns_headers %} {% if is_selection_multiple %}{% endif %} {% for cell in cells %} {% if cell.is_hidden %} {% elif cell.type_id == 'actions' %} {% else %}{# NB: TMP - this header currently adds the css class cell.listview_css_class until semantic information is provided in the template context #} {# TODO: should this header also add the cell.header_listview_css_class ? #} {% endif %} {% endfor %} {% endblock %} {% block lv_search_header %} {% if is_selection_multiple %}{% endif %} {% for cell in cells %} {% if cell.is_hidden %} {% elif cell.type_id == 'actions' %} {% else %} {% endif %} {% endfor %} {% endblock %} {% block lv_content_rows %} {% for entity in page_obj.object_list %} {% if is_selection_multiple %}{% endif %} {% for cell in cells %} {% block lv_content_cell %} {% if cell.type_id == 'actions' %} {% else %} {% if not is_popup_view %} {% endif %} {% endif %} {% endblock %} {% endfor %} {% empty %} {% endfor %} {% endblock %}
{% ctype_for_model model as ctype %} {% block lv_hidden_buttons %} {% endblock %}
{% listview_header_actions cell=cell user=user %}
  {% translate 'Quick search' %} {{search_form|get_by_index:cell.key}}
{% listview_entity_actions cell=cell instance=entity user=user %} {% cell_render cell=cell instance=entity user=user tag=view_tag as cell_content %} {% with data_type=cell.data_type %}
{{cell_content}}
{% endwith %}
{% listview_td_action_for_cell cell=cell instance=entity user=user %}
{% translate 'No entity exists / matches your search' %}
{% endwith %}