Use django-crud-mixins for CRUD helpers

This commit is contained in:
2023-02-10 20:49:35 +00:00
parent 659b73e695
commit 119acdd734
42 changed files with 47 additions and 880 deletions

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table class="table is-fullwidth is-hoverable" id="callbacks-table">
<thead>

View File

@@ -1 +0,0 @@
<button class="modal-close is-large" aria-label="close"></button>

View File

@@ -1,3 +0,0 @@
<i
class="fa-solid fa-xmark has-text-grey-light float-right"
onclick='grid.removeWidget("widget-{{ unique }}");grid.compact();'></i>

View File

@@ -1,3 +0,0 @@
<i
class="fa-solid fa-xmark has-text-grey-light float-right"
data-script="on click remove the closest <nav/>"></i>

View File

@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block content %}
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
{% endblock %}

View File

@@ -1,72 +0,0 @@
{% load pretty %}
{% include 'partials/notify.html' %}
{% if live is not None %}
<h1 class="title">Live {{ context_object_name_singular }} info</h1>
<table class="table is-fullwidth is-hoverable">
<thead>
<th>attribute</th>
<th>value</th>
</thead>
<tbody>
{% block live_tbody %}
{% for key, item in live.items %}
{% if key in pretty %}
<tr>
<th>{{ key }}</th>
<td>
{% if item is not None %}
<pre>{{ item|pretty }}</pre>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<th>{{ key }}</th>
<td>
{% if item is not None %}
{{ item }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
{% endblock %}
</tbody>
</table>
{% endif %}
{% if object is not None %}
<h1 class="title">{{ title_singular }} info</h1>
<table class="table is-fullwidth is-hoverable">
<thead>
<th>attribute</th>
<th>value</th>
</thead>
<tbody>
{% block tbody %}
{% for key, item in object.items %}
{% if key in pretty %}
<tr>
<th>{{ key }}</th>
<td>
{% if item is not None %}
<pre>{{ item|pretty }}</pre>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<th>{{ key }}</th>
<td>
{% if item is not None %}
{{ item }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
{% endblock %}
</tbody>
</table>
{% endif %}

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,7 +0,0 @@
<div id="notification">
{% if message is not None %}
<div class="notification is-{{ class }}" hx-ext="remove-me" remove-me="3s">
{{ message }}
</div>
{% endif %}
</div>

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"
hx-target="#{{ context_object_name }}-table"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"

View File

@@ -1,4 +1,4 @@
{% include 'partials/notify.html' %}
{% include 'mixins/partials/notify.html' %}
<table
class="table is-fullwidth is-hoverable"