Add HTML table tags

This commit is contained in:
Éloi Rivard 2023-03-09 18:34:36 +01:00
parent 36cc47e40d
commit cfb67ed89b
5 changed files with 127 additions and 107 deletions

View file

@ -13,23 +13,27 @@
</h2> </h2>
<table class="ui table"> <table class="ui table">
<thead> <thead>
<th></th>
<th>{% trans %}Name{% endtrans %}</th>
<th>{% trans %}Description{% endtrans %}</th>
<th>{% trans %}Number of members{% endtrans %}</th>
</thead>
{% for group in groups %}
<tr> <tr>
<td> <th></th>
<a href="{{ url_for('groups.group', groupname=group.name) }}"> <th>{% trans %}Name{% endtrans %}</th>
<i class="users circular black inverted icon"></i> <th>{% trans %}Description{% endtrans %}</th>
</a> <th>{% trans %}Number of members{% endtrans %}</th>
</td>
<td><a href="{{ url_for('groups.group', groupname=group.name) }}">{{ group.name }}</a></td>
<td>{% if group.description %}{{ group.description[0] }}{% endif %}</td>
<td>{{ group.member|len }}</td>
</tr> </tr>
{% endfor %} </thead>
<tbody>
{% for group in groups %}
<tr>
<td>
<a href="{{ url_for('groups.group', groupname=group.name) }}">
<i class="users circular black inverted icon"></i>
</a>
</td>
<td><a href="{{ url_for('groups.group', groupname=group.name) }}">{{ group.name }}</a></td>
<td>{% if group.description %}{{ group.description[0] }}{% endif %}</td>
<td>{{ group.member|len }}</td>
</tr>
{% endfor %}
</tbody>
</table> </table>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -15,19 +15,23 @@
<table class="ui table" data-order="[[ 3, &quot;desc&quot; ]]"> <table class="ui table" data-order="[[ 3, &quot;desc&quot; ]]">
<thead> <thead>
<th data-orderable="false">{% trans %}Code{% endtrans %}</th>
<th>{% trans %}Client{% endtrans %}</th>
<th>{% trans %}Subject{% endtrans %}</th>
<th>{% trans %}Created{% endtrans %}</th>
</thead>
{% for authorization in authorizations %}
<tr> <tr>
<td><a href="{{ url_for('oidc.authorizations.view', authorization_id=authorization.authorization_code_id) }}">{{ authorization.authorization_code_id }}</a></td> <th data-orderable="false">{% trans %}Code{% endtrans %}</th>
<td><a href="{{ url_for('oidc.clients.edit', client_id=authorization.client_id) }}">{{ authorization.client_id }}</a></td> <th>{% trans %}Client{% endtrans %}</th>
<td>{{ authorization.subject }}</td> <th>{% trans %}Subject{% endtrans %}</th>
<td data-order="{{ authorization.issue_date|timestamp }}>{{ authorization.issue_date }}</td> <th>{% trans %}Created{% endtrans %}</th>
</tr> </tr>
{% endfor %} </thead>
</table> <tbody>
{% for authorization in authorizations %}
<tr>
<td><a href="{{ url_for('oidc.authorizations.view', authorization_id=authorization.authorization_code_id) }}">{{ authorization.authorization_code_id }}</a></td>
<td><a href="{{ url_for('oidc.clients.edit', client_id=authorization.client_id) }}">{{ authorization.client_id }}</a></td>
<td>{{ authorization.subject }}</td>
<td data-order="{{ authorization.issue_date|timestamp }}">{{ authorization.issue_date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %} {% endblock %}

View file

@ -19,27 +19,31 @@
<table class="ui table"> <table class="ui table">
<thead> <thead>
<th></th>
<th>{% trans %}Name{% endtrans %}</th>
<th>{% trans %}URL{% endtrans %}</th>
<th>{% trans %}Created{% endtrans %}</th>
</thead>
{% for client in clients %}
<tr> <tr>
<td> <th></th>
<a href="{{ url_for('oidc.clients.edit', client_id=client.client_id) }}"> <th>{% trans %}Name{% endtrans %}</th>
{% if client.logo_uri %} <th>{% trans %}URL{% endtrans %}</th>
<img class="ui avatar image" src="{{ client.logo_uri }}" alt="Client logo"> <th>{% trans %}Created{% endtrans %}</th>
{% else %}
<i class="plug circular inverted black icon"></i>
{% endif %}
</a>
</td>
<td><a href="{{ url_for('oidc.clients.edit', client_id=client.client_id) }}">{{ client.client_name }}</a></td>
<td><a href="{{ client.client_uri }}">{{ client.client_uri }}</a></td>
<td>{% if client.client_id_issued_at %}{{ client.client_id_issued_at }}{% endif %}</td>
</tr> </tr>
{% endfor %} </thead>
<tbody>
{% for client in clients %}
<tr>
<td>
<a href="{{ url_for('oidc.clients.edit', client_id=client.client_id) }}">
{% if client.logo_uri %}
<img class="ui avatar image" src="{{ client.logo_uri }}" alt="Client logo">
{% else %}
<i class="plug circular inverted black icon"></i>
{% endif %}
</a>
</td>
<td><a href="{{ url_for('oidc.clients.edit', client_id=client.client_id) }}">{{ client.client_name }}</a></td>
<td><a href="{{ client.client_uri }}">{{ client.client_uri }}</a></td>
<td>{% if client.client_id_issued_at %}{{ client.client_id_issued_at }}{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table> </table>
{% endblock %} {% endblock %}

View file

@ -15,31 +15,35 @@
<table class="ui table" data-order="[[ 3, &quot;desc&quot; ]]"> <table class="ui table" data-order="[[ 3, &quot;desc&quot; ]]">
<thead> <thead>
<th data-orderable="false">{% trans %}Token{% endtrans %}</th>
<th>{% trans %}Client{% endtrans %}</th>
<th>{% trans %}Subject{% endtrans %}</th>
<th>{% trans %}Created{% endtrans %}</th>
</thead>
{% for token in tokens %}
<tr> <tr>
<td> <th data-orderable="false">{% trans %}Token{% endtrans %}</th>
<a href="{{ url_for('oidc.tokens.view', token_id=token.token_id) }}"> <th>{% trans %}Client{% endtrans %}</th>
{{ token.token_id }} <th>{% trans %}Subject{% endtrans %}</th>
</a> <th>{% trans %}Created{% endtrans %}</th>
</td>
<td>
<a href="{{ url_for('oidc.clients.edit', client_id=token.client.client_id) }}">
{{ token.client.client_name }}
</a>
</td>
<td>
<a href="{{ url_for("account.profile_edition", username=token.subject.uid[0]) }}">
{{ token.subject.uid[0] }}
</a>
</td>
<td data-order="{{ token.issue_date|timestamp }}">{{ token.issue_date }}</td>
</tr> </tr>
{% endfor %} </thead>
<tbody>
{% for token in tokens %}
<tr>
<td>
<a href="{{ url_for('oidc.tokens.view', token_id=token.token_id) }}">
{{ token.token_id }}
</a>
</td>
<td>
<a href="{{ url_for('oidc.clients.edit', client_id=token.client.client_id) }}">
{{ token.client.client_name }}
</a>
</td>
<td>
<a href="{{ url_for("account.profile_edition", username=token.subject.uid[0]) }}">
{{ token.subject.uid[0] }}
</a>
</td>
<td data-order="{{ token.issue_date|timestamp }}">{{ token.issue_date }}</td>
</tr>
{% endfor %}
</tbody>
</table> </table>
{% endblock %} {% endblock %}

View file

@ -1,54 +1,58 @@
{% macro user_list(watcher, users) %} {% macro user_list(watcher, users) %}
<table class="ui table"> <table class="ui table">
<thead> <thead>
{% if watcher.can_read("jpegPhoto") %}
<th></th>
{% endif %}
{% if watcher.can_read("uid") %}
<th>{% trans %}Login{% endtrans %}</th>
{% endif %}
{% if watcher.can_read("sn") or watcher.can_read("givenName") %}
<th>{% trans %}Name{% endtrans %}</th>
{% endif %}
{% if watcher.can_read("mail") %}
<th>{% trans %}Email{% endtrans %}</th>
{% endif %}
{% if watcher.can_manage_groups %}
<th>{% trans %}Groups{% endtrans %}</th>
{% endif %}
</thead>
{% for user in users %}
<tr> <tr>
{% if watcher.can_read("jpegPhoto") %} {% if watcher.can_read("jpegPhoto") %}
<td> <th></th>
<a href="{{ url_for('account.profile_edition', username=user.uid[0]) }}">
{% if user.jpegPhoto and user.jpegPhoto[0] %}
<img class="ui avatar image" src="{{ url_for("account.photo", uid=user.uid[0], field="jpegPhoto") }}" alt="User photo">
{% else %}
<i class="user circle big black icon"></i>
{% endif %}
</a>
</td>
{% endif %} {% endif %}
{% if watcher.can_read("uid") %} {% if watcher.can_read("uid") %}
<td><a href="{{ url_for('account.profile_edition', username=user.uid[0]) }}">{{ user.uid[0] }}</a></td> <th>{% trans %}Login{% endtrans %}</th>
{% endif %} {% endif %}
{% if watcher.can_read("sn") or watcher.can_read("givenName") %} {% if watcher.can_read("sn") or watcher.can_read("givenName") %}
<td>{{ user.name }}</td> <th>{% trans %}Name{% endtrans %}</th>
{% endif %} {% endif %}
{% if watcher.can_read("mail") %} {% if watcher.can_read("mail") %}
<td><a href="mailto:{{ user.mail[0] }}">{{ user.mail[0] }}</a></td> <th>{% trans %}Email{% endtrans %}</th>
{% endif %} {% endif %}
{% if watcher.can_manage_groups %} {% if watcher.can_manage_groups %}
<td> <th>{% trans %}Groups{% endtrans %}</th>
{% for group in user.groups %}
<a class="ui label" href="{{ url_for('groups.group', groupname=group.name) }}"{% if group.description %} title="{{ group.description[0] }}"{% endif %}>
{{ group.name }}
</a>
{% endfor %}
</td>
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} </thead>
<tbody>
{% for user in users %}
<tr>
{% if watcher.can_read("jpegPhoto") %}
<td>
<a href="{{ url_for('account.profile_edition', username=user.uid[0]) }}">
{% if user.jpegPhoto and user.jpegPhoto[0] %}
<img class="ui avatar image" src="{{ url_for("account.photo", uid=user.uid[0], field="jpegPhoto") }}" alt="User photo">
{% else %}
<i class="user circle big black icon"></i>
{% endif %}
</a>
</td>
{% endif %}
{% if watcher.can_read("uid") %}
<td><a href="{{ url_for('account.profile_edition', username=user.uid[0]) }}">{{ user.uid[0] }}</a></td>
{% endif %}
{% if watcher.can_read("sn") or watcher.can_read("givenName") %}
<td>{{ user.name }}</td>
{% endif %}
{% if watcher.can_read("mail") %}
<td><a href="mailto:{{ user.mail[0] }}">{{ user.mail[0] }}</a></td>
{% endif %}
{% if watcher.can_manage_groups %}
<td>
{% for group in user.groups %}
<a class="ui label" href="{{ url_for('groups.group', groupname=group.name) }}"{% if group.description %} title="{{ group.description[0] }}"{% endif %}>
{{ group.name }}
</a>
{% endfor %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table> </table>
{% endmacro %} {% endmacro %}