plain.admin 0.26.0__tar.gz → 0.27.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {plain_admin-0.26.0 → plain_admin-0.27.1}/PKG-INFO +1 -1
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/assets/admin/admin.css +6 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/assets/admin/admin.js +1 -2
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/cards/base.py +1 -1
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/cards/charts.py +2 -4
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/impersonate/views.py +2 -2
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/querystats/views.py +10 -2
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/base.html +5 -5
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/cards/base.html +2 -2
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/cards/card.html +1 -1
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/list.html +6 -6
- plain_admin-0.27.1/plain/admin/templates/elements/admin/Help.html +1 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/urls.py +1 -1
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/views/models.py +3 -3
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/views/objects.py +6 -6
- {plain_admin-0.26.0 → plain_admin-0.27.1}/pyproject.toml +1 -1
- plain_admin-0.26.0/plain/admin/templates/elements/admin/Help.html +0 -1
- {plain_admin-0.26.0 → plain_admin-0.27.1}/.gitignore +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/LICENSE +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/README.md +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/README.md +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/__init__.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/assets/admin/chart.js +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/assets/admin/jquery-3.6.1.slim.min.js +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/assets/admin/list.js +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/assets/admin/popper.min.js +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/assets/admin/tippy-bundle.umd.min.js +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/assets/toolbar/toolbar.js +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/cards/__init__.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/cards/tables.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/config.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/dates.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/default_settings.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/impersonate/README.md +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/impersonate/__init__.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/impersonate/middleware.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/impersonate/models.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/impersonate/permissions.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/impersonate/settings.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/impersonate/urls.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/middleware.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/querystats/README.md +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/querystats/__init__.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/querystats/core.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/querystats/middleware.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/querystats/urls.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/cards/chart.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/cards/table.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/delete.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/detail.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/index.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/page.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/search.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/UUID.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/bool.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/datetime.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/default.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/dict.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/get_display.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/img.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/list.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/model.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/queryset.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/Checkbox.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/CheckboxField.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/FieldErrors.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/Input.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/InputField.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/Label.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/Select.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/SelectField.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/Submit.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/Textarea.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/TextareaField.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/querystats/querystats.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/querystats/toolbar.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/toolbar/toolbar.html +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/toolbar.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/views/__init__.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/views/base.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/views/registry.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/views/types.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/views/viewsets.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/tests/app/settings.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/tests/app/urls.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/tests/app/users/migrations/0001_initial.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/tests/app/users/migrations/__init__.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/tests/app/users/models.py +0 -0
- {plain_admin-0.26.0 → plain_admin-0.27.1}/tests/test_admin.py +0 -0
@@ -55,6 +55,12 @@ main a:hover {
|
|
55
55
|
text-decoration: underline;
|
56
56
|
}
|
57
57
|
|
58
|
+
select {
|
59
|
+
border-radius: 6px;
|
60
|
+
background-color: rgba(255, 255, 255, 0.05);
|
61
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
62
|
+
}
|
63
|
+
|
58
64
|
.actions a, .actions button, main button {
|
59
65
|
display: inline-block;
|
60
66
|
padding: 8px 16px;
|
@@ -35,8 +35,7 @@ jQuery(function($) {
|
|
35
35
|
instance.popper.classList.add("*:rounded-md")
|
36
36
|
instance.popper.classList.add("*:shadow-lg")
|
37
37
|
instance.popper.classList.add("*:ring-1")
|
38
|
-
instance.popper.classList.add("*:ring-white")
|
39
|
-
instance.popper.classList.add("*:ring-opacity-5")
|
38
|
+
instance.popper.classList.add("*:ring-white/20")
|
40
39
|
},
|
41
40
|
});
|
42
41
|
});
|
@@ -75,7 +75,7 @@ class Card:
|
|
75
75
|
return self.link
|
76
76
|
|
77
77
|
def get_current_display(self) -> str:
|
78
|
-
return self.request.
|
78
|
+
return self.request.query_params.get(f"{self.get_slug()}.display", "")
|
79
79
|
|
80
80
|
def get_displays(self) -> list[str] | Enum | None:
|
81
81
|
if hasattr(self.displays, "copy"):
|
@@ -125,15 +125,13 @@ class TrendCard(ChartCard):
|
|
125
125
|
{
|
126
126
|
"data": calculate_trend_line(trend_data),
|
127
127
|
"type": "line",
|
128
|
-
"borderColor": "rgba(
|
128
|
+
"borderColor": "rgba(255, 255, 255, 0.3)",
|
129
129
|
"borderWidth": 2,
|
130
130
|
"fill": False,
|
131
131
|
"pointRadius": 0, # Optional: Hide points
|
132
132
|
},
|
133
133
|
],
|
134
134
|
},
|
135
|
-
# Hide the label
|
136
|
-
# "options": {"legend": {"display": False}},
|
137
135
|
# Hide the scales
|
138
136
|
"options": {
|
139
137
|
"plugins": {"legend": {"display": False}},
|
@@ -147,7 +145,7 @@ class TrendCard(ChartCard):
|
|
147
145
|
},
|
148
146
|
"maintainAspectRatio": False,
|
149
147
|
"elements": {
|
150
|
-
"bar": {"borderRadius": "3", "backgroundColor": "
|
148
|
+
"bar": {"borderRadius": "3", "backgroundColor": "#d6d6d6"}
|
151
149
|
},
|
152
150
|
},
|
153
151
|
}
|
@@ -12,7 +12,7 @@ class ImpersonateStartView(View):
|
|
12
12
|
impersonator = getattr(self.request, "impersonator", self.request.user)
|
13
13
|
if impersonator and can_be_impersonator(impersonator):
|
14
14
|
self.request.session[IMPERSONATE_KEY] = self.url_kwargs["pk"]
|
15
|
-
return ResponseRedirect(self.request.
|
15
|
+
return ResponseRedirect(self.request.query_params.get("next", "/"))
|
16
16
|
|
17
17
|
return ResponseForbidden()
|
18
18
|
|
@@ -20,4 +20,4 @@ class ImpersonateStartView(View):
|
|
20
20
|
class ImpersonateStopView(View):
|
21
21
|
def get(self):
|
22
22
|
self.request.session.pop(IMPERSONATE_KEY)
|
23
|
-
return ResponseRedirect(self.request.
|
23
|
+
return ResponseRedirect(self.request.query_params.get("next", "/"))
|
@@ -2,6 +2,7 @@ import json
|
|
2
2
|
|
3
3
|
from plain.auth.views import AuthViewMixin
|
4
4
|
from plain.http import ResponseRedirect
|
5
|
+
from plain.runtime import settings
|
5
6
|
from plain.views import TemplateView
|
6
7
|
|
7
8
|
|
@@ -9,6 +10,13 @@ class QuerystatsView(AuthViewMixin, TemplateView):
|
|
9
10
|
template_name = "querystats/querystats.html"
|
10
11
|
admin_required = True
|
11
12
|
|
13
|
+
def check_auth(self):
|
14
|
+
# Allow the view if we're in DEBUG
|
15
|
+
if settings.DEBUG:
|
16
|
+
return
|
17
|
+
|
18
|
+
super().check_auth()
|
19
|
+
|
12
20
|
def get_template_context(self):
|
13
21
|
context = super().get_template_context()
|
14
22
|
|
@@ -35,7 +43,7 @@ class QuerystatsView(AuthViewMixin, TemplateView):
|
|
35
43
|
return context
|
36
44
|
|
37
45
|
def post(self):
|
38
|
-
querystats_action = self.request.
|
46
|
+
querystats_action = self.request.data["querystats_action"]
|
39
47
|
|
40
48
|
if querystats_action == "enable":
|
41
49
|
self.request.session.setdefault("querystats", {})
|
@@ -45,4 +53,4 @@ class QuerystatsView(AuthViewMixin, TemplateView):
|
|
45
53
|
del self.request.session["querystats"]
|
46
54
|
|
47
55
|
# Redirect back to the page that submitted the form
|
48
|
-
return ResponseRedirect(self.request.
|
56
|
+
return ResponseRedirect(self.request.data.get("redirect_url", "."))
|
@@ -22,7 +22,7 @@
|
|
22
22
|
</head>
|
23
23
|
<body class="flex min-h-screen bg-stone-950">
|
24
24
|
|
25
|
-
<nav class="fixed top-0 left-0 right-0 h-14 px-
|
25
|
+
<nav class="fixed top-0 left-0 right-0 h-14 px-5 py-2 flex items-center justify-between sm:justify-evenly text-sm text-white/70 space-x-3">
|
26
26
|
<div class="flex items-center space-x-2">
|
27
27
|
<button type="button" data-toggle="#admin-sidebar,#admin-content" class="lg:hidden">
|
28
28
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="w-5 h-5 bi bi-list" viewBox="0 0 16 16">
|
@@ -70,8 +70,8 @@
|
|
70
70
|
</nav>
|
71
71
|
|
72
72
|
<div class="fixed top-14 bottom-2 left-2 right-2">
|
73
|
-
<aside id="admin-sidebar" data-toggle-class="hidden" class="flex-col bg-stone-950 z-50 border-r border-white/10 lg:border-none justify-between flex-shrink-0 hidden w-52
|
74
|
-
<div class="flex-grow">
|
73
|
+
<aside id="admin-sidebar" data-toggle-class="hidden" class="flex-col bg-stone-950 z-50 border-r border-white/10 lg:border-none justify-between flex-shrink-0 hidden w-52 overflow-auto lg:flex absolute top-0 bottom-0">
|
74
|
+
<div class="flex-grow pl-3.5 pr-5 pt-2">
|
75
75
|
<div>
|
76
76
|
{% for section, views in admin_registry.get_nav_sections().items() %}
|
77
77
|
<div class="mt-4 text-xs tracking-wide uppercase text-stone-300/90">{{ section }}</div>
|
@@ -94,7 +94,7 @@
|
|
94
94
|
<div class="text-xs tracking-wide text-stone-500">Recent</div>
|
95
95
|
</div> -->
|
96
96
|
</div>
|
97
|
-
<div class="mt-8 flex flex-col text-sm pb-3 pt-3 text-stone-400 sticky bottom-0 bg-stone-950">
|
97
|
+
<div class="mt-8 flex flex-col text-sm pb-3 pt-3 text-stone-400 sticky bottom-0 bg-stone-950/95 pl-3.5 pr-5">
|
98
98
|
<a class="sm:hidden py-1" href="{{ url('admin:search') }}">Global search</a>
|
99
99
|
<div class="flex items-center justify-between space-x-1.5">
|
100
100
|
<div class="flex items-center truncate">
|
@@ -127,7 +127,7 @@
|
|
127
127
|
<h1 class="sm:text-xl text-white/90">
|
128
128
|
{% block title %}{{ title }}{% endblock %}
|
129
129
|
</h1>
|
130
|
-
{% if description %}<p class="mt-1 text-sm text-
|
130
|
+
{% if description %}<p class="mt-1 text-sm text-white/50">{{ description }}</p>{% endif %}
|
131
131
|
</div>
|
132
132
|
</div>
|
133
133
|
{% endblock %}
|
@@ -8,14 +8,14 @@
|
|
8
8
|
<header class="flex justify-between items-center">
|
9
9
|
<div>
|
10
10
|
<h2 class="text-sm font-semibold">{{ title }}</h2>
|
11
|
-
{% if description %}<p class="mt-1 text-xs text-
|
11
|
+
{% if description %}<p class="mt-1 text-xs text-white/50">{{ description }}</p>{% endif %}
|
12
12
|
</div>
|
13
13
|
|
14
14
|
{% if displays %}
|
15
15
|
<select
|
16
16
|
hx-get
|
17
17
|
name="{{ slug }}.display"
|
18
|
-
class="text-
|
18
|
+
class="text-xs py-1.5">
|
19
19
|
<option value="">(Reset to default)</option>
|
20
20
|
{% for display in displays %}
|
21
21
|
<option {% if display == current_display %}selected{% endif %}>{{ display }}</option>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
{% if actions %}
|
28
28
|
<form method="POST" data-actions-form>
|
29
29
|
{{ csrf_input }}
|
30
|
-
<select name="action_name" class="text-sm
|
30
|
+
<select name="action_name" class="text-sm">
|
31
31
|
<option value="">Actions</option>
|
32
32
|
{% for action in actions %}
|
33
33
|
<option>{{ action }}</option>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
<form method="GET" class="inline-flex space-x-5">
|
42
42
|
{% if displays %}
|
43
|
-
<select data-autosubmit name="display" class="text-sm
|
43
|
+
<select data-autosubmit name="display" class="text-sm">
|
44
44
|
<option value="">Displays</option>
|
45
45
|
{% for display in displays %}
|
46
46
|
<option {% if display == current_display %}selected{% endif %}>{{ display }}</option>
|
@@ -119,7 +119,7 @@
|
|
119
119
|
|
120
120
|
{% if table_style != "simple" and actions %}
|
121
121
|
<td class="p-0 pl-1">
|
122
|
-
<input data-action-checkbox class="rounded-sm" type="checkbox" name="{{ get_object_pk(object) }}" />
|
122
|
+
<input data-action-checkbox class="rounded-sm bg-white/10" type="checkbox" name="{{ get_object_pk(object) }}" />
|
123
123
|
</td>
|
124
124
|
{% endif %}
|
125
125
|
|
@@ -136,7 +136,7 @@
|
|
136
136
|
{% set object_links = get_object_links(object) %}
|
137
137
|
{% if object_links %}
|
138
138
|
<td class="py-0">
|
139
|
-
<button data-dropdown class="inline-flex rounded-md border border-transparent hover
|
139
|
+
<button data-dropdown class="!bg-transparent inline-flex rounded-md border !border-transparent hover:!bg-white/10 hover:!border-white/10 px-3 py-1.5 text-sm font-medium text-white/80 focus:outline-none">
|
140
140
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-three-dots" viewBox="0 0 16 16">
|
141
141
|
<path d="M3 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/>
|
142
142
|
</svg>
|
@@ -161,7 +161,7 @@
|
|
161
161
|
{% if table_style != "simple" %}
|
162
162
|
<footer class="mt-4">
|
163
163
|
<div class="flex items-center justify-between">
|
164
|
-
<div class="py-2 text-sm text-
|
164
|
+
<div class="py-2 text-sm text-white/50">
|
165
165
|
{% if page.has_other_pages() %}
|
166
166
|
Page {{ page.number }} of {{ page.paginator.num_pages }} ({{ page.paginator.count }} results)
|
167
167
|
{% endif %}
|
@@ -174,7 +174,7 @@
|
|
174
174
|
<form data-autosubmit method="GET">
|
175
175
|
{% if show_search and search_query %}<input type="hidden" name="search" value="{{ search_query }}" />{% endif %}
|
176
176
|
{% if displays and current_display %}<input type="hidden" name="display" value="{{ current_display }}" />{% endif %}
|
177
|
-
<select name="page" class="text-xs
|
177
|
+
<select name="page" class="text-xs">
|
178
178
|
{% for page_num in page.paginator.page_range %}
|
179
179
|
<option value="{{ page_num }}" {% if page_num == page.number %}selected{% endif %}>Page {{ page_num }}</option>
|
180
180
|
{% endfor %}
|
@@ -0,0 +1 @@
|
|
1
|
+
<p class="mt-2 text-sm text-white/50">{{ help }}</p>
|
@@ -27,7 +27,7 @@ class AdminSearchView(AdminView):
|
|
27
27
|
def get_template_context(self):
|
28
28
|
context = super().get_template_context()
|
29
29
|
context["searchable_views"] = registry.get_searchable_views()
|
30
|
-
context["global_search_query"] = self.request.
|
30
|
+
context["global_search_query"] = self.request.query_params.get("query", "")
|
31
31
|
return context
|
32
32
|
|
33
33
|
|
@@ -77,7 +77,7 @@ class AdminModelListView(AdminListView):
|
|
77
77
|
def get_template_context(self):
|
78
78
|
context = super().get_template_context()
|
79
79
|
|
80
|
-
order_by = self.request.
|
80
|
+
order_by = self.request.query_params.get("order_by", "")
|
81
81
|
if order_by.startswith("-"):
|
82
82
|
order_by_field = order_by[1:]
|
83
83
|
order_by_direction = "-"
|
@@ -102,7 +102,7 @@ class AdminModelListView(AdminListView):
|
|
102
102
|
return self.model.objects.all()
|
103
103
|
|
104
104
|
def order_queryset(self, queryset):
|
105
|
-
if order_by := self.request.
|
105
|
+
if order_by := self.request.query_params.get("order_by"):
|
106
106
|
queryset = queryset.order_by(order_by)
|
107
107
|
elif self.queryset_order:
|
108
108
|
queryset = queryset.order_by(*self.queryset_order)
|
@@ -110,7 +110,7 @@ class AdminModelListView(AdminListView):
|
|
110
110
|
return queryset
|
111
111
|
|
112
112
|
def search_queryset(self, queryset):
|
113
|
-
if search := self.request.
|
113
|
+
if search := self.request.query_params.get("search"):
|
114
114
|
filters = Q()
|
115
115
|
for field in self.search_fields:
|
116
116
|
filters |= Q(**{f"{field}__icontains": search})
|
@@ -25,14 +25,14 @@ class AdminListView(HTMXViewMixin, AdminView):
|
|
25
25
|
context = super().get_template_context()
|
26
26
|
|
27
27
|
# Make this available on self for usage in get_objects and other methods
|
28
|
-
self.display = self.request.
|
28
|
+
self.display = self.request.query_params.get("display", "")
|
29
29
|
|
30
30
|
# Make this available to get_displays and stuff
|
31
31
|
self.objects = self.get_objects()
|
32
32
|
|
33
|
-
page_size = self.request.
|
33
|
+
page_size = self.request.query_params.get("page_size", self.page_size)
|
34
34
|
paginator = Paginator(self.objects, page_size)
|
35
|
-
self._page = paginator.get_page(self.request.
|
35
|
+
self._page = paginator.get_page(self.request.query_params.get("page", 1))
|
36
36
|
|
37
37
|
context["paginator"] = paginator
|
38
38
|
context["page"] = self._page
|
@@ -44,7 +44,7 @@ class AdminListView(HTMXViewMixin, AdminView):
|
|
44
44
|
context["current_display"] = self.display
|
45
45
|
|
46
46
|
# Implement search yourself in get_objects
|
47
|
-
context["search_query"] = self.request.
|
47
|
+
context["search_query"] = self.request.query_params.get("search", "")
|
48
48
|
context["show_search"] = self.show_search
|
49
49
|
|
50
50
|
context["table_style"] = getattr(self, "_table_style", "default")
|
@@ -78,10 +78,10 @@ class AdminListView(HTMXViewMixin, AdminView):
|
|
78
78
|
|
79
79
|
def post(self) -> Response:
|
80
80
|
# won't be "key" anymore, just list
|
81
|
-
action_name = self.request.
|
81
|
+
action_name = self.request.data.get("action_name")
|
82
82
|
actions = self.get_actions()
|
83
83
|
if action_name and action_name in actions:
|
84
|
-
target_pks = self.request.
|
84
|
+
target_pks = self.request.data["action_pks"].split(",")
|
85
85
|
response = self.perform_action(action_name, target_pks)
|
86
86
|
if response:
|
87
87
|
return response
|
@@ -1 +0,0 @@
|
|
1
|
-
<p class="mt-2 text-sm text-gray-500">{{ help }}</p>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/admin/values/get_display.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/Checkbox.html
RENAMED
File without changes
|
{plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/CheckboxField.html
RENAMED
File without changes
|
{plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/FieldErrors.html
RENAMED
File without changes
|
File without changes
|
{plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/InputField.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
{plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/SelectField.html
RENAMED
File without changes
|
File without changes
|
{plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/Textarea.html
RENAMED
File without changes
|
{plain_admin-0.26.0 → plain_admin-0.27.1}/plain/admin/templates/elements/admin/TextareaField.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|