From b3a36f283309c5a295bafca6ed72d260bf999289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 25 Jan 2018 15:51:15 +0100 Subject: [PATCH] Fix T49930: bug in texture count --- pillar/web/nodes/routes.py | 4 ++-- .../nodes/custom/group_texture/view_embed.pug | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/pillar/web/nodes/routes.py b/pillar/web/nodes/routes.py index 5af09e85..3996b6b5 100644 --- a/pillar/web/nodes/routes.py +++ b/pillar/web/nodes/routes.py @@ -30,7 +30,7 @@ from pillar.web.nodes.custom.storage import StorageNode from pillar.web.projects.routes import project_update_nodes_list from pillar.web.utils import get_file from pillar.web.utils import attach_project_pictures -from pillar.web.utils.jstree import jstree_build_children +from pillar.web.utils.jstree import jstree_build_children, GROUP_NODES from pillar.web.utils.jstree import jstree_build_from_node from pillar.web.utils.forms import build_file_select_form from pillar.web import system_util @@ -159,7 +159,7 @@ def view(node_id, extra_template_args: dict=None): 'user': 1, 'properties.content_type': 1} children_where = {'parent': node._id} - if node_type_name == 'group': + if node_type_name in GROUP_NODES: children_where['properties.status'] = 'published' children_projection['permissions.world'] = 1 else: diff --git a/src/templates/nodes/custom/group_texture/view_embed.pug b/src/templates/nodes/custom/group_texture/view_embed.pug index a52e7bd8..01696a28 100644 --- a/src/templates/nodes/custom/group_texture/view_embed.pug +++ b/src/templates/nodes/custom/group_texture/view_embed.pug @@ -22,10 +22,7 @@ section.node-children.group.texture - | {% if children %} - | {% for child in children %} - | {% if child.properties.status == 'published' %} - + | {% for child in children %} a.list-node-children-container( href="#", data-node_id="{{ child._id }}", @@ -114,12 +111,10 @@ span {{ child.name }} | {% endif %} - | {% endif %} - | {% endfor %} | {% else %} .list-node-children-container .list-node-children-empty No textures... yet! - | {% endif %} + | {% endfor %} script. // Generate GA pageview @@ -193,4 +188,3 @@ script. include ../_scripts | {% endblock %} -