doctype
html(lang="en")
	head
		meta(charset="utf-8")
		title {% if self.page_title() %}{% block page_title %}{% endblock %} — {% endif %}Blender Cloud
		meta(name="viewport", content="width=device-width, initial-scale=1.0")
		meta(name="description", content="Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.")
		meta(name="author", content="Blender Institute")
		meta(name="theme-color", content="#3e92aa")

		| {% if config['GOOGLE_SITE_VERIFICATION'] %}
		meta(name="google-site-verification" content="{{ config['GOOGLE_SITE_VERIFICATION'] }}")
		| {% endif %}

		meta(property="og:site_name", content="Blender Cloud")
		meta(property="og:locale", content="en_US")
		meta(name="twitter:card", content="summary_large_image")
		meta(name="twitter:site", content="@Blender_Cloud")

		| {% block og %}
		meta(property="og:title", content="Blender Cloud")
		meta(property="og:url", content="https://cloud.blender.org")
		meta(property="og:type", content="website")
		meta(property="og:image", content="{{ url_for('static', filename='assets/img/backgrounds/background_gleb_locomotive.jpg')}}")
		meta(property="og:description", content="Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.")

		meta(name="twitter:title", content="Blender Cloud")
		meta(name="twitter:description", content="Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.")
		meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/backgrounds/background_gleb_locomotive.jpg')}}")
		| {% endblock og %}

		script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery-3.1.0.min.js')}}")
		script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.typeahead-0.11.1.min.js')}}")
		script(src="{{ url_for('static_pillar', filename='assets/js/vendor/js.cookie-2.0.3.min.js')}}")
		| {% if current_user.is_authenticated %}
		script(src="{{ url_for('static_pillar', filename='assets/js/vendor/clipboard.min.js')}}")
		| {% endif %}

		| {% if current_user.has_cap('subscriber') %}
		| {# Only load if we can comment (for converting markdown as-we-type) #}
		script(src="{{ url_for('static_pillar', filename='assets/js/markdown.min.js') }}")
		| {% endif %}

		script(src="{{ url_for('static_pillar', filename='assets/js/tutti.min.js') }}")

		link(href="{{ url_for('static', filename='assets/img/favicon.png') }}", rel="shortcut icon")
		link(href="{{ url_for('static', filename='assets/img/apple-touch-icon-precomposed.png') }}", rel="icon apple-touch-icon-precomposed", sizes="192x192")
		link(rel="stylesheet", href="{{ url_for('static', filename='assets/bootstrap/css/bootstrap.min.css') }}")
		link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css') }}", rel="stylesheet")
		link(rel="stylesheet", href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600")
		link(href="{{ url_for('static', filename='assets/google-font-roboto/roboto.css') }}", rel="stylesheet")

		| {% block head %}{% endblock %}

		| {% block css %}
		link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css') }}", rel="stylesheet")
		link(href="{{ url_for('static_pillar', filename='assets/css/base.css') }}", rel="stylesheet")
		| {% if title == 'blog' %}
		link(href="{{ url_for('static_pillar', filename='assets/css/blog.css') }}", rel="stylesheet")
		| {% else %}
		link(href="{{ url_for('static_cloud', filename='assets/css/main.css') }}", rel="stylesheet")
		| {% endif %}
		| {% endblock css %}


		| {% if not title %}{% set title="default" %}{% endif %}

	body(class="{{ title }}")
		.container-page
			| {% with messages = get_flashed_messages(with_categories=True) %}
			|		{% if messages %}

			|	{% for (category, message) in messages %}
			.alert(role="alert", class="alert-{{ category }}")
				i.alert-icon(class="{{ category }}")
				span {{ message }}
				button.close(type="button", data-dismiss="alert")
					i.pi-cancel
			|	{% endfor %}

			|		{% endif %}
			| {% endwith %}

			//- Navigation Bar
			nav.navbar.navbar-expand-md.navbar-light.sticky-top
				//- Logo
				a.navbar-brand(href="#")
					img(src="{{ url_for('static', filename='assets/img/logo-blender-cloud-text.svg') }}", alt="alt")
				//- Mobile Nav Button
				button.navbar-toggler(type='button', data-toggle='collapse', data-target='#navbarNav', aria-controls="navbarNav", aria-expanded="false", aria-label="Toggle navigation")
					span
					span
					span
				//- Links
				#navbarNav.collapse.navbar-collapse.justify-content-end
					ul.navbar-nav
						| {% if node and node.properties and node.properties.category %}
						| {% set category = node.properties.category %}
						| {% else %}
						| {% set category = title %}
						| {% endif %}

						| {% block navigation_sections %}
						li.nav-item
							a.nav-link(href="{{ url_for('main.main_blog') }}", class="{% if category == 'blog' %}active{% endif %}") Blog
						li.nav-item.dropdown
							a.nav-link.dropdown-toggle(href="#", data-toggle="dropdown") Libraries
							.dropdown-menu
								a.dropdown-item(
									href="{{ url_for('projects.view', project_url='hdri') }}")
									i.pi-globe
									| HDRI
								a.dropdown-item(
									href="{{ url_for('projects.view', project_url='textures') }}")
									i.pi-folder-texture
									| Textures
								a.dropdown-item(
									href="{{ url_for('projects.view', project_url='characters') }}")
									i.pi-character
									| Characters
						li.nav-item.dropdown
							a.nav-link.dropdown-toggle(href="#", data-toggle="dropdown") Training
							.dropdown-menu
								a.dropdown-item(href="{{ url_for('cloud.courses') }}")
									i.pi-graduation-cap
									| Courses
								a.dropdown-item(href="{{ url_for('cloud.workshops') }}")
									i.pi-lightbulb
									| Workshops
								a.dropdown-item(href="{{ url_for('projects.view', project_url='gallery') }}")
									i.pi-image
									| Art Gallery
						li.nav-item
							a.nav-link(href="{{ url_for('cloud.open_projects') }}",
									class="{% if category in ['open-projects', 'film'] %}active{% endif %}") Open Projects
						li.nav-item
							a.nav-link(href="{{ url_for('cloud.services') }}",
									class="{% if category == 'services' %}active{% endif %}") Services
  						
						//- li.nav-item
						//- 	i.search-icon.pi-search
						| {% endblock navigation_sections %}

						| {% if current_user.is_anonymous %}
						li.nav-item
							a.nav-link(
								href="https://store.blender.org/product/membership/",
								title="Sign up") Sign up
						| {% endif %}

						| {% block navigation_user %}
						//- | {% include 'menus/notifications.html' %}
						//- | {% include 'menus/user.html' %}

						| {% endblock navigation_user %}

			.page-content
				#search-overlay
				| {% block page_overlay %}
				#page-overlay
				| {% endblock page_overlay %}
				.page-body
					| {% block body %}{% endblock %}

		| {% block footer_container %}
		footer#footer-container.container-fluid
			| {% block footer_navigation %}
			#footer-navigation
				.container.py-5
					.row
						.col-4
							h5 Blender Cloud
							p A creative hub for your projects, powered by free and open source software.
							ul.list-inline.social-icons
								li.list-inline-item
									a(href="https://www.facebook.com/BlenderCloudOfficial/")
										img(src="../../static/assets/img/icons/icon-social-facebook.svg", alt="alt")
								li.list-inline-item
									a(href="https://twitter.com/Blender_Cloud")
										img(src="../../static/assets/img/icons/icon-social-twitter.svg", alt="alt")
								li.list-inline-item
									a(href="https://www.youtube.com/channel/UC5qvW9fotdsSJkCguB_t-kQ")
										img(src="../../static/assets/img/icons/icon-social-youtube.svg", alt="alt")
						.col
							h5 Libraries
							ul.list-unstyled.text-small
								li
									a(href="#") HDRI
								li
									a(href="#") Textures
								li
									a(href="#") Characters
						.col
							h5 Training
							ul.list-unstyled.text-small
								li
									a(href="#") Art Gallery
								li
									a(href="#") Courses
								li
									a(href="#") Workshops
						.col
							h5 Resources
							ul.list-unstyled.text-small
								li
									a(href="https://www.blender.org") Blender
								li
									a(href="https://store.blender.org/") Blender Store
								li
									a(href="#") Contact Us
								li
									a(href="{{ url_for('cloud.terms_and_conditions') }}") Terms and Conditions
								li
									a(href="{{ url_for('cloud.privacy') }}") Privacy
						.col
							h5 Services
							ul.list-unstyled.text-small
								li
									a(href="#") Attract
								li
									a(href="#") Blender Cloud Add-on
								li
									a(href="#") Blender Sync
								li
									a(href="#") Flamenco
								li
									a(href="#") Image Sharing
								li
									a(href="#") Private Projects
								li
									a(href="#") Texture Browser

			| {% endblock footer_navigation %}
			//- Scroll Up Arrow. Not sure if it's necessary
			//- | {% block footer %}
			//- footer.container
			//- 	#hop(title="Be awesome in space")
			//- 		i.pi-angle-up
			//- | {% endblock footer %}
		| {% endblock footer_container %}

		#notification-pop(data-url="", data-read-toggle="")
			.nc-progress
			a#pop-close(href="#", title="Dismiss")
				i.pi-cancel
			.nc-item
				.nc-avatar
				.nc-text
					span.nc-date
						a(href="")

		noscript
			link(href='//fonts.googleapis.com/css?family=Roboto:300,400', rel='stylesheet', type='text/css')

		//- script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.bootstrap-3.3.7.min.js') }}")

		//- local bootstrap js returns error message, investigate later
		//- script(src="{{ url_for('static', filename='assets/jquery/jquery.slim.min.js') }}")
		//- script(src="{{ url_for('static', filename='assets/popper.js/popper.min.js') }}")
		//- script(src="{{ url_for('static', filename='assets/bootstrap/js/bootstrap.min.js') }}")
		script(src="https://code.jquery.com/jquery-3.3.1.min.js", integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=", crossorigin="anonymous")
		script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js", integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49", crossorigin="anonymous")
		script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js", integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em", crossorigin="anonymous")

		| {% if current_user.is_authenticated %}
		script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.typewatch-3.0.0.min.js') }}")
		script.
			// When sending an AJAX request, always add the X-CSRFToken header to it.
			var csrf_token = "{{ csrf_token() }}";
			$.ajaxSetup({
				beforeSend: function (xhr, settings) {
					if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) {
						xhr.setRequestHeader("X-CSRFToken", csrf_token);
					}
				}
			});
		| {% endif %}

		script.
			$(document).ready(function() {
				{% if current_user.is_authenticated %}
					getNotificationsLoop(); // Check for new notifications in the background

					// Resize #notifications and change overflow for scrollbars
					$(window).on("resize", function() { notificationsResize(); });
				{% endif %}
			});

			if (typeof $().tooltip != 'undefined'){
				$('[data-toggle="tooltip"]').tooltip({'delay' : {'show': 0, 'hide': 0}});
			}
			if(typeof($.fn.popover) != 'undefined'){
				$('[data-toggle="popover"]').popover();
			}

		| {% block footer_scripts_pre %}{% endblock %}
		| {% block footer_scripts %}{% endblock %}

		script.
			(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
			(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
			m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
			})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
			ga('create', '{{ config.GOOGLE_ANALYTICS_TRACKING_ID }} ', 'auto', {'allowAnchor': true});
			ga('send', 'pageview');
