{{ include_javascript('javascripts/vendor/datatables-full/jquery.dataTables.min.js') }}
{{ include_css('styles/vendor/datatables-full/dataTables.bootstrap.min.css') }}

{% include '@autoupdate/core.twig' %}

<p>&nbsp;</p>

<div class="panel-group" role="tablist" aria-multiselectable="true" id="accordion_update" >
	{# THEMES #}
	{% set nbMaj = 0 %}
	{% set exts = themes %}
	{% for ext in exts %}
		{% if ext.updateAvailable and ext.installed %}
			{% set nbMaj = nbMaj + 1 %}
		{% endif %}
	{% endfor %}
	{% if nbMaj > 0 %}
		<div class="panel panel-warning"  >
	{% else %}
		<div class="panel panel-default"  >
	{% endif %}
		<button class="panel-heading collapsed" role="tab" id="headingThemes" role="button" data-toggle="collapse" data-parent="#accordion_update" href="#collapseThemes" aria-expanded="false" aria-controls="collapseThemes">
			<h2 class="panel-title">Thèmes
				{% if nbMaj > 0 %}
					{% set alerte = '' %}
					{% if nbMaj > 1 %}
						{% set alerte = _t('AU_SEVERAL_THEMES_UPDATE')|replace({'{nbMaj}':nbMaj}) %}
					{% else %}
						{% set alerte = _t('AU_ONE_THEME_UPDATE') %}
					{% endif %}
					<span class="alert-msg" style="float: right;">{{alerte}}</span>
				{% endif %}
			</h2>
		</button>
		<div id="collapseThemes" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThemes">
			{% set exts = themes %}
			{% include '@autoupdate/exts.twig' %}
		</div>
	</div>

	{# TOOLS #}
	{% set nbMaj = 0 %}
	{% set exts = tools %}
	{% for ext in exts %}
		{% if ext.updateAvailable and ext.installed %}
			{% set nbMaj = nbMaj + 1 %}
		{% endif %}
	{% endfor %}
	{% if nbMaj > 0 %}
		<div class="panel panel-warning"  >
	{% else %}
		<div class="panel panel-default"  >
	{% endif %}
		<button class="panel-heading collapsed" role="tab" id="headingTools" role="button" data-toggle="collapse" data-parent="#accordion_update" href="#collapseTools" aria-expanded="false" aria-controls="collapseTools">
			<h2 class="panel-title">Tools (extensions)
				{% if nbMaj > 0 %}
					{% set alerte = '' %}
					{% if nbMaj > 1 %}
						{% set alerte = _t('AU_SEVERAL_TOOLS_UPDATE')|replace({'{nbMaj}':nbMaj}) %}
					{% else %}
						{% set alerte = _t('AU_ONE_TOOL_UPDATE') %}
					{% endif %}
					<span style="float: right;">{{alerte}}</span>
				{% endif %}
			</h2>
		</button>
		<div id="collapseTools" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTools">
			{% set exts = tools %}
			{% include '@autoupdate/exts.twig' %}
		</div>
	</div>
</div>
