{% block page %}
<section class="section first-section home" id="home">
	<h1>{{ data.page.name }}</h1>
	
	{% block contents %}
		<div class="content">
			<div id="myCarousel" class="carousel slide{{ (data.slides|length < 2) or (site.slideshow_youtube_id) ? ' hide-arrows' }}">
				{% if data.slideshow_active %}
					{# include 'pages/home_slideshow.twig' #}
					
					{% block slideshow %}
						<div class="carousel-inner">
							{% if site.slideshow_youtube_id %}
								{% block youtube %}
									<div class="item active" style="background:url('{{ constant('ROOT_URL_SCHEME') }}://i.ytimg.com/vi/{{ site.slideshow_youtube_id }}/sddefault.jpg');background-size:cover;background-position:center center;line-height:0px;">
										<div>
											<img src="{{ youtube_src }}" data-id="{{ site.slideshow_youtube_id }}" class="youtube_video" style="background:url('/images/youtube-play.png') no-repeat center;"/>
										</div>
									</div>
								{% endblock %}
							{% else %}
								{% for slide in data.slides %}
									{% set has_desc = (slide.desc and (not(slide.desc == '<br>')) and (not(slide.desc == '<p>&nbsp;</p>'))) %}
									
									{% block slide %}
										<div class="item {{ loop.first ? ' active' }}" id="slide_{{ slide.id }}">
											<div>
												{% if CONTEXT != 'preview' and not slide.doc %}
													{% if slide.url_ext %}
														<a href="{{ slide.url_ext }}" target="_blank" rel="nofollow">
													{% elseif slide.url_ext %}
														<a href="{{ slide.url_ext }}" target="_blank" rel="nofollow">
													{% elseif slide.url %}
														<a href="{{ slide.url }}" class="lightbox" rel="nofollow">
													{% endif %}
												{% endif %}
												
												{% block slide_contents %}
													<img src="/{{ slide.src }}" alt="{{ slide.alt }}"/>
													{% if slide.alt or slide.desc %}
														{% block slide_content_holder %}
															<div class="carousel-caption {{ has_desc ? '': ' no-caption' }}">
																{% block slide_content %}
																	<h2>{{ slide.alt }}</h2>
																	{{ (has_desc ? '<h3>' ~ slide.desc ~ '</h3>') | raw }}
																{% endblock slide_content %}
																
																{% if slide.doc %}
																	{% for doc in slide.doc %}
																		{% block slide_doc_content %}
																			<a href="{{ doc.src }}" target="_blank">{{ doc.title }}</a>
																		{% endblock slide_doc_content %}
																	{% endfor %}
																{% endif %}
															</div>
														{% endblock slide_content_holder %}
													{% endif %}
												{% endblock slide_contents %}
												
												{% if CONTEXT != 'preview' and not slide.doc and (slide.url_ext or slide.url) %}
													</a>
												{% endif %}
											</div>
										</div>
									{% endblock slide %}
								{% endfor %}
							{% endif %}
						</div>
						
						{% block slideshow_controls %}
							<a class="left carousel-control" href="#myCarousel" data-slide="prev">
								<span class="icon-prev"></span>
							</a>
							<a class="right carousel-control" href="#myCarousel" data-slide="next">
								<span class="icon-next"></span>
							</a>
						{% endblock slideshow_controls %}
						
						{% if not site.slideshow_youtube_id %}
							<div class="carousel-caption-area carousel-caption"></div>
						{% endif %}
						
					{% endblock slideshow %}
				{% endif %}
			</div>
		</div>
	{% endblock %}
	
	{% if site.highlights_top_active %}
		<div class="content">
			{# include 'pages/home_highlights.twig' #}
			{% block highlights %}
				<div id="highlights" class="content text-center">
					{% for highlight in data.highlights %}
						{% block highlight %}
							<div class="col-md-{{ cols }} col-sm-6">
								{% if not site.highlights_hide_icons %}
									{% block highlight_icon %}
									<span class="circle-back {{ highlight.icon_class }}">
										<i class="fa fa-{{ highlight.icon_class }} icons"></i>
									</span>
									{% endblock %}
								{% endif %}
								
								{% block highlight_title %}
									<h2>{{ highlight.title }}</h2>
								{% endblock %}
								
								{% block highlight_content %}
									<p>{{ highlight.desc | raw }}</p>
								{% endblock highlight_content %}
							</div>
						{% endblock highlight %}
					{% endfor %}
					<div class="clearfix"></div>
				</div>
			{% endblock highlights %}
		</div>
	{% endif %}
</section>
{% endblock page %}