Merge branch 'wip-redesign'

# Conflicts:
#	src/templates/projects/view.pug
This commit is contained in:
2018-09-06 13:30:24 +02:00
80 changed files with 1750 additions and 3528 deletions

View File

@@ -5,21 +5,21 @@ section.node-preview-forbidden
div
p Available to Blender Cloud subscribers
hr
hr.bg-white
| {% if current_user.has_cap('can-renew-subscription') %}
p
small You have a subscription, it just needs to be renewed.
a.btn(href="/renew")
a.btn.btn-light(href="/renew")
| #[i.pi-heart] Renew Subscription
| {% else %}
p
small Support Blender and get awesome stuff!
a.btn(href="{{ url_for('cloud.join') }}")
a.btn.btn-light(href="{{ url_for('cloud.join') }}")
| #[i.pi-heart] Get a Subscription
| {% endif %}
| {% if current_user.is_anonymous %}
p(style="margin-top: 15px")
small
a(href="{{ url_for('users.login') }}") Already a subscriber? Log in
a.text-white(href="{{ url_for('users.login') }}") Already a subscriber? Log in
| {% endif %}

View File

@@ -61,7 +61,7 @@ script(type="text/javascript").
}
{% if node.has_method('PUT') %}
$('.project-mode-view').show();
$('.project-mode-view').displayAs('inline-block');
{% else %}
$('.project-mode-view').hide();
{% endif %}

View File

@@ -23,7 +23,7 @@ section.node-preview.video
| {% block node_download %}
| {% if node.file_variations %}
button.btn.btn-default.dropdown-toggle(
button.btn.btn-outline-secondary.dropdown-toggle(
type="button",
data-toggle="dropdown",
aria-haspopup="true",

View File

@@ -1,142 +0,0 @@
//- ******************************************************* -//
| {% import 'projects/_macros.html' as projectmacros %}
| {% macro render_blog_post(node, project=None, pages=None) %}
| {% if node.picture %}
a.blog_index-header(href="{{ node.url }}")
img(src="{{ node.picture.thumbnail('h', api=api) }}")
| {% endif %}
| {% if project and project._id != config.MAIN_PROJECT_ID %}
| {{ projectmacros.render_secondary_navigation(project, pages=pages) }}
| {% 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
.item-content
| {{ node.properties | markdowned('content') }}
| {% endmacro %}
//- ******************************************************* -//
| {% macro render_blog_list_item(node) %}
.blog_index-item.list
| {% if node.picture %}
a.item-header(href="{{ node.url }}")
img.image(src="{{ node.picture.thumbnail('s', api=api) }}")
| {% else %}
a.item-header.nothumb(href="{{ node.url }}")
i.pi-document-text
| {% endif %}
a.item-title(
href="{{ node.url }}")
| {{node.name}}
.item-info.
#[span(title="{{node._created}}") {{node._created | pretty_date }}]
{% if node._created != node._updated %}
#[span(title="{{node._updated}}") (updated {{node._updated | pretty_date }})]
{% endif %}
{% if node.properties.category %} · {{node.properties.category}}{% endif %}
· {{node.user.full_name}}
{% if node.properties.status != 'published' %} · {{ node.properties.status}} {% endif %}
| {% endmacro %}
//- ******************************************************* -//
| {% macro render_blog_index(project, posts, can_create_blog_posts, api, more_posts_available, posts_meta, pages=None) %}
| {% if can_create_blog_posts %}
.blog-action
a.btn.btn-default.button-create(href="{{url_for('nodes.posts_create', project_id=project._id)}}")
i.pi-plus
| Create New Post
| {% endif %}
| {% if posts %}
| {{ render_blog_post(posts[0], project=project, pages=pages) }}
| {% for node in posts[1:] %}
| {% if loop.first %}
.blog-archive-navigation
span Blasts from the past
| {% endif %}
| {{ render_blog_list_item(node) }}
| {% endfor %}
| {% if more_posts_available %}
.blog-archive-navigation
a(href="{{ project.blog_archive_url }}")
| {{posts_meta.total - posts|length}} more blog posts over here
i.pi-angle-right
| {% endif %}
| {% else %}
.blog_index-item
.item-content No posts... yet!
| {% endif %} {# posts #}
| {% endmacro %}
//- Macro for rendering the navigation buttons for prev/next pages -//
| {% macro render_archive_pagination(project) %}
.blog-archive-navigation
| {% if project.blog_archive_prev %}
a.archive-nav-button(
href="{{ project.blog_archive_prev }}", rel="prev")
i.pi-angle-left
| Previous page
| {% else %}
span.archive-nav-button
i.pi-angle-left
| Previous page
| {% endif %}
a.archive-nav-button(
href="{{ url_for('main.project_blog', project_url=project.url) }}")
| Blog Index
| {% if project.blog_archive_next %}
a.archive-nav-button(
href="{{ project.blog_archive_next }}", rel="next")
| Next page
i.pi-angle-right
| {% else %}
span.archive-nav-button
| Next page
i.pi-angle-right
| {% endif %}
| {% endmacro %}
| {% macro render_archive(project, posts, posts_meta) %}
| {{ render_archive_pagination(project) }}
| {% for node in posts %}
| {{ render_blog_list_item(node) }}
| {% endfor %}
| {{ render_archive_pagination(project) }}
| {% endmacro %}

View File

@@ -2,11 +2,8 @@
| {% import 'nodes/custom/blog/_macros.html' as blogmacros %}
| {% block body %}
.container-fluid
#blog_container.cloud-blog
#blog_index-container
.blog_index-header
h3 Blog Archive
.container
h3 Blog Archive
| {{ blogmacros.render_archive(project, posts, posts_meta) }}
| {{ blogmacros.render_archive(project, posts, posts_meta) }}
| {% endblock body %}

View File

@@ -9,9 +9,7 @@ link(href="{{ url_for('static_pillar', filename='assets/css/blog.css') }}", rel=
| {% endblock %}
| {% block project_context %}
#blog_container
#blog_index-container.expand-image-links
| {{ blogmacros.render_blog_index(project, posts, can_create_blog_posts, api, more_posts_available, posts_meta) }}
| {{ blogmacros.render_blog_index(project, posts, can_create_blog_posts, api, more_posts_available, posts_meta) }}
| {% endblock %}
| {% block project_tree %}

View File

@@ -10,10 +10,7 @@ link(href="{{ url_for('static_cloud', filename='assets/css/project-landing.css')
| {% endblock css %}
| {% block body %}
.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, pages=pages) }}
| {{ blogmacros.render_blog_index(project, posts, can_create_blog_posts, api, more_posts_available, posts_meta, pages=pages) }}
| {% endblock %}
| {% block footer_scripts %}
@@ -25,7 +22,7 @@ script.
/* Expand images when their link points to a jpg/png/gif */
/* TODO: De-duplicate code from view post */
var page_overlay = document.getElementById('page-overlay');
$('.blog_index-item .item-content a img').on('click', function(e){
$('.item-content a img').on('click', function(e){
e.preventDefault();
var href = $(this).parent().attr('href');

View File

@@ -32,7 +32,6 @@
.comment-reply-preview-md
.comment-reply-info
.comment-action-cancel(
type="button",
title="{{ _('cancel') }}")
span {{ _('cancel') }}

View File

@@ -28,7 +28,7 @@ li.node-details-meta-list-item
| {% block node_download %}
| {% if node.properties.files %}
button.btn.btn-default.dropdown-toggle(
button.btn.btn-outline-secondary.dropdown-toggle(
title="Download HDRI",
type="button",
data-toggle="dropdown",

View File

@@ -68,9 +68,9 @@
| {% endif %}
| {% endfor %}
input.btn.btn-default.button-create(type='submit', value='Create {{ node_type.name }}')
input.btn.btn-outline-secondary(type='submit', value='Create {{ node_type.name }}')
a.btn.btn-default.button-back(href="{{ url_for('projects.view', project_url=project.url) }}blog")
a.btn.btn-link.button-back(href="{{ url_for('projects.view', project_url=project.url) }}blog")
| Back to Blog
#blog_post-create-container

View File

@@ -1,19 +1,9 @@
| {% import 'nodes/custom/blog/_macros.html' as blogmacros %}
#blog_container(class="{% if project and project._id == config.MAIN_PROJECT_ID %}cloud-blog{% endif %}")
| {{ blogmacros.render_blog_post(node, project=project) }}
#blog_index-container.expand-image-links
.blog-action
| {% 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 %}
| {{ blogmacros.render_blog_post(node, project=project) }}
#comments-embed
.comments-list-loading
i.pi-spin
#comments-embed.comments-compact
.comments-list-loading
i.pi-spin
include ../_scripts

View File

@@ -26,8 +26,7 @@ link(href="{{ url_for('static_cloud', filename='assets/css/project-landing.css')
| {% set title = 'blog' %}
| {% block body %}
.container-fluid.blog
| {% include 'nodes/custom/post/view_embed.html' %}
| {% include 'nodes/custom/post/view_embed.html' %}
| {% endblock %}

View File

@@ -91,11 +91,11 @@
a(href="{{ f.file.link }}",,
title="Download texture",
download="{{ f.file.filename }}")
button.btn.btn-default(type="button")
button.btn.btn-outline-secondary(type="button")
i.pi-download
| Download
| {% else %}
button.btn.btn-default.disabled.sorry(type="button")
button.btn.btn-outline-secondary.disabled.sorry(type="button")
i.pi-lock
| Download
| {% endif %}