fix route request UI

This commit is contained in:
Laura Klünder 2024-03-30 17:20:24 +01:00
parent b1ae6ea391
commit 1e1df10bfa
2 changed files with 5 additions and 3 deletions

View file

@ -9,8 +9,9 @@
{% block subcontent %}
<p><a class="button" href="{{ success_url }}">Go back</a></p>
{% if msg_type == "MESH_ROUTE_REQUEST" %}
<p>Route to <a href="{% url "mesh.node.detail" pk=msg_data.address %}">{{ msg_data.address }} {% if node_name %} ({{ node_name }}){% endif %}</a></p>
{{ msg_type_raw }}
{% if msg_type_raw == "MESH_ROUTE_REQUEST" %}
<p>Route to <a href="{% url "mesh.node.detail" pk=msg_data.content.address %}">{{ msg_data.content.address }} {% if node_name %} ({{ node_name }}){% endif %}</a></p>
{% endif %}
<div class="columns">
<div>
@ -32,7 +33,7 @@
{% endfor %}
</table>
</div>
{% if msg_type == "MESH_ROUTE_REQUEST" %}
{% if msg_type_raw == "MESH_ROUTE_REQUEST" %}
<div style="min-width: 12vw;">
<h4>Routes</h4>
<table>

View file

@ -130,4 +130,5 @@ class MeshMessageSendingView(MeshControlMixin, TemplateView):
"node_name": node_names.get(data["msg_data"]["content"].get("address"), ""),
"recipients": [(address, node_names[address]) for address in data["recipients"]],
"msg_type": MeshMessageType[data["msg_data"]["content"]["msg_type"]].pretty_name,
"msg_type_raw": MeshMessageType[data["msg_data"]["content"]["msg_type"]],
}