Skip to content
Snippets Groups Projects
Verified Commit 23bab4b0 authored by ornanovitch's avatar ornanovitch
Browse files

refactor list tables

parent 436db774
No related branches found
No related tags found
1 merge request!24Admin lte3 corrections
......@@ -13,43 +13,47 @@
{% block content %}
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<tr>
{% if not service %}
<th>{% trans %}Service{% endtrans %}</th>
{% endif %}
<th>{% trans %}Profile username{% endtrans %}</th>
<th>{% trans %}Owned by{% endtrans %}</th>
<th>{% trans %}UUID{% endtrans %}</th>
<th>{% trans %}Status{% endtrans %}</th>
<th>{% trans %}Created on{% endtrans %}</th>
<th>{% trans %}Actions{% endtrans %}</th>
</tr>
{% for profile in profiles %}
<tr>
{% if not service %}
<td>{{ profile.service.name }}</td>
{% endif %}
{% if profile.user_uuid %}
<td><a href="{{ url_for("profile.details", profile_uuid=profile.uuid) }}">{{ profile.username }}</a></td>
<td><a href="{{ url_for("user.details", user_uuid=profile.user_uuid) }}">{{ profile.user.username }}</a></td>
{% else %}
<td>{{ profile.username }}</td>
<td>-</td>
{% endif %}
<td>{{ profile.uuid }}</td>
<td>{{ macros.profile_status(profile) }}</td>
<td>{{ profile.created_at.date() }}</td>
<td>
{% for action in common.get_actions(profile) %}
<a href="{{ action.url(profile) }}">{{ action.label | capitalize }}</a>
{% endfor %}
</td>
</tr>
{% endfor %}
<div class="col">
<div class="card">
<div class="card-body table-responsive p-0">
<table class="table table-striped table-hover text-nowrap">
<thead>
<tr>
{% if not service %}
<th>{% trans %}Service{% endtrans %}</th>
{% endif %}
<th>{% trans %}Profile username{% endtrans %}</th>
<th>{% trans %}Owned by{% endtrans %}</th>
<th>{% trans %}UUID{% endtrans %}</th>
<th>{% trans %}Status{% endtrans %}</th>
<th>{% trans %}Created on{% endtrans %}</th>
<th>{% trans %}Actions{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% for profile in profiles %}
<tr>
{% if not service %}
<td>{{ profile.service.name }}</td>
{% endif %}
{% if profile.user_uuid %}
<td><a href="{{ url_for("profile.details", profile_uuid=profile.uuid) }}">{{ profile.username }}</a></td>
<td><a href="{{ url_for("user.details", user_uuid=profile.user_uuid) }}">{{ profile.user.username }}</a></td>
{% else %}
<td>{{ profile.username }}</td>
<td>-</td>
{% endif %}
<td>{{ profile.uuid }}</td>
<td>{{ macros.profile_status(profile) }}</td>
<td>{{ profile.created_at.date() }}</td>
<td>
{% for action in common.get_actions(profile) %}
<a href="{{ action.url(profile) }}">{{ action.label | capitalize }}</a>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
......
......@@ -5,37 +5,41 @@
{% block content %}
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<tr>
<th>{% trans %}Service{% endtrans %}</th>
<th>{% trans %}Provider{% endtrans %}</th>
<th>{% trans %}Application{% endtrans %}</th>
<th>{% trans %}Policy{% endtrans %}</th>
<th>{% trans %}Max profiles{% endtrans %}</th>
<th>{% trans %}Actions{% endtrans %}</th>
</tr>
{% for service in services %}
{% set app = application.registry.get(service.application_id) %}
<tr>
<td><a href="{{ url_for(".details", service_uuid=service.uuid) }}">{{ service.name }}</a></td>
<td>{{ service.provider }}</td>
<td>{{ app.name }}</td>
<td>{{ service.POLICIES[service.policy] }}</td>
<td>{{ service.max_profiles }}</td>
<td>
<a href="{{ url_for("profile.list_for_service", service_uuid=service.uuid)}}">Profiles</a>&nbsp;
<a href="{{ url_for(".edit", service_uuid=service.uuid)}}">Edit</a>&nbsp;
{% for action, (label, profile, quick, function) in app.actions.items() %}
{% if quick and not profile %}
<a href="{{ url_for(".action", service_uuid=service.uuid, action=action) }}">{{ label }}</a>&nbsp;
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
<div class="col">
<div class="card">
<div class="card-body table-responsive p-0">
<table class="table table-striped table-hover text-nowrap">
<thead>
<tr>
<th>{% trans %}Service{% endtrans %}</th>
<th>{% trans %}Provider{% endtrans %}</th>
<th>{% trans %}Application{% endtrans %}</th>
<th>{% trans %}Policy{% endtrans %}</th>
<th>{% trans %}Max profiles{% endtrans %}</th>
<th>{% trans %}Actions{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% for service in services %}
{% set app = application.registry.get(service.application_id) %}
<tr>
<td><a href="{{ url_for(".details", service_uuid=service.uuid) }}">{{ service.name }}</a></td>
<td>{{ service.provider }}</td>
<td>{{ app.name }}</td>
<td>{{ service.POLICIES[service.policy] }}</td>
<td>{{ service.max_profiles }}</td>
<td>
<a href="{{ url_for("profile.list_for_service", service_uuid=service.uuid)}}">Profiles</a>&nbsp;
<a href="{{ url_for(".edit", service_uuid=service.uuid)}}">Edit</a>&nbsp;
{% for action, (label, profile, quick, function) in app.actions.items() %}
{% if quick and not profile %}
<a href="{{ url_for(".action", service_uuid=service.uuid, action=action) }}">{{ label }}</a>&nbsp;
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
......
......@@ -4,20 +4,24 @@
{% block content %}
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<tr>
<th>{% trans %}Username{% endtrans %}</th>
<th>{% trans %}Created on{% endtrans %}</th>
</tr>
{% for user in users %}
<tr>
<td><a href="{{ url_for("user.details", user_uuid=user.uuid) }}">{{ user.username }}</a></td>
<td>{{ user.created_at.date() }}</td>
</tr>
{% endfor %}
<div class="col">
<div class="card">
<div class="card-body table-responsive p-0">
<table class="table table-striped table-hover text-nowrap">
<thead>
<tr>
<th>{% trans %}Username{% endtrans %}</th>
<th>{% trans %}Created on{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td><a href="{{ url_for("user.details", user_uuid=user.uuid) }}">{{ user.username }}</a></td>
<td>{{ user.created_at.date() }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
......
......@@ -4,20 +4,24 @@
{% block content %}
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<tr>
<th>{% trans %}Username{% endtrans %}</th>
<th>{% trans %}Created on{% endtrans %}</th>
</tr>
{% for user in users %}
<tr>
<td><a href="{{ utils.url_or_intent("account.home", user_uuid=user.uuid) }}">{{ user.username }}</a></td>
<td>{{ user.created_at.date() }}</td>
</tr>
{% endfor %}
<div class="col">
<div class="card">
<div class="card-body table-responsive p-0">
<table class="table table-striped table-hover text-nowrap">
<thead>
<tr>
<th>{% trans %}Username{% endtrans %}</th>
<th>{% trans %}Created on{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td><a href="{{ utils.url_or_intent("account.home", user_uuid=user.uuid) }}">{{ user.username }}</a></td>
<td>{{ user.created_at.date() }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
......
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