Commit 5e0ee603 authored by Daniele Venzano's avatar Daniele Venzano

Use tornado-style reverse_url() for internal links in templates

parent 03dfd4f4
......@@ -38,11 +38,11 @@
<li>Status: <span style="font-weight: bold;">{{ e.status }}</span></li>
{% if e.is_running %}
<li>Actions:
<a href="/executions/terminate/{{ e.id }}">Terminate</a>
<a href="{{ reverse_url("execution_terminate", e.id) }}">Terminate</a>
</li>
{% elif e.status == "terminated" %}
<li>Actions:
<a href="/executions/restart/{{ e.id }}">Restart</a>
<a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a>
</li>
{% endif %}
{% if grafana_url is defined %}
......
......@@ -23,7 +23,7 @@
{% if page_n == current_page %}
{{ page_n + 1 }}&nbsp;
{% else %}
<a href="/executions/{{ page_n }}">{{ page_n + 1 }}</a>&nbsp;
<a href="{{ reverse_url("execution_list_page", page_n) }}">{{ page_n + 1 }}</a>&nbsp;
{% endif %}
{% endfor %}
</p>
......@@ -47,7 +47,7 @@
{% for e in executions %}
<tr>
<td>{{ e.id }}</td>
<td class="exec-name"><a href="/executions/inspect/{{ e.id }}">{{ e.name }}</a></td>
<td class="exec-name"><a href="{{ reverse_url("execution_inspect", e.id) }}">{{ e.name }}</a></td>
{% if user.role.can_operate_others %}
<td>{{ e.owner.username }}</td>
{% endif %}
......@@ -64,9 +64,9 @@
<td sorttable_customkey="{{ e.time_end }}"><script>format_timestamp("{{ e.time_end }}")</script></td>
{% endif %}
{% if e.is_active %}
<td><a href="/executions/terminate/{{ e.id }}">Terminate</a></td>
<td><a href="{{ reverse_url("execution_terminate", e.id) }}">Terminate</a></td>
{% else %}
<td><a href="/executions/restart/{{ e.id }}">Restart</a></td>
<td><a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a></td>
{% endif %}
</tr>
{% endfor %}
......@@ -78,7 +78,7 @@
{% if page_n == current_page %}
{{ page_n + 1 }}&nbsp;
{% else %}
<a href="/executions/{{ page_n }}">{{ page_n + 1 }}</a>&nbsp;
<a href="{{ reverse_url("execution_list_page", page_n) }}">{{ page_n + 1 }}</a>&nbsp;
{% endif %}
{% endfor %}
</p>
......
......@@ -40,7 +40,7 @@
{% for e in running_executions %}
<tr>
<td>{{ e.id }}</td>
<td><a href="/executions/inspect/{{ e.id }}">{{ e.name }}</a></td>
<td><a href="{{ reverse_url("execution_inspect", e.id) }}">{{ e.name }}</a></td>
<td>{{ e.status }}</td>
{% if e.time_start == None %}
<td>not yet</td>
......@@ -53,9 +53,9 @@
<td><script>format_timestamp("{{ e.time_end }}")</script></td>
{% endif %}
{% if e.is_active %}
<td><a href="/executions/terminate/{{ e.id }}">Terminate</a></td>
<td><a href="{{ reverse_url("execution_terminate", e.id) }}">Terminate</a></td>
{% else %}
<td><a href="/executions/restart/{{ e.id }}">Restart</a></td>
<td><a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a></td>
{% endif %}
</tr>
{% endfor %}
......@@ -82,7 +82,7 @@
{% for e in last_executions %}
<tr>
<td>{{ e.id }}</td>
<td><a href="/executions/inspect/{{ e.id }}">{{ e.name }}</a></td>
<td><a href="{{ reverse_url("execution_inspect", e.id) }}">{{ e.name }}</a></td>
<td>{{ e.status }}</td>
{% if e.time_start == None %}
<td>not yet</td>
......@@ -95,9 +95,9 @@
<td><script>format_timestamp("{{ e.time_end }}")</script></td>
{% endif %}
{% if e.is_active %}
<td><a href="/executions/terminate/{{ e.id }}">Terminate</a></td>
<td><a href="{{ reverse_url("execution_terminate", e.id) }}">Terminate</a></td>
{% else %}
<td><a href="/executions/restart/{{ e.id }}">Restart</a></td>
<td><a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a></td>
{% endif %}
</tr>
{% endfor %}
......
......@@ -10,7 +10,7 @@
<div id="loginbox">
<img alt="ZOE logo" src="{{ static_url("logo.png") }}">
<div id="login-form">
<form action="/login" method="post" id="login_form">
<form action="{{ reverse_url("login") }}" method="post" id="login_form">
<label for="username">Username:</label>
<input autocapitalize="off" autocorrect="off" class="text-input" id="username" name="username" tabindex="1" type="text" value=""><br>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment