| {% extends 'layout.html' %}

| {# Default case is Open Projects #}
| {% set page_title = 'Open Projects' %}
| {% set page_description = 'Full production data and tutorials from all open movies, for you to use freely' %}
| {% set page_header_image = url_for('static', filename='assets/img/backgrounds/banner-open-projects.jpg') %}
| {% set page_header_text = 'See how each film came to be. Explore our production files, assets, artwork and more. Get full access to behind the scenes at the Blender Animation Studio. Follow along as we share our process and techniques for each movie.' %}

| {% if title == 'courses' or title == 'workshops' %}
| 	{% set page_title = 'Training' %}
| 	{% set page_description = 'Production quality training by 3D professionals' %}
| 	{% set page_header_image = url_for('static', filename='assets/img/backgrounds/banner-training.jpg') %}
| 	{% set page_header_text = 'Browse through our structured courses. Choose a workshop where top Blender Artists walk you through professional techniques to build a specific project. Visit the Art Gallery where you can download and study source files from your favorite artists.' %}

//- | {% elif title == 'workshops' %}
//- | 	{% set page_title = 'Workshops' %}
//- | 	{% set page_description = 'Production quality training by 3D professionals' %}
//- | 	{% set page_header_image = url_for('static', filename='assets/img/backgrounds/background_caminandes_3_03.jpg') %}
//- | 	{% set page_header_text = 'Enter the artist workshop and learn by example.' %}

| {% endif %}

| {% block og %}
meta(property="og:type", content="website")
meta(property="og:url", content="https://cloud.blender.org")

meta(property="og:title", content="{{ page_title }} on Blender Cloud")
meta(name="twitter:title", content="{{ page_title }} on Blender Cloud")

meta(property="og:description", content="{{ page_description }}")
meta(name="twitter:description", content="{{ page_description }}")

meta(property="og:image", content="{{ page_header_image }}")
meta(name="twitter:image", content="{{ page_header_image }}")
| {% endblock %}
| {% block css %}
link(href="{{ url_for('static_cloud', filename='assets/css/projects-index-collection.css') }}", rel="stylesheet")
| {% endblock css %}

| {% block page_title %}
| {{ page_title }}
| {% endblock %}

| {% block body %}
	
//- Jumbotron
.jumbotron.jumbotron-fluid(style="background-image: url('{{ page_header_image }}')")
	.container
		h1.display-4.node_index-collection-name {{ page_title }}
		p.lead.node_index-collection-description {{ page_header_text }}
//- Secondary Navigation
| {%  if title == 'courses' or title == 'workshops' %}
.container.navbar-secondary
	ul.nav.justify-content-left
		li.nav-item
			a.nav-link.nav-title(href="#") Training
		li.nav-item
			a.nav-link(href="#", class="{% if title == 'courses' %}active{% endif %}") Courses
		li.nav-item
			a.nav-link(href="#", class="{% if title == 'workshops' %}active{% endif %}") Workshops
		li.nav-item
			a.nav-link(href="#") Art Gallery
| {%  endif %}
//- Project Cards
.container.card-container
	.row
		| {% for project in projects %}
		| {% if (project.status == 'published') or (project.status == 'pending' and current_user.is_authenticated) and project._id != config.MAIN_PROJECT_ID %}

		.col-md-4(
			data-url="{{ url_for('projects.view', project_url=project.url) }}",
			tabindex="{{ loop.index }}")
			.card
				| {% if project.picture_header %}
				a(href="{{ url_for('projects.view', project_url=project.url) }}")
					img.card-img-top(src="{{ project.picture_header.thumbnail('l', api=api) }}")
				| {% endif %}

				.card-body
					h4.card-title
						a(href="{{ url_for('projects.view', project_url=project.url) }}")
							| {{project.name}}
							| {% if project.status == 'pending' and current_user.is_authenticated and current_user.has_role('admin') %}
							small (pending)
							| {% endif %}

					| {% if project.summary %}
					p.card-text
						| {{project.summary|safe}}
					| {% endif %}

		| {% endif %}
		| {% endfor %}


| {% endblock %}


| {% block footer_scripts %}
//- script.
//- 	$('.node_index-collection-card.project').on('click', function(e){
//- 		e.preventDefault();
//- 		window.location.href = $(this).data('url');
//- 	});
| {% endblock %}
