Files
pillar/src/templates/nodes/custom/post/view.jade

109 lines
3.3 KiB
Plaintext
Raw Normal View History

| {% extends 'projects/view.html' %}
| {% set title = 'blog' %}
| {% block page_title %}{{node.name}} - Blog{% endblock%}
| {% block css %}
2016-12-02 17:54:12 +01:00
link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css', v=21220161) }}", rel="stylesheet")
link(href="{{ url_for('static_pillar', filename='assets/css/base.css', v=21220161) }}", rel="stylesheet")
link(href="{{ url_for('static_pillar', filename='assets/css/project-main.css', v=21220161) }}", rel="stylesheet")
link(href="{{ url_for('static_pillar', filename='assets/css/blog.css', v=21220161) }}", rel="stylesheet")
| {% endblock %}
| {% block project_context %}
#blog_container(class="{% if project._id == config.MAIN_PROJECT_ID %}cloud-blog{% endif %}")
#blog_post-container
| {% if project._id == config.MAIN_PROJECT_ID %}
a.btn.btn-default.button-back(href="{{ url_for('projects.view', project_url=project.url) }}blog")
| Back to Blog
| {% if node.has_method('PUT') %}
a.btn.btn-default.button-edit(href="{{url_for('nodes.posts_edit', post_id=node._id)}}")
i.pi-edit
| Edit Post
| {% endif %}
.clearfix
| {% endif %}
| {% if node.picture %}
.blog_index-header
img(src="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
.blog_index-item
.item-title
| {{node.name}}
.item-info.
<span title="{{node._created}}">{{node._created | pretty_date }}</span>
{% if node._created != node._updated %}
<span title="{{node._updated}}">(updated {{node._updated | pretty_date }})</span>
{% endif %}
{% if node.properties.category %}| {{node.properties.category}}{% endif %}
| by {{node.user.full_name}}
.item-content
| {{ node.properties.content }}
#comments-embed
#comments-list-items-loading
i.pi-spin
| {% 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(
href="{{ url_for('projects.view', project_url=project.url) }}")
| Browse Project
li.jstree-node.jstree-leaf(data-node-type="page")
a.jstree-anchor(
href="{{ url_for('main.project_blog', project_url=project.url) }}") Blog
| {% for post in posts %}
li.jstree-node
a.jstree-anchor(
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 }}
| {% endfor %}
| {% endblock %}
| {% block footer_scripts %}
include ../_scripts
script.
{% if project.has_method('PUT') %}
/* Edit Button */
$('#item_edit').click(function(e){
e.preventDefault();
$('.button-edit-icon').addClass('pi-spin spin').removeClass('pi-edit');
window.location.replace("{{url_for('nodes.posts_edit', post_id=node._id)}}");
});
{% endif %}
2016-12-01 16:42:17 +01:00
var project_container = document.getElementById('project-container');
/* UI Stuff */
$(window).on("load resize",function(){
containerResizeY($(window).height());
if ($(window).width() > 480) {
project_container.style.height = (window.innerHeight - project_container.offsetTop) + "px";
}
});
| {% endblock %}