better table in list

This commit is contained in:
sahama 2024-08-06 15:07:36 +03:30
parent 7cf960852f
commit acaec7fd14
5 changed files with 141 additions and 66 deletions

View file

@ -14,7 +14,6 @@
<link href="{% static 'bootstrap-5.3.0-dist/css/bootstrap.rtl.min.css' %}" rel="stylesheet"> <link href="{% static 'bootstrap-5.3.0-dist/css/bootstrap.rtl.min.css' %}" rel="stylesheet">
<link href="{% static 'bootstrap-icons-1.11.3/font/bootstrap-icons.css' %}" rel="stylesheet"> <link href="{% static 'bootstrap-icons-1.11.3/font/bootstrap-icons.css' %}" rel="stylesheet">
<link href="{% static 'fonts/vazirmatn-v33.003/misc/UI-Farsi-Digits/Vazirmatn-UI-FD-font-face.css' %}" rel="stylesheet"> <link href="{% static 'fonts/vazirmatn-v33.003/misc/UI-Farsi-Digits/Vazirmatn-UI-FD-font-face.css' %}" rel="stylesheet">
<link href="{% static 'fonts/Pelak/fonts.css' %}" rel="stylesheet">
<link href="{% static 'main.css' %}" rel="stylesheet"> <link href="{% static 'main.css' %}" rel="stylesheet">
<script src="{% static 'jquery-3.6.0.min.js' %}"></script> <script src="{% static 'jquery-3.6.0.min.js' %}"></script>

View file

@ -25,16 +25,40 @@
{% block content %} {% block content %}
<p>application: {{ object.name }}!</p> <h5>application</h5>
<p>client id: {{ object.client_id }}!</p> <p>{{ object.name }}</p>
<p>allowed_scopes:</p> <h5>allowed_scopes:</h5>
{% for scope in object.allowed_scopes %} <div class="table-responsive">
<div>{{ scope }}</div> <table class="table table-striped table-bordered table-hover table-sm">
{% endfor %} <caption>allowed_scopes</caption>
<p>own_scopes:</p> <thead>
<tr>
<th scope="col">
<div class="grid">
<div class="d-flex justify-content-center">
name
</div>
</div>
</th>
<th scope="col">
<div class="grid">
<div class="d-flex justify-content-center">
description
</div>
</div>
</th>
{# <th>actions</th>#}
</tr>
</thead>
<tbody>
{% for scope in object.scopes.all %} {% for scope in object.scopes.all %}
<div>{{ scope }}</div> <tr>
<td>{{ scope.name }}</td>
<td>{{ scope.description }}</td>
</tr>
{% endfor %} {% endfor %}
</tbody>
</table>
</div>
{% endblock %} {% endblock %}

View file

@ -21,24 +21,60 @@
{% block content %} {% block content %}
<table class="table"> <div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-sm">
<caption>application list</caption>
<thead>
<tr> <tr>
<th><a href="?{% get_filter_link request 'ordering' 'name' %}" >name{% if request.GET.ordering and 'name' in request.GET.ordering %}<i class="bi bi-arrow-down-short"></i>{% endif %}</a></th> <th>
<th><a href="?{% get_filter_link request 'ordering' 'client_id' %}" >client id{% if request.GET.ordering and 'client_id' in request.GET.ordering %}<i class="bi bi-arrow-down-short"></i>{% endif %}</a></th> <div class="grid">
<th>type</th> <div class="d-flex justify-content-center">
<th>actions</th> <a class="text-decoration-none" href="?{% get_filter_link request 'ordering' 'name' %}">
<span class="mt-1">name</span>
{% if request.GET.ordering and 'name' in request.GET.ordering %}
<span class="bi bi-arrow-down-short"></span>
{% endif %}
</a>
</div>
</div>
</th>
<th>
<div class="grid">
<div class="d-flex justify-content-center">
<a class="text-decoration-none"
href="?{% get_filter_link request 'ordering' 'client_id' %}">
<span class="mt-1">client id</span>
{% if request.GET.ordering and 'client_id' in request.GET.ordering %}
<span class="bi bi-arrow-down-short"></span>
{% endif %}
</a>
</div>
</div>
</th>
<th class="grid">
<div class="d-flex justify-content-center">
actions
</div>
</th>
</tr> </tr>
</thead>
<tbody>
{% for obj in object_list %} {% for obj in object_list %}
<tr> <tr>
<td>{{ obj.name }}</td> <td>{{ obj.name }}</td>
<td>{{ obj.client_id }}</td> <td>{{ obj.client_id }}</td>
<td>{{ obj.allows_grant_type }}</td> {# <td>{{ obj.allows_grant_type }}</td>#}
<td> <td>
<div class="grid"> <div class="grid">
<div class="d-flex justify-content-end"> <div class="d-flex justify-content-start">
<div class="me-2"> <div class="me-2">
<a href="{% url 'gooyal_oauth2:application_detail' pk=obj.pk %}"> <a href="{% url 'gooyal_oauth2:application_detail' pk=obj.pk %}">
<div class="btn btn-success"> <div class="btn btn-success btn-sm">
<span class="bi bi-gear-fill"></span> <span class="bi bi-gear-fill"></span>
</div> </div>
</a> </a>
@ -55,7 +91,9 @@
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
</table> </table>
</div>
{% include 'include/paginator.html' %} {% include 'include/paginator.html' %}
{% endblock %} {% endblock %}

View file

@ -20,14 +20,4 @@
{% block content %} {% block content %}
<p>application: {{ object.name }}!</p> <p>application: {{ object.name }}!</p>
<p>client id: {{ object.client_id }}!</p> <p>client id: {{ object.client_id }}!</p>
<p>allowed_scopes:</p>
{% for scope in object.allowed_scopes %}
<div>{{ scope }}</div>
{% endfor %}
<p>own_scopes:</p>
{% for scope in object.scopes.all %}
<div>{{ scope }}</div>
{% endfor %}
{% endblock %} {% endblock %}

View file

@ -21,12 +21,36 @@
{% block content %} {% block content %}
<table class="table"> <table class="table table-striped table-bordered table-hover table-sm">
<caption>application scope list</caption>
<tr> <tr>
<th><a href="?{% get_filter_link request 'ordering' 'name' %}" >name{% if request.GET.ordering and 'name' in request.GET.ordering %}<i class="bi bi-arrow-down-short"></i>{% endif %}</a></th> <th>
<div class="grid">
<div class="d-flex justify-content-center">
<a class="text-decoration-none" href="?{% get_filter_link request 'ordering' 'name' %}">
<span class="mt-1">name</span>
{% if request.GET.ordering and 'name' in request.GET.ordering %}
<span class="bi bi-arrow-down-short"></span>
{% endif %}
</a>
</div>
</div>
</th>
{# <th><a href="?{% get_filter_link request 'ordering' 'client_id' %}" >client id{% if request.GET.ordering and 'client_id' in request.GET.ordering %}<i class="bi bi-arrow-down-short"></i>{% endif %}</a></th>#} {# <th><a href="?{% get_filter_link request 'ordering' 'client_id' %}" >client id{% if request.GET.ordering and 'client_id' in request.GET.ordering %}<i class="bi bi-arrow-down-short"></i>{% endif %}</a></th>#}
<th>description</th> <th scope="col">
<th>actions</th> <div class="grid">
<div class="d-flex justify-content-center">
description
</div>
</div>
</th>
<th scope="col">
<div class="grid">
<div class="d-flex justify-content-center">
actions
</div>
</div>
</th>
</tr> </tr>
{% for obj in object_list %} {% for obj in object_list %}
<tr> <tr>
@ -38,7 +62,7 @@
<div class="d-flex justify-content-end"> <div class="d-flex justify-content-end">
<div class="me-2"> <div class="me-2">
<a href="{% url 'gooyal_oauth2:application_scope_detail' pk=obj.pk application_pk=application.pk %}"> <a href="{% url 'gooyal_oauth2:application_scope_detail' pk=obj.pk application_pk=application.pk %}">
<div class="btn btn-success"> <div class="btn btn-success btn-sm">
<span class="bi bi-gear-fill"></span> <span class="bi bi-gear-fill"></span>
</div> </div>
</a> </a>