Files
blender-cloud/src/templates/projects/landing.pug
2019-03-27 12:36:39 +01:00

189 lines
5.8 KiB
Plaintext

| {% extends 'layout.html' %}
| {% from '_macros/_navigation.html' import navigation_project %}
include ../../../../pillar/src/templates/mixins/components
| {% set title = 'landing' %}
| {% from '_macros/_asset_list_item.html' import asset_list_item %}
| {% block page_title %}{{ project.name }}{% endblock%}
| {% block og %}
meta(property="og:type", content="website")
| {% if og_picture %}
meta(property="og:image", content="{{ og_picture.thumbnail('l', api=api) }}")
meta(name="twitter:image", content="{{ og_picture.thumbnail('l', api=api) }}")
| {% elif node and node.picture %}
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
meta(name="twitter:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% elif project.picture_header %}
meta(property="og:image", content="{{ project.picture_header.thumbnail('l', api=api) }}")
meta(name="twitter:image", content="{{ project.picture_header.thumbnail('l', api=api) }}")
| {% endif %}
| {% if show_project %}
meta(property="og:title", content="{{ project.name }} - Blender Cloud")
meta(name="twitter:title", content="{{ project.name }} - Blender Cloud")
meta(property="og:description", content="{{ project.summary }}")
meta(name="twitter:description", content="{{ project.summary }}")
meta(property="og:url", content="{{ url_for('projects.view', project_url=project.url, _external=True) }}")
| {% else %}
| {% if node %}
meta(property="og:title", content="{{ node.name }} - Blender Cloud")
meta(name="twitter:title", content="{{ node.name }} on Blender Cloud")
| {% if node.node_type == 'post' %}
| {% if node.properties.content %}
meta(property="og:description", content="{{ node.properties.content | truncate(180) }}")
meta(name="twitter:description", content="{{ node.properties.content | truncate(180) }}")
| {% else %}
meta(property="og:description", content="Blender Cloud, your source for open content and training")
meta(name="twitter:description", content="Blender Cloud, your source for open content and training")
| {% endif %}
| {% else %}
| {% if node.description %}
meta(property="og:description", content="{{ node.description | truncate(180) }}")
meta(name="twitter:description", content="{{ node.description | truncate(180) }}")
| {% else %}
meta(property="og:description", content="Blender Cloud, your source for open content and training")
meta(name="twitter:description", content="Blender Cloud, your source for open content and training")
| {% endif %}
| {% endif %}
meta(property="og:url", content="{{url_for('projects.view_node', project_url=project.url, node_id=node._id, _external=True)}}")
| {% else %}
meta(property="og:title", content="{{ project.name }} Blog on Blender Cloud")
meta(name="twitter:title", content="{{ project.name }} Blog on Blender Cloud")
meta(property="og:description", content="{{ project.summary }}")
meta(name="twitter:description", content="{{ project.summary }}")
meta(property="og:url", content="{{url_for('projects.view', project_url=project.url, _external=True)}}")
| {% endif %}
| {% endif %}
| {% endblock og %}
| {% block page_overlay %}
#page-overlay.video
.video-embed
#others
| {% endblock %}
| {% block css %}
link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css') }}", rel="stylesheet")
link(href="{{ url_for('static_cloud', filename='assets/css/project-main.css') }}", rel="stylesheet")
| {% endblock %}
| {% block navigation_tabs %}
| {{ navigation_project(project, navigation_links, extension_sidebar_links, title) }}
| {% endblock navigation_tabs %}
| {% block body %}
| {% if project.has_method('PUT') %}
+nav-secondary
+nav-secondary-link(
href="{{ url_for('projects.edit', project_url=project.url) }}",
class="text-white")
i.pi-edit.pr-2
span Edit Project
| {% endif %}
- var jumbotron_title = '{{ project.name }}';
- var jumbotron_lead = '{{ project.summary }}';
+jumbotron(
jumbotron_title,
jumbotron_lead,
"{{ project.picture_header.thumbnail('h', api=api) }}")(
class="jumbotron-overlay-gradient-fade-to-gray")
.container-fluid.landing
.row
.col-md-8.mx-auto.mt-5
.node-details-description
| {% if project.description %}
| {{ project | markdowned('description') }}
| {% endif %}
.row
.col-md-10.mx-auto
section.py-5
.gallery.mx-auto
| {% for n in activity_stream %}
| {% if n.node_type not in ['comment', 'post'] and n.picture %}
.thumbnail.expand-image-links
.img-container
a.js-open-overlay(
href="{{ n.picture.thumbnail('l', api=api) }}",
title="{{ n.name }}")
img(src="{{ n.picture.thumbnail('l', api=api) }}", alt="{{ n.name }}")
| {% endif %}
| {% endfor %}
.clearfix
| {% if project.nodes_featured %}
| {# In some cases featured_nodes might might be embedded #}
| {% if '_id' in project.nodes_featured[0] %}
| {% set featured_node_id=project.nodes_featured[0]._id %}
| {% else %}
| {% set featured_node_id=project.nodes_featured[0] %}
| {% endif %}
.text-center.p-5
a.btn.btn-outline-primary.px-5(
href="{{ url_for('projects.view_node', project_url=project.url, node_id=featured_node_id) }}")
| See More Artwork
| {% endif %}
.row
.col-md-10.mx-auto
h2.pb-3 Timeline
.timeline-dark
+timeline("{{ project._id }}")
| {% endblock body %}
| {% block footer_scripts %}
script.
function showOverlay(html_content) {
$('#page-overlay')
.addClass('active')
.html(html_content);
}
function hideOverlay() {
$('#page-overlay')
.removeClass('active')
.html('');
}
//- Click anywhere in the page to hide the overlay.
$(document).click(function () {
hideOverlay();
});
$(document).keyup(function (e) {
if (e.keyCode == 27) {
hideOverlay();
}
});
$("a.js-open-overlay").on( "click", function(e) {
e.preventDefault();
e.stopPropagation();
var url = $(this).attr('href');
showOverlay('<img src="' + url + '"/>');
});
| {% endblock %}