{% load i18n %}

{% if app_list %}
{% for app in app_list %}

<h3><span uk-icon="icon: home; ratio: 1.2"></span> {{ app.name }}</h3>

<div class="uk-grid-small uk-child-width-expand@m uk-child-width-2-4@l" uk-grid>
	{% for model in app.models %}
		<div>
			<div class="uk-card uk-card-default uk-card-small uk-card-body">
				<h3 class="uk-card-title">
					{% if model.admin_url %}
						  <a href="{{ model.admin_url }}"{% if model.admin_url in request.path %} aria-current="page"{% endif %}>{{ model.name }}</a>
					{% else %}
						  {{ model.name }}
					{% endif %}
				</h3>
				
				<div class="uk-grid-small uk-text-center uk-padding-small uk-padding-remove-horizontal uk-child-width-expand@s" uk-grid>
					<div class="uk-flex uk-flex-right">
						<div class="uk-width-2-4">
							{% if model.add_url %}
								<a class="uk-button uk-button-default uk-button-small prl-uk-button-success-2 uk-width-expand uk-margin-right" href="{{ model.add_url }}"><span uk-icon="icon: plus; ratio: .75"></span> {% translate 'Add' %}</a>
							{% endif %}
						</div>
						<div class="uk-width-2-4">
						{% if model.admin_url %}
							{% if model.view_only %}
								<a class="uk-button uk-button-secondary uk-button-small uk-width-expand" href="{{ model.admin_url }}"><span uk-icon="icon: list; ratio: .75"></span> {% translate 'View' %}</a>
							{% else %}
								<a class="uk-button uk-button-secondary uk-button-small uk-width-expand" href="{{ model.admin_url }}"><span uk-icon="icon: list; ratio: .75"></span> {% translate 'Change' %}</a>
							{% endif %}
						{% endif %}
						</div>
					</div>
				</div>
			</div>
		</div>         
          
	{% endfor %}
</div>
{% endfor %}

{% else %}
	<h3>{% translate 'Available apps' %}</h3>
	<p>{% translate 'You don’t have permission to view or edit anything.' %}</p>
{% endif %}