{% if categoryName == 'przedszkola' or categoryName == 'szkoly' %}
	{% set bgClass="bg-light-blue" %}
{% else %}
	{% set bgClass="bg-green" %}
{% endif %}

{% if mediafilesAll == false %}
	<section class="{{ bgClass }}-top" id="dla-mediow">	
			<div class="container py-5">
				<div class="row justify-content-between">
					<div class="col-12 col-lg-5">
						<div class="d-flex h-100 justify-content-between flex-column">
							<div>
								
								{% if categoryName == 'przedszkola' %}
									<h3>{{ formediaBox.header }}</h3>
									<div class="margin-left-minus">
										<img alt="Gdzie już jesteśmy - mapa" src="{{ asset('dist/img/map-small.png') }}" class="w-100" />
										<div class="margin-top-minus d-flex justify-content-center"><a href="/przedszkola/gdzie-jestesmy" class="btn"><span>Sprawdź</span></a></div>
									</div>
								{% else %}
									<div class="margin-left-minus my-5">
										<div class="{% if categoryName == 'szkoly' %}bg-dark-yellow{% else %}bg-dark-blue{% endif %} p-5 with-bg-box">
											<h3>{{ formediaBox.header }}</h3>
											{{ formediaBox.content|raw }}
										</div>
									</div>
								{% endif %}
							</div>
							{% if formediaBox.link is not empty %}
								<div class="d-flex justify-content-center mt-5 mt-md-0">
									<a href="{{ formediaBox.link }}" class="btn" aria-label="{{ formediaBox.btn }}" target="_blank"><span>{{ formediaBox.btn }}</span></a>
								</div>
							{% endif %}
						</div>
					</div>
					<div class="col-12 col-lg-6 mt-5 mt-lg-0">
						<div class="row">
							<div>
								<h3>{{ formediaBox2.header }}</h3>
								{{ formediaBox2.content|raw }}
							</div>
							{% for file in mediafiles %}

								<div class="col-12 col-sm-6 col-md-4 col-lg-3 mb-5 text-center">
									{% if file.file is not empty %}
										{% set extension = file.file|split('.') %}
										{% set extension = extension[(extension|length)-1] %}
										{# {{ sonata_path(file.file, 'reference') }} #}
										<a href="{{ path('sonata_media_download', {'id': file.file|sonata_urlsafeid }) }}" target="_blank">
											{% if extension=='pdf' %}
												<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-pdf.png') }}" />
											{% endif %}
											{% if extension=='ppt' or extension=='pptx' %}
												<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-ppt.png') }}" />
											{% endif %}
											{% if extension=='eps' %}
												<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-eps.png') }}" />
											{% endif %}
											{% if extension=='png' %}
												<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-png.png') }}" />
											{% endif %}
											{% if extension=='doc' or extension=='docx' %}
												<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-doc.png') }}" />
											{% endif %}
											{% if extension=='zip' %}
												<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-zip.png') }}" />
											{% endif %}
											{% if extension=='jpg' or extension=='jpeg' %}
												<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-jpg.png') }}" />
											{% endif %}
										</a>
										<div class="d-flex justify-content-center mt-3">
											<a href="{{ path('sonata_media_download', {'id': file.file|sonata_urlsafeid }) }}" class="btn small-btn" target="_blank" aria-label="Pobierz: {{ file.title }}" >
												{# Pobierz #}
												{# {% if extension=='png' %} grafikę{% endif %}
												{% if extension=='jpg' or extension=='jpeg' %} zdjęcie{% endif %} #}
												<span>{{ file.title }}</span>
											</a>
										</div>
									{% endif %}	
								</div>
							{% endfor %}
							
							{% if categoryName == 'przedszkola' or categoryName == 'szkoly' %}
								<div class="mt-3">
									{# <a href="/materialy-do-pobrania" class="btn red" aria-label="Więcej materiałów"><span>Więcej materiałów</span></a> #}
									<h6>Więcej materiałów będziesz mógł pobrać po zarejestrowaniu się<br />do projektu.</h6>
								</div>
							{% endif %}

						</div>
					</div>
				</div>
			</div>
	</section>
{% else %}
	<section class="bg-dark-blue-top first-section">
			<div class="container py-5">
				<h1 class="my-5">{{ record.title }}</h1>
				<div class="row">
					{% for file in mediafiles %}

						<div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xl-2 mb-5 text-center">
							{% if file.file is not empty %}
								{% set extension = file.file|split('.') %}
								{% set extension = extension[(extension|length)-1] %}
								{# {{ sonata_path(file.file, 'reference') }} #}
								<a href="{{ path('sonata_media_download', {'id': file.file|sonata_urlsafeid }) }}" target="_blank">
									{% if extension=='pdf' %}
										<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-pdf.png') }}" />
									{% endif %}
									{% if extension=='ppt' or extension=='pptx' %}
										<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-ppt.png') }}" />
									{% endif %}
									{% if extension=='eps' %}
										<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-eps.png') }}" />
									{% endif %}
									{% if extension=='png' %}
										<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-png.png') }}" />
									{% endif %}
									{% if extension=='doc' or extension=='docx' %}
										<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-doc.png') }}" />
									{% endif %}
									{% if extension=='zip' %}
										<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-zip.png') }}" />
									{% endif %}
									{% if extension=='jpg' or extension=='jpeg' %}
										<img title="{{ file.title }}" alt="{{ file.title }}" src="{{ asset('dist/img/icon-jpg.png') }}" />
									{% endif %}
								</a>
								<div class="d-flex justify-content-center mt-3">
									<a href="{{ path('sonata_media_download', {'id': file.file|sonata_urlsafeid }) }}" class="btn small-btn" target="_blank" aria-label="Pobierz: {{ file.title }}" >
										{# Pobierz #}
										{# {% if extension=='png' %} grafikę{% endif %}
										{% if extension=='jpg' or extension=='jpeg' %} zdjęcie{% endif %} #}
										<span>{{ file.title }}</span>
									</a>
								</div>
							{% endif %}	
						</div>
					{% endfor %}
				</div>
			</div>
	</section>

{% endif %}