{% macro bs_list(view, object_list=None, is_paginated=False, page_obj=None) -%}
{% from 'bs_pagination.htm' import bs_pagination with context -%}

<card-primary>
    <card-header>
        <card-title>{{ view.get_heading() }}</card-title>
    </card-header>
    <card-body>
        {% if caller and 'has_filters' in caller.arguments -%}
            {{ caller(has_filters=True) }}
        {% else -%}
            {% for field in view.allowed_filter_fields -%}
                {% with _render_=view.get_filter_kwargs(field) -%}
                    {% include view.get_filter_template(field) -%}
                {% endwith -%}
            {% endfor -%}
        {% endif -%}
        {% if object_list -%}
            <table {{ tpl.json_flatatt(view.get_table_attrs()) }}>
            {% for obj in object_list -%}
                {% set row_loop_index = loop.index0 -%}
                {% if loop.index0 == 0 -%}
                <tr>
                {% for column in view.grid_fields -%}
                    <th>
                    {% if isinstance(column, list) -%}
                        {% for field in column -%}
                            <div>{{ view.get_sort_order_link(field) }}</div>
                        {% endfor -%}
                    {% else -%}
                        {{ view.get_sort_order_link(column) }}
                    {% endif -%}
                    </th>
                {% endfor -%}
                </tr>
                {% endif -%}
                <tr>
                {% for column in view.grid_fields -%}
                    <td {{ tpl.json_flatatt(view.get_cell_attrs(obj, column, row_loop_index, loop.index0)) }}>
                    {% if isinstance(column, list) -%}
                        {% for field in column -%}
                            <div>{{ view.get_display_value(obj, field) }}</div>
                        {% endfor -%}
                    {% else -%}
                        {{ view.get_display_value(obj, column) }}
                    {% endif -%}
                    </td>
                {% endfor -%}
                </tr>
            {% endfor -%}
            </table>
        {% else -%}
            <div class="jumbotron">
                <div class="default-padding">
                {% if caller and 'has_no_match' in caller.arguments -%}
                    {{ caller(has_no_match=True) }}
                {% else -%}
                    {% with _render_ = view.get_no_match_kwargs() -%}
                        {% include view.get_no_match_template()  -%}
                    {% endwith -%}
                {% endif -%}
                </div>
            </div>
        {% endif -%}

        {% if object_list and is_paginated -%}
            {% if caller and 'has_pagination' in caller.arguments -%}
                {{ caller(has_pagination=True) }}
            {% else -%}
                {{ bs_pagination(cbv=view, page_obj=page_obj) }}
            {% endif -%}
        {% endif -%}

    </card-body>
</card-primary>

{% endmacro -%}
{% if _render_ -%}
    {% if not isinstance(_render_, dict) -%}
        {% set _render_ = {
            'view': view,
            'object_list': object_list or None,
            'is_paginated': is_paginated or False,
            'page_obj': page_obj or None,
        } -%}
    {% endif -%}
    {{ bs_list(**_render_) }}
{% endif -%}
