Homepage: Use macro for listing assets

This commit is contained in:
2018-09-11 17:46:09 +02:00
parent c90cd41e23
commit 10f15185e0
3 changed files with 20 additions and 20 deletions

View File

@@ -1,6 +1,8 @@
| {% extends 'layout.html' %} | {% extends 'layout.html' %}
| {% from '_macros/_navigation.html' import navigation_tabs %} | {% from '_macros/_navigation.html' import navigation_tabs %}
| {% from '_macros/_asset_list_item.html' import asset_list_item %}
| {% from 'nodes/custom/blog/_macros.html' import render_blog_post %} | {% from 'nodes/custom/blog/_macros.html' import render_blog_post %}
include ../../../pillar/src/templates/mixins/components include ../../../pillar/src/templates/mixins/components
| {% set title = 'homepage' %} | {% set title = 'homepage' %}
@@ -65,14 +67,9 @@ meta(name="twitter:image", content="{% if main_project.picture_header %}{{ main_
| {% if activity_stream %} | {% if activity_stream %}
.card-padless.p-2 .card-padless.p-2
| {% for n in activity_stream %} | {% for child in activity_stream %}
| {% if n.node_type not in ['comment'] %} | {% if child.node_type not in ['comment'] %}
+list-asset( | {{ asset_list_item(child, current_user) }}
'{{ n.name }}',
'{{ url_for_node(node=n) }}',
"{% if n.picture %}{{ n.picture.thumbnail('l', api=api) }}{% endif %}",
"{% if n.properties.content_type %}{{ n.properties.content_type | undertitle }}{% else %}{{ n.node_type | undertitle }}{% endif %}",
"{{ n._updated | pretty_date }}")(class="{% if n.permissions.world %}free{% endif %}")
| {% endif %} | {% endif %}
| {% endfor %} | {% endfor %}
| {% else %} | {% else %}

View File

@@ -160,17 +160,20 @@ link(href="{{ url_for('static_pillar', filename='assets/css/project-main.css') }
#project_nav-container #project_nav-container
| {% if title != 'about' %} | {% if title != 'about' %}
| {% block project_tree %} | {% block project_tree %}
#project_tree.bg-white #project_tree.bg-white.border-right
| {% endblock project_tree %} | {% endblock project_tree %}
| {% endif %} | {% endif %}
#project_context-container.border-left #project_context-container
| {% if project.has_method('PUT') %} | {% if project.has_method('PUT') %}
#project_context-header.d-flex.justify-content-end.position-fixed.bg-white #project_context-header.position-fixed
ul.project-edit-tools.disabled.d-flex.list-unstyled.py-1.mb-0 ul.project-edit-tools.disabled.d-flex.list-unstyled.py-2.mb-0
li.dropdown li.dropdown(
button.btn.btn-sm.btn-outline-secondary.dropdown-toggle( title="Create...",
data-toggle="tooltip",
data-placement="left")
button.dropdown-toggle.btn.btn-sm.btn-outline-secondary(
id="item_add", id="item_add",
class="project-mode-view", class="project-mode-view",
type="button", type="button",
@@ -178,21 +181,21 @@ link(href="{{ url_for('static_pillar', filename='assets/css/project-main.css') }
aria-haspopup="true", aria-haspopup="true",
aria-expanded="false") aria-expanded="false")
i.button-add-icon.pi-collection-plus i.button-add-icon.pi-collection-plus
| New...
ul.dropdown-menu.dropdown-menu-right( ul.dropdown-menu.dropdown-menu-right(
class="add_new-menu") class="add_new-menu")
| {{ add_new_menu(project.node_types) }} | {{ add_new_menu(project.node_types) }}
li.button-edit li.button-edit
a.btn.btn-sm.btn-outline-secondary.ml-2.px-3.text-capitalize( a.btn.btn-sm.btn-outline-secondary.ml-2.px-2(
id="item_edit", id="item_edit",
class="project-mode-view", class="project-mode-view",
href="javascript:void(0);", href="javascript:void(0);",
title="Edit", title="Edit",
data-project_id="{{project._id}}") data-project_id="{{project._id}}",
i.button-edit-icon.pi-edit.pr-2 data-toggle="tooltip",
| Edit Project data-placement="top")
i.button-edit-icon.pi-edit
li.dropdown li.dropdown
button.dropdown-toggle.btn.btn-sm.btn-outline-secondary.mx-2( button.dropdown-toggle.btn.btn-sm.btn-outline-secondary.mx-2(

View File

@@ -73,7 +73,7 @@ meta(name="twitter:image", content="{{ page_header_image }}")
hr.pb-2 hr.pb-2
+card-deck(3) +card-deck
| {% for project in projects %} | {% for project in projects %}
| {% if (project.status == 'published') or (project.status == 'pending' and current_user.is_authenticated) and project._id != config.MAIN_PROJECT_ID %} | {% if (project.status == 'published') or (project.status == 'pending' and current_user.is_authenticated) and project._id != config.MAIN_PROJECT_ID %}