Skip to content
Snippets Groups Projects
Commit bed2e7b1 authored by kaiyou's avatar kaiyou
Browse files

Display profile transitions in profile lists

parent 4b0bd082
No related branches found
No related tags found
1 merge request!20Add 'remember me' button
......@@ -18,9 +18,8 @@
<dt>{% trans %}UUID{% endtrans %}</dt>
<dd><pre>{{ profile.uuid }}</pre></dd>
{% set status = profile.STATUSES[profile.status] %}
<dt>{% trans %}Status{% endtrans %}</dt>
<dd><span class="badge bg-{{ status[0] }}">{{ status[1] }}</span></dd>
<dd>{{ macros.profile_status(profile) }}</dd>
<dt>{% trans %}Created at{% endtrans %}</dt>
<dd>{{ profile.created_at }}</dd>
......
......@@ -29,7 +29,6 @@
<th>{% trans %}Actions{% endtrans %}</th>
</tr>
{% for profile in profiles %}
{% set status = profile.STATUSES[profile.status] %}
<tr>
{% if not service %}
<td>{{ profile.service.name }}</td>
......@@ -42,7 +41,7 @@
<td>-</td>
{% endif %}
<td>{{ profile.uuid }}</td>
<td><span class="badge bg-{{ status[0] }}">{{ status[1] }}</span></td>
<td>{{ macros.profile_status(profile) }}</td>
<td>{{ profile.created_at.date() }}</td>
<td>
{% if profile.status == "active" %}
......
......@@ -31,6 +31,16 @@
</ul>
{% endmacro %}
{% macro profile_status(profile) %}
{% set status = profile.STATUSES[profile.status] %}
<span class="badge bg-{{ status[0] }}">{{ status[1] }}</span>
{% if profile.transition %}
{% set transition = profile.STATUSES[profile.transition] %}
<i class="fa fa-arrow-right"></i>
<span class="badge bg-{{ transition[0] }}">{{ transition[1] }}</span>
{% endif %}
{% endmacro %}
{% macro infobox(title, text, color, icon) %}
<div class="info-box">
<span class="info-box-icon bg-{{ color }}"><i class="fa fa-{{ icon }}"></i></span>
......
......@@ -49,7 +49,7 @@
<tr>
<td><a href="{{ url_for("service.details", service_uuid=profile.service.uuid) }}">{{ profile.service.name }}</a></td>
<td><a href="{{ url_for("profile.details", profile_uuid=profile.uuid) }}">{{ profile.username }}</a></td>
<td>{{ profile.status }}</td>
<td>{{ macros.profile_status(profile) }}</td>
</tr>
{% endfor %}
</table>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment