Refactoring table into partial file
This commit is contained in:
parent
b4305aa7fa
commit
80577d89de
@ -1,6 +1,6 @@
|
|||||||
{% extends "master.html" %}
|
{% extends "master.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load svg %}
|
|
||||||
|
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
@ -10,34 +10,13 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="member-table">
|
<div class="member-table">
|
||||||
<h1>{{ mymember.vorname }} {{ mymember.nachname }}</h1>
|
<h1>{{ mymember.vorname }} {{ mymember.nachname }}</h1>
|
||||||
|
|
||||||
<p>Geburtsdatum: {{ mymember.geburtsdatum }}</p>
|
<p>Geburtsdatum: {{ mymember.geburtsdatum }}</p>
|
||||||
|
|
||||||
<table>
|
<div class="mb-4">
|
||||||
<thead>
|
<h2 class="h5">Accounts</h2>
|
||||||
<tr>
|
{% include "partials/account_table.html" %}
|
||||||
<th>Name</th>
|
</div>
|
||||||
<th>Rolle</th>
|
|
||||||
<th>Aktiv</th>
|
|
||||||
<th>Aktionen</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for x in accounts %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ x.username }}</td>
|
|
||||||
<td>{{ x.rolle }}</td>
|
|
||||||
<td>{% if x.aktiv %}{% inline_svg 'icons/uxwing/check.svg' 'icon' %}{% endif %}</td>
|
|
||||||
<td><a href="{% url 'edit_account' x.id %}" title="Bearbeiten"><img src="{% static 'icons/heroicons/pencil.svg'%}" class="icon"></a> <a href="{% url 'delete_account' x.id %}" title="Löschen"><img src="{% static 'icons/heroicons/trash.svg'%}" class="icon"></a></td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
<tr>
|
|
||||||
<td colspan="4">
|
|
||||||
<a href="{% url 'create_account' mymember.id %}" class="button"><img src="{% static 'icons/heroicons/plus.svg'%}" class="icon"> Konto hinzufügen</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
<p>Back to <a href="/members">Members</a></p>
|
<p>Back to <a href="/members">Members</a></p>
|
||||||
|
|||||||
28
member/templates/partials/account_table.html
Normal file
28
member/templates/partials/account_table.html
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{% load static %}
|
||||||
|
{% load svg %}
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Rolle</th>
|
||||||
|
<th>Aktiv</th>
|
||||||
|
<th>Aktionen</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for x in accounts %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ x.username }}</td>
|
||||||
|
<td>{{ x.rolle }}</td>
|
||||||
|
<td>{% if x.aktiv %}{% inline_svg 'icons/uxwing/check.svg' 'icon' %}{% endif %}</td>
|
||||||
|
<td><a href="{% url 'edit_account' x.id %}" title="Bearbeiten"><img src="{% static 'icons/heroicons/pencil.svg'%}" class="icon"></a> <a href="{% url 'delete_account' x.id %}" title="Löschen"><img src="{% static 'icons/heroicons/trash.svg'%}" class="icon"></a></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="4">
|
||||||
|
<a href="{% url 'create_account' mymember.id %}" class="button"><img src="{% static 'icons/heroicons/plus.svg'%}" class="icon"> Konto hinzufügen</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
Loading…
x
Reference in New Issue
Block a user