{% extends 'admin/master.html' %} {% from 'macro/vendor.html' import form_css, form_js %} {% from 'macro/pagination.html' import render_pager, render_simple_pager %} {% import 'macro/layout.html' as model_layout with context %} {% import 'macro/actions.html' as actionlib with context %} {% from 'macro/row_actions.html' import render_row_action with context %} {% block styles -%} {{ super() }} {{ form_css(xeditable=editable_columns) }} {%- endblock %} {% block main %} {% block model_menu_bar %} {% endblock %} {% if filters %} {{ model_layout.filter_form() }}
{% endif %} {% block model_list_table %}
{% block list_header scoped %} {% if actions %} {% endif %} {% block list_row_actions_header %} {% if view.column_display_actions %} {% endif %} {% endblock %} {% for c, name in list_columns %} {% set column = loop.index0 %} {% endfor %} {% endblock %} {% for row in data %} {% block list_row scoped %} {% if actions %} {% endif %} {% block list_row_actions_column scoped %} {% if view.column_display_actions %} {%- endif -%} {% endblock %} {% for c, name in list_columns %} {% endfor %} {% endblock %} {% else %} {% endfor %}
  {% if view.is_sortable(c) %} {% if sort_column == column %} {{ name }} {% if sort_desc %} {% else %} {% endif %} {% else %} {{ name }} {% endif %} {% else %} {{ name }} {% endif %} {% if view.column_descriptions.get(c) %} {% endif %}
{% block list_row_actions scoped %} {% for action in list_row_actions %} {{ render_row_action(action, get_pk_value(row), row) }} {% endfor %} {% endblock %} {% if view.is_editable(c) %} {% set form = list_forms[get_pk_value(row)] %} {% if form.csrf_token %} {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c), csrf=form.csrf_token._value()) }} {% elif csrf_token %} {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c), csrf=csrf_token()) }} {% else %} {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c)) }} {% endif %} {% else %} {{ get_value(row, c) }} {% endif %}
{% block empty_list_message %}
{{ view.get_empty_list_message() }}
{% endblock %}
{% block list_pager %} {% if num_pages is not none %} {{ render_pager(page, num_pages, pager_url) }} {% else %} {{ render_simple_pager(page, data|length == page_size, pager_url) }} {% endif %} {% endblock %} {% endblock %} {% block actions %} {% if actions %} {{ actionlib.form(get_url('.action_view')) }} {% endif %} {% endblock %} {%- if view.edit_modal or view.create_modal or view.details_modal -%} {{ actionlib.add_modal_window() }} {%- endif -%} {% endblock %} {% block tail %} {{ super() }} {% if filter_groups %}
{{ filter_groups|tojson|safe }}
{{ active_filters|tojson|safe }}
{% endif %} {{ form_js(xeditable=editable_columns) }} {% if actions %} {{ actionlib.add_action_js(gettext('Please select at least one record.'), actions, actions_confirmation) }} {% endif %} {% endblock %}