New design for project landing pages and blogs
This commit is contained in:
@@ -1,28 +1,53 @@
|
||||
//- ******************************************************* -//
|
||||
| {% macro render_blog_post(node) %}
|
||||
| {% macro render_blog_post(node, project=None) %}
|
||||
| {% if node.picture %}
|
||||
a.blog_index-header(href="{{ node.url }}")
|
||||
img(src="{{ node.picture.thumbnail('l', api=api) }}")
|
||||
| {% endif %}
|
||||
|
||||
| {% if project and project._id != config.MAIN_PROJECT_ID %}
|
||||
nav.navbar-secondary
|
||||
.navbar-container
|
||||
nav.collapse.navbar-collapse
|
||||
ul.nav.navbar-nav.navbar-right
|
||||
li
|
||||
a.navbar-item(
|
||||
href="{{ url_for('projects.view', project_url='hero') }}",
|
||||
title="Hero Homepage")
|
||||
span
|
||||
b Hero
|
||||
li
|
||||
a.navbar-item.active(
|
||||
href="{{ url_for('main.project_blog', project_url=project.url) }}",
|
||||
title="Project Blog",
|
||||
class="{% if category == 'blog' %}active{% endif %}")
|
||||
span Blog
|
||||
li
|
||||
a.navbar-item(
|
||||
href="{{ url_for('main.project_blog', project_url=project.url) }}",
|
||||
title="Project Blog",
|
||||
class="{% if category == 'blog' %}active{% endif %}")
|
||||
span Explore
|
||||
| {% endif %}
|
||||
.blog_index-item
|
||||
a.item-title(
|
||||
href="{{ node.url }}")
|
||||
| {{ node.name }}
|
||||
ul.meta
|
||||
| {% if node.project.name %}
|
||||
li {{ node.project.name }}
|
||||
| {% endif %}
|
||||
|
||||
| {% if node.user.full_name%}
|
||||
li.who
|
||||
| by {{ node.user.full_name }}
|
||||
| {% endif %}
|
||||
li.when
|
||||
a(href="{{ node.url }}",
|
||||
title="Updated {{ node._updated | pretty_date }}")
|
||||
| {{ node._created | pretty_date }}
|
||||
|
||||
li
|
||||
a(href="{{ node.url }}#comments")
|
||||
| comment
|
||||
|
||||
a.item-title(
|
||||
href="{{ node.url }}")
|
||||
| {{ node.name }}
|
||||
|
||||
.item-content
|
||||
| {{ node.properties | markdowned('content') }}
|
||||
@@ -67,7 +92,7 @@ a.blog_index-header(href="{{ node.url }}")
|
||||
| {% endif %}
|
||||
|
||||
| {% if posts %}
|
||||
| {{ render_blog_post(posts[0]) }}
|
||||
| {{ render_blog_post(posts[0], project=project) }}
|
||||
|
||||
| {% for node in posts[1:] %}
|
||||
| {% if loop.first %}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
| {% import 'nodes/custom/blog/_macros.html' as blogmacros %}
|
||||
|
||||
| {% block body %}
|
||||
.container
|
||||
.container-fluid
|
||||
#blog_container.cloud-blog
|
||||
#blog_index-container
|
||||
.blog_index-header
|
||||
|
@@ -4,8 +4,13 @@
|
||||
|
||||
| {% block page_title %}Blog{% endblock%}
|
||||
|
||||
| {% block css %}
|
||||
| {{ super() }}
|
||||
link(href="{{ url_for('static_cloud', filename='assets/css/project-landing.css') }}", rel="stylesheet")
|
||||
| {% endblock css %}
|
||||
|
||||
| {% block body %}
|
||||
.container
|
||||
.container-fluid.blog
|
||||
#blog_container.cloud-blog
|
||||
#blog_index-container.expand-image-links
|
||||
| {{ blogmacros.render_blog_index(project, posts, can_create_blog_posts, api, more_posts_available, posts_meta) }}
|
||||
|
@@ -1,14 +1,16 @@
|
||||
| {% block body %}
|
||||
| {% extends 'projects/landing.html' %}
|
||||
|
||||
| {% block body %}
|
||||
| {% if node.picture %}
|
||||
header
|
||||
img.header(src="{{ node.picture.thumbnail('l', api=api) }}")
|
||||
| {% endif %}
|
||||
| {% block navbar_secondary %}
|
||||
| {{ super() }}
|
||||
| {% endblock navbar_secondary %}
|
||||
#node-container
|
||||
#node-overlay
|
||||
|
||||
| {% if node.picture %}
|
||||
section#node-preview.node-preview.page
|
||||
img.node-preview-thumbnail#node-preview-thumbnail(
|
||||
src="{{ node.picture.thumbnail('l', api=api) }}")
|
||||
| {% endif %}
|
||||
|
||||
section.node-details-container.page
|
||||
|
||||
.node-details-header
|
||||
@@ -28,6 +30,7 @@ include ../_scripts
|
||||
| {% endblock %}
|
||||
|
||||
| {% block footer_scripts %}
|
||||
| {{ super() }}
|
||||
script.
|
||||
// Push the correct URL onto the history. This push happens after the id has
|
||||
// been pushed to the history already. We should probably keep only this and
|
||||
@@ -41,6 +44,9 @@ script.
|
||||
url
|
||||
);
|
||||
// Generate GA pageview
|
||||
ga('send', 'pageview', location.pathname);
|
||||
$(document).ready(function () {
|
||||
ga('send', 'pageview', location.pathname);
|
||||
});
|
||||
|
||||
| {% endblock %}
|
||||
|
||||
|
@@ -4,15 +4,13 @@
|
||||
|
||||
#blog_index-container.expand-image-links
|
||||
.blog-action
|
||||
| {% if project and project._id == config.MAIN_PROJECT_ID %}
|
||||
| {% if node.has_method('PUT') %}
|
||||
a.btn.btn-default.button-edit(href="{{url_for('nodes.edit', node_id=node._id)}}")
|
||||
i.pi-edit
|
||||
| Edit Post
|
||||
| {% endif %}
|
||||
| {% endif %}
|
||||
|
||||
| {{ blogmacros.render_blog_post(node) }}
|
||||
| {{ blogmacros.render_blog_post(node, project=project) }}
|
||||
|
||||
#comments-embed
|
||||
.comments-list-loading
|
||||
|
@@ -18,10 +18,15 @@ meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
|
||||
|
||||
| {% block page_title %}{{node.name}} - Blog{% endblock%}
|
||||
|
||||
| {% block css %}
|
||||
| {{ super() }}
|
||||
link(href="{{ url_for('static_cloud', filename='assets/css/project-landing.css') }}", rel="stylesheet")
|
||||
| {% endblock css %}
|
||||
|
||||
| {% set title = 'blog' %}
|
||||
|
||||
| {% block body %}
|
||||
.container
|
||||
.container-fluid.blog
|
||||
| {% include 'nodes/custom/post/view_embed.html' %}
|
||||
| {% endblock %}
|
||||
|
||||
|
Reference in New Issue
Block a user