From 536f63eab7c4297b4233983a207aedb75f214dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sat, 25 Nov 2017 20:39:20 +0100 Subject: [PATCH] add parenthesis and spaces and access restriction to connection list --- src/c3nav/editor/templates/editor/graph.html | 2 +- src/c3nav/editor/views/edit.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/c3nav/editor/templates/editor/graph.html b/src/c3nav/editor/templates/editor/graph.html index 8413c1ec..6fac02df 100644 --- a/src/c3nav/editor/templates/editor/graph.html +++ b/src/c3nav/editor/templates/editor/graph.html @@ -51,7 +51,7 @@ → {% for connection in connections %} {% if connection.from_node_id == active_node.pk %} - {{ connection.other_node.pk }}{% if connection.waytype %}{{ connection.waytype.title }}{% endif %}, + {{ connection.other_node.pk }}{% if connection.waytype %} ({{ connection.waytype.title }}){% endif %}{% if connection.access_restriction_id %} ({{ connection.access_restriction.title }}){% endif %}, {% endif %} {% endfor %}
diff --git a/src/c3nav/editor/views/edit.py b/src/c3nav/editor/views/edit.py index 160c133a..bdeb899d 100644 --- a/src/c3nav/editor/views/edit.py +++ b/src/c3nav/editor/views/edit.py @@ -490,7 +490,8 @@ def graph_edit(request, level=None, space=None): if active_node: for self_node, other_node in (('from_node', 'to_node'), ('to_node', 'from_node')): conn_qs = GraphEdge.objects.filter(Q(**{self_node+'__pk': active_node.pk})) - conn_qs = conn_qs.select_related(other_node+'__space', other_node+'__space__level', 'waytype') + conn_qs = conn_qs.select_related(other_node+'__space', other_node+'__space__level', + 'waytype', 'access_restriction') for edge in conn_qs: edge.other_node = getattr(edge, other_node)