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

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

parent 03dfd4f4
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
<li>Status: <span style="font-weight: bold;">{{ e.status }}</span></li> <li>Status: <span style="font-weight: bold;">{{ e.status }}</span></li>
{% if e.is_running %} {% if e.is_running %}
<li>Actions: <li>Actions:
<a href="/executions/terminate/{{ e.id }}">Terminate</a> <a href="{{ reverse_url("execution_terminate", e.id) }}">Terminate</a>
</li> </li>
{% elif e.status == "terminated" %} {% elif e.status == "terminated" %}
<li>Actions: <li>Actions:
<a href="/executions/restart/{{ e.id }}">Restart</a> <a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a>
</li> </li>
{% endif %} {% endif %}
{% if grafana_url is defined %} {% if grafana_url is defined %}
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
{% if page_n == current_page %} {% if page_n == current_page %}
{{ page_n + 1 }}&nbsp; {{ page_n + 1 }}&nbsp;
{% else %} {% 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 %} {% endif %}
{% endfor %} {% endfor %}
</p> </p>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
{% for e in executions %} {% for e in executions %}
<tr> <tr>
<td>{{ e.id }}</td> <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 %} {% if user.role.can_operate_others %}
<td>{{ e.owner.username }}</td> <td>{{ e.owner.username }}</td>
{% endif %} {% endif %}
...@@ -64,9 +64,9 @@ ...@@ -64,9 +64,9 @@
<td sorttable_customkey="{{ e.time_end }}"><script>format_timestamp("{{ e.time_end }}")</script></td> <td sorttable_customkey="{{ e.time_end }}"><script>format_timestamp("{{ e.time_end }}")</script></td>
{% endif %} {% endif %}
{% if e.is_active %} {% 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 %} {% else %}
<td><a href="/executions/restart/{{ e.id }}">Restart</a></td> <td><a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a></td>
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} {% endfor %}
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
{% if page_n == current_page %} {% if page_n == current_page %}
{{ page_n + 1 }}&nbsp; {{ page_n + 1 }}&nbsp;
{% else %} {% 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 %} {% endif %}
{% endfor %} {% endfor %}
</p> </p>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
{% for e in running_executions %} {% for e in running_executions %}
<tr> <tr>
<td>{{ e.id }}</td> <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> <td>{{ e.status }}</td>
{% if e.time_start == None %} {% if e.time_start == None %}
<td>not yet</td> <td>not yet</td>
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
<td><script>format_timestamp("{{ e.time_end }}")</script></td> <td><script>format_timestamp("{{ e.time_end }}")</script></td>
{% endif %} {% endif %}
{% if e.is_active %} {% 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 %} {% else %}
<td><a href="/executions/restart/{{ e.id }}">Restart</a></td> <td><a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a></td>
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} {% endfor %}
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
{% for e in last_executions %} {% for e in last_executions %}
<tr> <tr>
<td>{{ e.id }}</td> <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> <td>{{ e.status }}</td>
{% if e.time_start == None %} {% if e.time_start == None %}
<td>not yet</td> <td>not yet</td>
...@@ -95,9 +95,9 @@ ...@@ -95,9 +95,9 @@
<td><script>format_timestamp("{{ e.time_end }}")</script></td> <td><script>format_timestamp("{{ e.time_end }}")</script></td>
{% endif %} {% endif %}
{% if e.is_active %} {% 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 %} {% else %}
<td><a href="/executions/restart/{{ e.id }}">Restart</a></td> <td><a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a></td>
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} {% endfor %}
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div id="loginbox"> <div id="loginbox">
<img alt="ZOE logo" src="{{ static_url("logo.png") }}"> <img alt="ZOE logo" src="{{ static_url("logo.png") }}">
<div id="login-form"> <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> <label for="username">Username:</label>
<input autocapitalize="off" autocorrect="off" class="text-input" id="username" name="username" tabindex="1" type="text" value=""><br> <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