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' %}
| {% 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 %}
include ../../../pillar/src/templates/mixins/components
| {% set title = 'homepage' %}
@@ -65,14 +67,9 @@ meta(name="twitter:image", content="{% if main_project.picture_header %}{{ main_
| {% if activity_stream %}
.card-padless.p-2
| {% for n in activity_stream %}
| {% if n.node_type not in ['comment'] %}
+list-asset(
'{{ 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 %}")
| {% for child in activity_stream %}
| {% if child.node_type not in ['comment'] %}
| {{ asset_list_item(child, current_user) }}
| {% endif %}
| {% endfor %}
| {% else %}

View File

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