2016-12-01 15:57:59 +01:00
|
|
|
| {% extends 'projects/view.html' %}
|
|
|
|
| {% set title = 'blog' %}
|
2017-02-08 18:10:05 +01:00
|
|
|
|
2016-08-19 09:19:06 +02:00
|
|
|
| {% block page_title %}{{node.name}} - Blog{% endblock%}
|
|
|
|
|
2016-12-01 15:57:59 +01:00
|
|
|
| {% block css %}
|
2017-02-08 18:10:05 +01:00
|
|
|
| {{ super() }}
|
2017-03-17 18:05:12 +01:00
|
|
|
link(href="{{ url_for('static_pillar', filename='assets/css/blog.css', v=17320171) }}", rel="stylesheet")
|
2016-12-01 15:57:59 +01:00
|
|
|
| {% endblock %}
|
|
|
|
|
|
|
|
| {% block project_context %}
|
2017-02-08 18:10:05 +01:00
|
|
|
| {% include 'nodes/custom/post/view_embed.html' %}
|
2016-12-01 15:57:59 +01:00
|
|
|
| {% endblock %}
|
|
|
|
|
|
|
|
| {% block project_tree %}
|
|
|
|
#project_tree.jstree.jstree-default.blog
|
|
|
|
ul.jstree-container-ul.jstree-children
|
2016-12-01 16:30:27 +01:00
|
|
|
li.jstree-node(data-node-type="page")
|
|
|
|
a.jstree-anchor(
|
2017-02-08 18:10:05 +01:00
|
|
|
href="{{ url_for('projects.view', project_url=project.url) }}")
|
2016-12-01 16:30:27 +01:00
|
|
|
| Browse Project
|
|
|
|
|
2016-12-01 15:57:59 +01:00
|
|
|
li.jstree-node.jstree-leaf(data-node-type="page")
|
|
|
|
a.jstree-anchor(
|
2017-02-08 18:10:05 +01:00
|
|
|
href="{{ url_for('main.project_blog', project_url=project.url) }}") Blog
|
2016-12-01 15:57:59 +01:00
|
|
|
|
|
|
|
| {% for post in posts %}
|
|
|
|
li.jstree-node
|
|
|
|
a.jstree-anchor(
|
2017-02-08 18:10:05 +01:00
|
|
|
href="{{ url_for_node(node=post) }}",
|
|
|
|
class="{% if post._id == node._id %}jstree-clicked{% endif %}")
|
2016-12-01 16:21:02 +01:00
|
|
|
.tree-item-thumbnail
|
|
|
|
| {% if post.picture %}
|
|
|
|
img(src="{{ post.picture.thumbnail('s', api=api) }}")
|
|
|
|
| {% else %}
|
|
|
|
i.pi-document-text
|
|
|
|
| {% endif %}
|
|
|
|
span.tree-item-title {{ post.name }}
|
|
|
|
span.tree-item-info
|
|
|
|
| {{ post._created | pretty_date }} · {{ post.user.full_name }}
|
2016-12-01 15:57:59 +01:00
|
|
|
| {% endfor %}
|
|
|
|
| {% endblock %}
|
|
|
|
|
|
|
|
| {% block footer_scripts %}
|
|
|
|
|
|
|
|
script.
|
2017-02-08 18:10:05 +01:00
|
|
|
ProjectUtils.setProjectAttributes({projectId: "{{project._id}}", isProject: false, nodeId: '{{node._id}}'});
|
2017-01-20 12:38:50 +01:00
|
|
|
/* Expand images when their link points to a jpg/png/gif */
|
|
|
|
/* TODO: De-duplicate code from blog index */
|
2017-02-08 18:10:05 +01:00
|
|
|
var page_overlay = document.getElementById('page-overlay');
|
|
|
|
$('.blog_index-item .item-content a img').on('click', function (e) {
|
2017-01-20 12:38:50 +01:00
|
|
|
e.preventDefault();
|
|
|
|
|
2017-02-08 18:10:05 +01:00
|
|
|
var href = $(this).parent().attr('href').split("?")[0];
|
2017-01-20 12:38:50 +01:00
|
|
|
var src = $(this).attr('src');
|
|
|
|
|
|
|
|
if (href.match("jpg$") || href.match("png$") || href.match("gif$")) {
|
2017-02-08 18:10:05 +01:00
|
|
|
|
2017-01-20 12:38:50 +01:00
|
|
|
$(page_overlay)
|
2017-02-08 18:10:05 +01:00
|
|
|
.addClass('active')
|
|
|
|
.html('<img src="' + src + '"/>');
|
2017-01-20 12:38:50 +01:00
|
|
|
} else {
|
|
|
|
window.location.href = href;
|
|
|
|
}
|
|
|
|
});
|
2017-02-08 18:10:05 +01:00
|
|
|
|
2017-03-23 18:52:24 +01:00
|
|
|
/* UI Stuff */
|
|
|
|
$(window).on("load resize",function(){
|
|
|
|
containerResizeY($(window).height());
|
|
|
|
|
|
|
|
if ($(window).width() > 480) {
|
|
|
|
project_container.style.height = (window.innerHeight - project_container.offsetTop) + "px";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-02-08 18:10:05 +01:00
|
|
|
| {% endblock footer_scripts %}
|