Display blog list and posts within the project

TODO: Edit within the project as well
This commit is contained in:
2016-12-01 15:57:59 +01:00
parent f2942a20fe
commit b6b517688e
11 changed files with 365 additions and 159 deletions

View File

@@ -1,4 +1,90 @@
| {% extends 'layout.html' %}
| {% extends 'projects/view.html' %}
| {% set title = 'blog' %}
| {% block page_title %}{{node.name}} - Blog{% endblock%}
include view_embed
| {% block css %}
link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css', v=11220161) }}", rel="stylesheet")
link(href="{{ url_for('static_pillar', filename='assets/css/base.css', v=11220161) }}", rel="stylesheet")
link(href="{{ url_for('static_pillar', filename='assets/css/project-main.css', v=11220161) }}", rel="stylesheet")
link(href="{{ url_for('static_pillar', filename='assets/css/blog.css', v=11220161) }}", 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
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 %}")
i.jstree-icon.pi-document-text
| {{ post.name }}
| {% endfor %}
li.jstree-node(data-node-type="page")
a.jstree-anchor(
href="{{ url_for('projects.view', project_url=project.url) }}")
i.jstree-icon.pi-folder
| Browse Project
| {% 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 %}
| {% endblock %}

View File

@@ -0,0 +1,4 @@
| {% extends 'layout.html' %}
| {% block page_title %}{{node.name}} - Blog{% endblock%}
include view_embed