{% extends 'themes/'~layout_dir~'/layout.html' %}
{% block body %}


  <div id="admin" class="col s12">
<div class="row">
	{% include 'themes/default/modules/PortalModule/module.actions.html' %}
</div>
    
<div class="row">
	
<div class="myc-responsive-container col s12">
	<ul class="list" style="width:1800px;">
	
	{% set column_count = kanban_records|length %}
	
	{% if column_count > 6 %}
		{% set col_class = (12/column_count|round(0, 'floor'))*2 %}
	{% else %}
		{% set col_class = 12/column_count|round(0, 'floor') %}
	{% endif %}

	{% for kanban_group, group_records in kanban_records %}	
	
	<div class="col card {%if loop.index > 1 %}kanbanclosed{%endif%}" style="margin-right: 10px; min-height: 100%;">
		<h5 class="kanbanlabel"><i class="material-icons tiny {%if loop.index == 1 %}hide{%endif%}">add</i><i class="material-icons tiny {%if loop.index > 1 %}hide{%endif%}">expand_less</i> {{kanban_group|trans}}</h5>
	{% for record in group_records %}
	
	<li style="    border-left: 3px solid {{app.colors_map[themebasiccolor]}};">
	<div class="row">
	<div class="col s12 m12">
		<div class="darken-1" onclick="gotoPage('{{app.config.base_url}}/{{current_route}}/{{record.id}}')">
			
				<h6 style="    margin-left: 10px;">{{record[kanban_fields[0]]|raw}}</h6>
			
				<ul class="collection">
					        {% for fieldname in kanban_fields %}
					        	{% if loop.index>1 %}
				            		<li class="{{fieldname}} collection-item "><b>{{fieldname|trans}}:</b><span>&nbsp;&nbsp;{{record[fieldname]|raw}}</span></li>
				            	{% endif %}
				            {% endfor %}
				</ul>
					   
	        <div class="card-action " style="padding: 16px 6px;">
               
               	<a class="btn-floating {{themebasiccolor}} btn-small waves-effect waves-light" href="{{app.config.base_url}}/{{module_config.route}}/{{record.id}}/"><i class="large material-icons">zoom_in</i></a>
	            
	            {% if edit_enabled is defined and edit_enabled %}
				<a class="btn-floating yellow darken-1 btn-small waves-effect waves-light" href="{{app.config.base_url}}/{{module_config.route}}/{{record.id}}/edit"><i class="large material-icons">mode_edit</i></a>
				{% endif %}
				
				{% if pdf_download_enabled is defined and pdf_download_enabled %} 
						<a class="btn-floating red btn-small waves-effect waves-light" href="{{app.config.base_url}}/{{module_config.route}}/{{record.id}}/download-pdf"><i class="material-icons left">picture_as_pdf</i>Download PDF</a>
				{% endif %}
            </div>
		</div>
	</div>
	</div>
	</li>
	
	{% endfor %}
	</div>
	{% endfor %} 
	</ul>
	 
</div>
	
	</div>  

	<div class="row">  

  {% if create_enabled is defined and create_enabled %} 
		<div class="col s12 right-align">
			<a class="btn {{themebasiccolor}} waves-effect waves-light btn-small" href="{{app.request.requestUri}}create"><i class="material-icons large left">add</i>Create New</a>
		</div>
	{% endif %}

</div>

{% endblock %}
{% block footerscripts %}

<script>

$(".kanbanlabel").click(function(){
	$(this).parent().toggleClass("kanbanclosed");
	$(this).find('i').toggleClass('hide');
});
</script>

{% endblock %}