{% import 'appbuilder/general/lib.html' as lib %}
{% include 'appbuilder/general/confirm.html' %}
{% include 'appbuilder/general/alert.html' %}


	{% set can_add = "can_add" | is_item_visible(modelview_name) %}
	{% set can_show = "can_show" | is_item_visible(modelview_name) %}
    {% set can_edit = "can_edit" | is_item_visible(modelview_name) %}
	{% set can_delete = "can_delete" | is_item_visible(modelview_name) %}
    {% set actions = actions | get_actions_on_list(modelview_name) %}

	{{ lib.render_list_header(can_add, page, page_size, count, filters, actions, modelview_name) }}

	{% if value_columns %}

  {% for item in value_columns %}
		<div class="list-group">
		{% set pk = pks[loop.index-1] %}
        {% if actions %}
            <input id="{{pk}}" class="action_check" name="rowid" value="{{pk}}" type="checkbox">
        {% endif %}

        {% if can_show or can_edit or can_delete %}
		    {{ lib.btn_crud(can_show, can_edit, can_delete, pk, modelview_name, filters) }}
		{% endif %}
		<a href="#" class="list-group-item">

		{% for value in include_columns %}
  			{% if loop.index == 1 %}
                <h4 class="list-group-item-heading">{{ item[value]|safe }}</h4>
      		{% else %}
        	    <p class="list-group-item-text">{{ item[value]|safe }}</p>
      		{% endif %}
		{% endfor %}
		</a>
		</div>
		
	{% endfor %}
	{{ lib.action_form(actions,modelview_name) }}

	{% else %}
	<b> {{_("No records found")}}</b>
	{% endif %}

<script language="javascript">
        var modelActions = new AdminActions();
</script>
