plain.admin 0.29.1__py3-none-any.whl → 0.31.0__py3-none-any.whl
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/assets/admin/admin.css +90 -88
- plain/admin/assets/admin/admin.js +79 -73
- plain/admin/assets/admin/list.js +19 -18
- plain/admin/assets/toolbar/toolbar.js +54 -55
- plain/admin/templates/admin/base.html +4 -4
- plain/admin/templates/elements/admin/CheckboxField.html +6 -4
- plain/admin/templates/elements/admin/InputField.html +6 -4
- plain/admin/templates/elements/admin/Label.html +1 -1
- plain/admin/templates/elements/admin/SelectField.html +6 -4
- plain/admin/templates/elements/admin/Submit.html +1 -1
- plain/admin/templates/elements/admin/TextareaField.html +2 -0
- {plain_admin-0.29.1.dist-info → plain_admin-0.31.0.dist-info}/METADATA +1 -1
- {plain_admin-0.29.1.dist-info → plain_admin-0.31.0.dist-info}/RECORD +19 -19
- /plain/admin/assets/admin/{chart.js → vendor/chart.js} +0 -0
- /plain/admin/assets/admin/{jquery-3.6.1.slim.min.js → vendor/jquery-3.6.1.slim.min.js} +0 -0
- /plain/admin/assets/admin/{popper.min.js → vendor/popper.min.js} +0 -0
- /plain/admin/assets/admin/{tippy-bundle.umd.min.js → vendor/tippy-bundle.umd.min.js} +0 -0
- {plain_admin-0.29.1.dist-info → plain_admin-0.31.0.dist-info}/WHEEL +0 -0
- {plain_admin-0.29.1.dist-info → plain_admin-0.31.0.dist-info}/licenses/LICENSE +0 -0
@@ -6,136 +6,138 @@ We shouldn't use many custom classes in here (like .btn) because the user
|
|
6
6
|
could unintentionally overwrite those since our CSS is combined.
|
7
7
|
*/
|
8
8
|
table {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
width: 100%;
|
10
|
+
font-size: .875rem;
|
11
|
+
line-height: 1.25rem;
|
12
|
+
table-layout: auto;
|
13
13
|
}
|
14
14
|
|
15
15
|
th {
|
16
|
-
|
17
|
-
|
16
|
+
text-align: left;
|
17
|
+
padding: 0.5rem 0.5rem;
|
18
18
|
}
|
19
19
|
|
20
20
|
table th a {
|
21
|
-
|
21
|
+
color: rgba(255, 255, 255, 0.6);
|
22
22
|
}
|
23
23
|
|
24
24
|
table td a {
|
25
|
-
|
25
|
+
color: white;
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
&:hover {
|
28
|
+
text-decoration: none;
|
29
|
+
}
|
30
30
|
}
|
31
31
|
|
32
32
|
tbody tr:hover {
|
33
|
-
|
33
|
+
background-color: rgb(255, 255, 255, 0.1);
|
34
34
|
}
|
35
35
|
|
36
36
|
td {
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
padding: 0.5rem 0.5rem;
|
38
|
+
white-space: nowrap;
|
39
|
+
border-bottom: 1px solid rgb(255, 255, 255, 0.1);
|
40
40
|
}
|
41
41
|
tr:last-child td {
|
42
|
-
|
42
|
+
border-bottom: none;
|
43
43
|
}
|
44
44
|
|
45
45
|
table img {
|
46
|
-
|
47
|
-
|
46
|
+
height: 1.2rem;
|
47
|
+
border-radius: 2px;
|
48
48
|
}
|
49
49
|
|
50
50
|
main a {
|
51
|
-
|
51
|
+
color: rgb(37, 99, 235);
|
52
52
|
}
|
53
53
|
|
54
54
|
main a:hover {
|
55
|
-
|
55
|
+
text-decoration: underline;
|
56
56
|
}
|
57
57
|
|
58
58
|
select {
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
}
|
63
|
-
|
64
|
-
.actions a,
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
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
|
+
|
64
|
+
.actions a,
|
65
|
+
.actions button,
|
66
|
+
main button {
|
67
|
+
display: inline-block;
|
68
|
+
padding: 8px 16px;
|
69
|
+
font-size: 14px;
|
70
|
+
font-weight: 500;
|
71
|
+
color: #ffffff;
|
72
|
+
text-align: center;
|
73
|
+
text-decoration: none;
|
74
|
+
background-color: #2a2826;
|
75
|
+
border: 1px solid #3f3d3b;
|
76
|
+
border-radius: 6px;
|
77
|
+
transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
|
78
|
+
cursor: pointer;
|
79
|
+
flex-shrink: 0;
|
80
|
+
|
81
|
+
@media (max-width: 640px) {
|
82
|
+
font-size: 12px;
|
83
|
+
padding: 6px 12px;
|
84
|
+
}
|
85
|
+
|
86
|
+
&:hover {
|
87
|
+
background-color: #2a2928;
|
88
|
+
border-color: #504e4c;
|
89
|
+
transform: translateY(-1px);
|
90
|
+
}
|
91
|
+
|
92
|
+
&:active {
|
93
|
+
background-color: #141312;
|
94
|
+
border-color: #3f3d3b;
|
95
|
+
transform: translateY(0);
|
96
|
+
}
|
97
|
+
|
98
|
+
&:focus {
|
99
|
+
outline: 2px solid #e5e7eb;
|
100
|
+
outline-offset: 2px;
|
101
|
+
}
|
100
102
|
}
|
101
103
|
|
102
104
|
main button[type="submit"] {
|
103
|
-
|
104
|
-
|
105
|
+
background-color: #2563eb;
|
106
|
+
border-color: #2563eb;
|
105
107
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
108
|
+
&:hover {
|
109
|
+
background-color: #1d4ed8;
|
110
|
+
border-color: #1d4ed8;
|
111
|
+
}
|
112
|
+
&:focus {
|
113
|
+
outline: 2px solid #2563eb;
|
114
|
+
outline-offset: 2px;
|
115
|
+
}
|
114
116
|
}
|
115
117
|
|
116
118
|
/* Cards use these? */
|
117
119
|
section {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
120
|
+
border: rgba(255, 255, 255, 0.1) 1px solid;
|
121
|
+
border-radius: 0.275rem;
|
122
|
+
overflow: auto;
|
123
|
+
background-color: rgba(255, 255, 255, 0.05);
|
124
|
+
color: rgba(255, 255, 255, 0.8);
|
125
|
+
display: flex;
|
126
|
+
flex-direction: column;
|
125
127
|
}
|
126
128
|
|
127
129
|
section > header {
|
128
|
-
|
129
|
-
|
130
|
-
|
130
|
+
padding: 0.5rem;
|
131
|
+
/* background-color: #FFFCF0; */
|
132
|
+
border-bottom: rgba(255, 255, 255, 0.05) 1px solid;
|
131
133
|
}
|
132
134
|
|
133
135
|
section > div {
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
136
|
+
padding: 0.75rem 0.5rem;
|
137
|
+
flex-grow: 1;
|
138
|
+
display: flex;
|
139
|
+
flex-direction: column;
|
140
|
+
align-items: center;
|
141
|
+
justify-content: center;
|
142
|
+
overflow: auto;
|
141
143
|
}
|
@@ -1,83 +1,89 @@
|
|
1
|
-
jQuery(
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
});
|
1
|
+
jQuery(($) => {
|
2
|
+
$("[data-toggle]").on("click", function (e) {
|
3
|
+
e.preventDefault();
|
4
|
+
const targets = $(this).data("toggle").split(",");
|
5
|
+
$.each(targets, (index, target) => {
|
6
|
+
const $target = $(target);
|
7
|
+
if ($target.data("toggle-class")) {
|
8
|
+
$target.toggleClass($target.data("toggle-class"));
|
9
|
+
} else {
|
10
|
+
$target.toggle();
|
11
|
+
}
|
13
12
|
});
|
13
|
+
});
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
$("[data-autosubmit]").on("change", function (e) {
|
16
|
+
$(this).closest("form").submit();
|
17
|
+
});
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
19
|
+
function createDropdowns(target) {
|
20
|
+
$(target)
|
21
|
+
.find("[data-dropdown]")
|
22
|
+
.each(function () {
|
23
|
+
const template = this.querySelector("template");
|
24
|
+
tippy(this, {
|
25
|
+
content: template.innerHTML,
|
26
|
+
trigger: "click",
|
27
|
+
allowHTML: true,
|
28
|
+
interactive: true,
|
29
|
+
duration: 100,
|
30
|
+
placement: "bottom-end",
|
31
|
+
offset: [0, 6],
|
32
|
+
arrow: false,
|
33
|
+
appendTo: () => document.body,
|
34
|
+
onCreate: (instance) => {
|
35
|
+
instance.popper.classList.add("*:bg-white/15");
|
36
|
+
instance.popper.classList.add("*:w-48");
|
37
|
+
instance.popper.classList.add("*:rounded-md");
|
38
|
+
instance.popper.classList.add("*:shadow-lg");
|
39
|
+
instance.popper.classList.add("*:ring-1");
|
40
|
+
instance.popper.classList.add("*:ring-white/20");
|
41
|
+
},
|
41
42
|
});
|
42
|
-
|
43
|
+
});
|
44
|
+
}
|
43
45
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
function createTooltips(target) {
|
47
|
+
$(target)
|
48
|
+
.find("[data-tooltip]")
|
49
|
+
.each(function () {
|
50
|
+
tippy(this, {
|
51
|
+
content: this.dataset.tooltip,
|
52
|
+
duration: 100,
|
50
53
|
});
|
51
|
-
|
54
|
+
});
|
55
|
+
}
|
52
56
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
57
|
+
function autolinkColumns(target) {
|
58
|
+
$(target)
|
59
|
+
.find("[data-column-autolink]")
|
60
|
+
.each(function () {
|
61
|
+
const $this = $(this);
|
62
|
+
if ($this.find("a").length > 0) {
|
63
|
+
// Column already has a link, so don't add another
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
const autolinkUrl = $this.data("column-autolink");
|
67
|
+
if (!autolinkUrl) {
|
68
|
+
// No URL, so don't add a link
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
const $link = $(document.createElement("a"));
|
72
|
+
$link.attr("href", autolinkUrl);
|
73
|
+
$link.addClass("flex p-2 -m-2 text-white/80 hover:no-underline");
|
74
|
+
$(this).wrapInner($link);
|
75
|
+
});
|
76
|
+
}
|
71
77
|
|
72
|
-
|
73
|
-
|
74
|
-
|
78
|
+
createDropdowns(document);
|
79
|
+
createTooltips(document);
|
80
|
+
autolinkColumns(document);
|
75
81
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
82
|
+
// Search uses htmx to load elements,
|
83
|
+
// so we need to hook those up too.
|
84
|
+
htmx.on("htmx:afterSwap", (evt) => {
|
85
|
+
createDropdowns(evt.detail.target);
|
86
|
+
createTooltips(evt.detail.target);
|
87
|
+
autolinkColumns(evt.detail.target);
|
88
|
+
});
|
83
89
|
});
|
plain/admin/assets/admin/list.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
jQuery(
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
jQuery(($) => {
|
2
|
+
const $actionCheckbox = $("[data-action-checkbox]");
|
3
|
+
const $actionPks = $('[name="action_pks"]');
|
4
|
+
const $actionSelect = $('[name="action_name"]');
|
5
|
+
const $actionSubmit = $('[data-actions-form] [type="submit"]');
|
6
|
+
let $lastActionCheckboxChecked = null;
|
7
7
|
|
8
|
-
$actionCheckbox.on("change",
|
9
|
-
|
8
|
+
$actionCheckbox.on("change", () => {
|
9
|
+
const pks = [];
|
10
10
|
$actionCheckbox.each(function () {
|
11
11
|
if ($(this).is(":checked")) {
|
12
12
|
pks.push($(this).attr("name"));
|
@@ -17,7 +17,7 @@ jQuery(function ($) {
|
|
17
17
|
updateActionSubmit();
|
18
18
|
});
|
19
19
|
|
20
|
-
$actionSelect.on("change",
|
20
|
+
$actionSelect.on("change", () => {
|
21
21
|
updateActionSubmit();
|
22
22
|
});
|
23
23
|
|
@@ -33,12 +33,12 @@ jQuery(function ($) {
|
|
33
33
|
// Enable shift-clicking to select a range of checkboxes
|
34
34
|
$actionCheckbox.on("click", function (e) {
|
35
35
|
if (e.shiftKey) {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
36
|
+
const $this = $(this);
|
37
|
+
const thisIndex = $actionCheckbox.index($this);
|
38
|
+
const lastIndex = $actionCheckbox.index($lastActionCheckboxChecked);
|
39
|
+
const minIndex = Math.min(thisIndex, lastIndex);
|
40
|
+
const maxIndex = Math.max(thisIndex, lastIndex);
|
41
|
+
const $checkboxes = $actionCheckbox.slice(minIndex, maxIndex + 1);
|
42
42
|
$checkboxes.prop("checked", $this.is(":checked"));
|
43
43
|
} else {
|
44
44
|
$lastActionCheckboxChecked = $(this);
|
@@ -47,9 +47,10 @@ jQuery(function ($) {
|
|
47
47
|
|
48
48
|
// Merge query params with the current url and the link url
|
49
49
|
$("[data-merge-params]").each(function () {
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
const currentUrl = new URL(window.location.href);
|
51
|
+
const params = new URL($(this).attr("href"), window.location.href)
|
52
|
+
.searchParams;
|
53
|
+
params.forEach((value, key) => {
|
53
54
|
currentUrl.searchParams.set(key, value);
|
54
55
|
});
|
55
56
|
$(this).attr("href", currentUrl.toString());
|
@@ -1,8 +1,8 @@
|
|
1
1
|
// Make this available to the JS console for the user
|
2
|
-
|
2
|
+
const plainToolbar = {
|
3
3
|
hide: function () {
|
4
4
|
// Hide by inserting a style so it doesn't flash on page load
|
5
|
-
|
5
|
+
const style = document.createElement("style");
|
6
6
|
style.innerHTML = "#plaintoolbar { display: none; }";
|
7
7
|
document.getElementsByTagName("head")[0].appendChild(style);
|
8
8
|
this.stylesheet = style;
|
@@ -13,15 +13,14 @@ var plainToolbar = {
|
|
13
13
|
this.stylesheet.remove();
|
14
14
|
}
|
15
15
|
},
|
16
|
-
shouldHide:
|
17
|
-
|
16
|
+
shouldHide: () => {
|
17
|
+
const hiddenUntil = localStorage.getItem("plaintoolbar.hidden_until");
|
18
18
|
if (hiddenUntil) {
|
19
19
|
if (Date.now() < hiddenUntil) {
|
20
20
|
return true;
|
21
|
-
} else {
|
22
|
-
localStorage.removeItem("plaintoolbar.hidden_until");
|
23
|
-
return false;
|
24
21
|
}
|
22
|
+
localStorage.removeItem("plaintoolbar.hidden_until");
|
23
|
+
return false;
|
25
24
|
}
|
26
25
|
return false;
|
27
26
|
},
|
@@ -32,33 +31,33 @@ var plainToolbar = {
|
|
32
31
|
toggleExpand: function () {
|
33
32
|
this.expanded = !this.expanded;
|
34
33
|
document.querySelector("#plaintoolbar-details").classList.toggle("hidden");
|
35
|
-
localStorage.setItem(
|
34
|
+
localStorage.setItem("plaintoolbar.expanded", this.expanded ? "1" : "0");
|
36
35
|
},
|
37
36
|
expand: function () {
|
38
37
|
this.expanded = true;
|
39
38
|
document.querySelector("#plaintoolbar-details").classList.remove("hidden");
|
40
|
-
localStorage.setItem(
|
39
|
+
localStorage.setItem("plaintoolbar.expanded", "1");
|
41
40
|
},
|
42
41
|
collapse: function () {
|
43
42
|
this.expanded = false;
|
44
43
|
document.querySelector("#plaintoolbar-details").classList.add("hidden");
|
45
|
-
localStorage.setItem(
|
44
|
+
localStorage.setItem("plaintoolbar.expanded", "0");
|
46
45
|
},
|
47
46
|
showTab: function (tabName) {
|
48
47
|
this.expand();
|
49
48
|
|
50
|
-
|
51
|
-
|
49
|
+
const toolbar = document.querySelector("#plaintoolbar");
|
50
|
+
const tab = toolbar.querySelector(`div[data-toolbar-tab=${tabName}]`);
|
52
51
|
|
53
52
|
// If the tab doesn't exist for some reason, quit
|
54
53
|
if (!tab) {
|
55
|
-
console.warn(
|
54
|
+
console.warn(`Toolbar tab ${tabName} does not exist`);
|
56
55
|
return;
|
57
56
|
}
|
58
57
|
|
59
58
|
// Hide all children in the tab parent
|
60
|
-
for (
|
61
|
-
|
59
|
+
for (let i = 0; i < tab.parentNode.children.length; i++) {
|
60
|
+
const child = tab.parentNode.children[i];
|
62
61
|
if (child !== tab) {
|
63
62
|
child.style.display = "none";
|
64
63
|
}
|
@@ -66,14 +65,14 @@ var plainToolbar = {
|
|
66
65
|
|
67
66
|
tab.style.display = "block";
|
68
67
|
|
69
|
-
toolbar.querySelectorAll("button[data-toolbar-tab]")
|
68
|
+
for (const tab of toolbar.querySelectorAll("button[data-toolbar-tab]")) {
|
70
69
|
if (tab.dataset.toolbarTab === tabName) {
|
71
70
|
tab.setAttribute("data-active", true);
|
72
71
|
} else {
|
73
72
|
tab.removeAttribute("data-active");
|
74
73
|
}
|
75
|
-
}
|
76
|
-
localStorage.setItem(
|
74
|
+
}
|
75
|
+
localStorage.setItem("plaintoolbar.tab", tabName);
|
77
76
|
},
|
78
77
|
};
|
79
78
|
|
@@ -82,85 +81,85 @@ if (plainToolbar.shouldHide()) {
|
|
82
81
|
plainToolbar.hide();
|
83
82
|
}
|
84
83
|
|
85
|
-
window.addEventListener("load",
|
84
|
+
window.addEventListener("load", () => {
|
86
85
|
// Restore expanded/collapsed state
|
87
|
-
|
88
|
-
if (state ===
|
86
|
+
const state = localStorage.getItem("plaintoolbar.expanded");
|
87
|
+
if (state === "1") {
|
89
88
|
plainToolbar.expand();
|
90
89
|
// Restore last active tab
|
91
|
-
|
90
|
+
const lastTab = localStorage.getItem("plaintoolbar.tab");
|
92
91
|
if (lastTab) {
|
93
92
|
plainToolbar.showTab(lastTab);
|
94
93
|
}
|
95
|
-
} else if (state ===
|
94
|
+
} else if (state === "0") {
|
96
95
|
plainToolbar.collapse();
|
97
96
|
}
|
98
|
-
|
97
|
+
const toolbar = document.querySelector("#plaintoolbar");
|
99
98
|
|
100
|
-
toolbar.querySelectorAll("button[data-toolbar-tab]")
|
101
|
-
tab.addEventListener("click",
|
99
|
+
for (const tab of toolbar.querySelectorAll("button[data-toolbar-tab]")) {
|
100
|
+
tab.addEventListener("click", () => {
|
102
101
|
plainToolbar.showTab(tab.dataset.toolbarTab);
|
103
102
|
});
|
104
|
-
}
|
103
|
+
}
|
105
104
|
|
106
|
-
toolbar.querySelectorAll(
|
107
|
-
btn.addEventListener(
|
105
|
+
for (const btn of toolbar.querySelectorAll("[data-plaintoolbar-hide]")) {
|
106
|
+
btn.addEventListener("click", () => {
|
108
107
|
plainToolbar.hide();
|
109
108
|
});
|
110
|
-
}
|
109
|
+
}
|
111
110
|
|
112
|
-
toolbar.querySelectorAll(
|
113
|
-
btn.addEventListener(
|
111
|
+
for (const btn of toolbar.querySelectorAll("[data-plaintoolbar-hideuntil]")) {
|
112
|
+
btn.addEventListener("click", () => {
|
114
113
|
console.log("Hiding admin toolbar for 1 hour");
|
115
114
|
plainToolbar.hideUntil(Date.now() + 3600000);
|
116
115
|
});
|
117
|
-
}
|
116
|
+
}
|
118
117
|
|
119
|
-
toolbar.querySelectorAll(
|
120
|
-
btn.addEventListener(
|
118
|
+
for (const btn of toolbar.querySelectorAll("[data-plaintoolbar-expand]")) {
|
119
|
+
btn.addEventListener("click", () => {
|
121
120
|
plainToolbar.toggleExpand();
|
122
121
|
});
|
123
|
-
}
|
122
|
+
}
|
124
123
|
|
125
124
|
// Enable manual resize of the expanded toolbar via drag handle
|
126
|
-
|
125
|
+
const details = document.getElementById("plaintoolbar-details");
|
127
126
|
if (details) {
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
127
|
+
const handle = details.querySelector("[data-resizer]");
|
128
|
+
const content = handle.nextElementSibling;
|
129
|
+
let isDragging = false;
|
130
|
+
let startY = 0;
|
131
|
+
let startHeight = 0;
|
133
132
|
if (handle && content) {
|
134
133
|
// Initial cursor
|
135
|
-
handle.style.cursor =
|
134
|
+
handle.style.cursor = "grab";
|
136
135
|
// Start dragging
|
137
|
-
handle.addEventListener(
|
136
|
+
handle.addEventListener("mousedown", (e) => {
|
138
137
|
isDragging = true;
|
139
138
|
startY = e.clientY;
|
140
139
|
startHeight = content.offsetHeight;
|
141
|
-
handle.style.cursor =
|
140
|
+
handle.style.cursor = "grabbing";
|
142
141
|
// Prevent text selection while dragging
|
143
|
-
document.body.style.userSelect =
|
142
|
+
document.body.style.userSelect = "none";
|
144
143
|
e.preventDefault();
|
145
144
|
});
|
146
145
|
// Handle dragging
|
147
|
-
document.addEventListener(
|
146
|
+
document.addEventListener("mousemove", (e) => {
|
148
147
|
if (!isDragging) return;
|
149
|
-
|
148
|
+
const delta = e.clientY - startY;
|
150
149
|
// Calculate new height: dragging up increases height
|
151
|
-
|
150
|
+
let newHeight = startHeight - delta;
|
152
151
|
// Clamp between reasonable bounds
|
153
|
-
|
154
|
-
|
152
|
+
const minHeight = 50;
|
153
|
+
const maxHeight = window.innerHeight - 100;
|
155
154
|
newHeight = Math.max(minHeight, Math.min(maxHeight, newHeight));
|
156
|
-
content.style.height = newHeight
|
155
|
+
content.style.height = `${newHeight}px`;
|
157
156
|
});
|
158
157
|
// End dragging
|
159
|
-
document.addEventListener(
|
158
|
+
document.addEventListener("mouseup", () => {
|
160
159
|
if (isDragging) {
|
161
160
|
isDragging = false;
|
162
|
-
handle.style.cursor =
|
163
|
-
document.body.style.userSelect =
|
161
|
+
handle.style.cursor = "grab";
|
162
|
+
document.body.style.userSelect = "";
|
164
163
|
}
|
165
164
|
});
|
166
165
|
}
|
@@ -13,11 +13,11 @@
|
|
13
13
|
{% tailwind_css %}
|
14
14
|
{% htmx_js %}
|
15
15
|
<link href="{{ asset('admin/admin.css') }}" rel="stylesheet">
|
16
|
-
<script src="{{ asset('admin/jquery-3.6.1.slim.min.js') }}"></script>
|
17
|
-
<script src="{{ asset('admin/chart.js') }}" defer></script>
|
16
|
+
<script src="{{ asset('admin/vendor/jquery-3.6.1.slim.min.js') }}"></script>
|
17
|
+
<script src="{{ asset('admin/vendor/chart.js') }}" defer></script>
|
18
18
|
<script src="{{ asset('admin/admin.js') }}" defer></script>
|
19
|
-
<script src="{{ asset('admin/popper.min.js') }}" defer></script>
|
20
|
-
<script src="{{ asset('admin/tippy-bundle.umd.min.js') }}" defer></script>
|
19
|
+
<script src="{{ asset('admin/vendor/popper.min.js') }}" defer></script>
|
20
|
+
<script src="{{ asset('admin/vendor/tippy-bundle.umd.min.js') }}" defer></script>
|
21
21
|
{% block header_scripts %}{% endblock %}
|
22
22
|
</head>
|
23
23
|
<body class="flex min-h-screen bg-stone-950">
|
@@ -1,8 +1,10 @@
|
|
1
|
+
{% use_elements %}
|
2
|
+
|
1
3
|
<div>
|
2
4
|
<div class="flex items-center space-x-2">
|
3
|
-
<admin.Checkbox field=field />
|
4
|
-
<admin.Label field=field>{{ label }}</admin.Label>
|
5
|
-
{% if help is defined %}<admin.Help help=help />{% endif %}
|
5
|
+
<admin.Checkbox field={field} />
|
6
|
+
<admin.Label field={field}>{{ label }}</admin.Label>
|
7
|
+
{% if help is defined %}<admin.Help help={help} />{% endif %}
|
6
8
|
</div>
|
7
|
-
<admin.FieldErrors field=field />
|
9
|
+
<admin.FieldErrors field={field} />
|
8
10
|
</div>
|
@@ -1,6 +1,8 @@
|
|
1
|
+
{% use_elements %}
|
2
|
+
|
1
3
|
<div class="space-y-1">
|
2
|
-
<admin.Label field=field>{{ label }}</admin.Label>
|
3
|
-
<admin.Input field=field />
|
4
|
-
{% if help is defined %}<admin.Help help=help />{% endif %}
|
5
|
-
<admin.FieldErrors field=field />
|
4
|
+
<admin.Label field={field}>{{ label }}</admin.Label>
|
5
|
+
<admin.Input field={field} />
|
6
|
+
{% if help is defined %}<admin.Help help={help} />{% endif %}
|
7
|
+
<admin.FieldErrors field={field} />
|
6
8
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<label for="{{ field.html_id }}" class="flex items-baseline justify-between w-full">
|
2
|
-
<div class="text-sm font-medium">{{
|
2
|
+
<div class="text-sm font-medium">{{ children }}</div>
|
3
3
|
{% if not field.field.required %}<div class="text-white/60 text-xs">Optional</div>{% endif %}
|
4
4
|
</label>
|
@@ -1,6 +1,8 @@
|
|
1
|
+
{% use_elements %}
|
2
|
+
|
1
3
|
<div class="space-y-1">
|
2
|
-
<admin.Label field=field>{{ label }}</admin.Label>
|
3
|
-
<admin.Select field=field />
|
4
|
-
{% if help is defined %}<admin.Help help=help />{% endif %}
|
5
|
-
<admin.FieldErrors field=field />
|
4
|
+
<admin.Label field={field}>{{ label }}</admin.Label>
|
5
|
+
<admin.Select field={field} />
|
6
|
+
{% if help is defined %}<admin.Help help={help} />{% endif %}
|
7
|
+
<admin.FieldErrors field={field} />
|
6
8
|
</div>
|
@@ -7,14 +7,14 @@ plain/admin/middleware.py,sha256=k3yP1o3CzvLiZZSoxqq-DvAZlp4sICRauaT-kD3FJKM,398
|
|
7
7
|
plain/admin/templates.py,sha256=0xgMQmJEbh5U45ZlN2f15Xs42Y2A_lSS-_wdMp1BeD4,854
|
8
8
|
plain/admin/toolbar.py,sha256=nYZOtsN4li_qFpdClk6mOwwv8ApCleCMcaGXFzAEW4Y,2782
|
9
9
|
plain/admin/urls.py,sha256=sriMi2RCkcrkjCX3CIIP1-Qzs_zDm2pxXeOw28vc7Y4,1301
|
10
|
-
plain/admin/assets/admin/admin.css,sha256=
|
11
|
-
plain/admin/assets/admin/admin.js,sha256=
|
12
|
-
plain/admin/assets/admin/
|
13
|
-
plain/admin/assets/admin/
|
14
|
-
plain/admin/assets/admin/
|
15
|
-
plain/admin/assets/admin/popper.min.js,sha256=SgCxkjQZdrt2puqn62YUu9hknpCBGBEAy9uhQ9PPZaI,20083
|
16
|
-
plain/admin/assets/admin/tippy-bundle.umd.min.js,sha256=oVWBpeGTKMG_iBWGkQF02JnGIMFPYuFqTjUWeJY3pZ0,25668
|
17
|
-
plain/admin/assets/toolbar/toolbar.js,sha256=
|
10
|
+
plain/admin/assets/admin/admin.css,sha256=x_8rGnClG6YNXBbXhhcE_6ETrGHO550Dsu8tFoHhsSI,2593
|
11
|
+
plain/admin/assets/admin/admin.js,sha256=g_yruWKl63v1zprP5AWJHQN9BF-WRatK67aXx-LdWjQ,2569
|
12
|
+
plain/admin/assets/admin/list.js,sha256=SDmDpSqsbbgLeAaV6V6JKbI-nG7WdjCD3MqFeO4LS_0,1835
|
13
|
+
plain/admin/assets/admin/vendor/chart.js,sha256=GZiCYXjL6SmyuSCGE0Df80QvOUkw6H2YD-zsVID05lo,205089
|
14
|
+
plain/admin/assets/admin/vendor/jquery-3.6.1.slim.min.js,sha256=W2eb4M1jdKpuZ_-_KnDgqI9X9SwGLrXtO0dknpNPJyE,72534
|
15
|
+
plain/admin/assets/admin/vendor/popper.min.js,sha256=SgCxkjQZdrt2puqn62YUu9hknpCBGBEAy9uhQ9PPZaI,20083
|
16
|
+
plain/admin/assets/admin/vendor/tippy-bundle.umd.min.js,sha256=oVWBpeGTKMG_iBWGkQF02JnGIMFPYuFqTjUWeJY3pZ0,25668
|
17
|
+
plain/admin/assets/toolbar/toolbar.js,sha256=MTO7ya8kLXQLCCIOvrud2KT79nDJ3vNeW5jH5Bz6Gh4,5349
|
18
18
|
plain/admin/cards/__init__.py,sha256=8NfWrguyJRriJFUc3_QeGaDILhgeU3d1aXktzIuAR1E,172
|
19
19
|
plain/admin/cards/base.py,sha256=ESYY0tX3OossyZi9ubCrLxwxUZ0Z3snZUCVmLvTIg-U,2247
|
20
20
|
plain/admin/cards/charts.py,sha256=uUNO_uN_GVdkwYNSTx1bt1j2L-89rEyIg0vDaxP-9NE,4929
|
@@ -33,7 +33,7 @@ plain/admin/querystats/core.py,sha256=6_SJIxS0T_KIFcS-5mMajp074vnkEKGBv9TamVeI0V
|
|
33
33
|
plain/admin/querystats/middleware.py,sha256=isMjV5X-8SP-8IQEaJMfXWarZQaQBQsI5uXV0JHKXnY,3347
|
34
34
|
plain/admin/querystats/urls.py,sha256=H8wMpqKBnXqA8ZsdwdxTKQguNYJ0JsMRqqMunccBm2I,198
|
35
35
|
plain/admin/querystats/views.py,sha256=cXmHZtEgRwXNN5d9HsKBe5G_VnDgSNwpwoRaEvuJ7vo,2375
|
36
|
-
plain/admin/templates/admin/base.html,sha256=
|
36
|
+
plain/admin/templates/admin/base.html,sha256=urUvdcgcZZWjevZSvkagXdcrUe5LYUeaWme7S2gckMU,8509
|
37
37
|
plain/admin/templates/admin/delete.html,sha256=lNuU2G-BR6TH6NUmh7VcvjnEuFeI84rwwk_oO1jkUq0,431
|
38
38
|
plain/admin/templates/admin/detail.html,sha256=AizpXs6HguFzwbk7JDbH8poJB5dM2CaVVaQ4FThAHaw,730
|
39
39
|
plain/admin/templates/admin/index.html,sha256=b65tcZhv9QfvmjePySU7MmzUlpMECIXP8dBH-a3Eyxw,69
|
@@ -55,17 +55,17 @@ plain/admin/templates/admin/values/list.html,sha256=vqUOuJglFDbOBuKCA11VoIZHWVt_
|
|
55
55
|
plain/admin/templates/admin/values/model.html,sha256=_aX_t2VQYt_bN_jQBky5IDi49cbq7dzBLuisb3BY_is,410
|
56
56
|
plain/admin/templates/admin/values/queryset.html,sha256=YU-mDxHzinWWLUBE-oX3dOMOMyHymzrdeZyxXGMF5Ss,138
|
57
57
|
plain/admin/templates/elements/admin/Checkbox.html,sha256=2hUSWCbazaJKyZdsk2shF0qN6kSeV20HVLdRitC_KfQ,213
|
58
|
-
plain/admin/templates/elements/admin/CheckboxField.html,sha256=
|
58
|
+
plain/admin/templates/elements/admin/CheckboxField.html,sha256=qrudQ_jaM1sjUt25GDiMR4M7LsmNBeOWfdRH6g7ua2A,302
|
59
59
|
plain/admin/templates/elements/admin/FieldErrors.html,sha256=YO150DwGG8tf8Q4d1Cf59gpchXzF-n8FSse2GqOX3cA,108
|
60
60
|
plain/admin/templates/elements/admin/Help.html,sha256=r9QZC22BK6hYkNfb16wPdDv9z9eCrHIOOar-8bG92oc,53
|
61
61
|
plain/admin/templates/elements/admin/Input.html,sha256=7rziKkGDgg-fQ4Yfb_hjR9pOt0DFs8UeXicN6MCoM4s,371
|
62
|
-
plain/admin/templates/elements/admin/InputField.html,sha256=
|
63
|
-
plain/admin/templates/elements/admin/Label.html,sha256=
|
62
|
+
plain/admin/templates/elements/admin/InputField.html,sha256=JLPBgVKXpdL8sfMTdTlKNJU-Pvq3426Am7h6J1w4ZFA,248
|
63
|
+
plain/admin/templates/elements/admin/Label.html,sha256=LFGwcGqcfmNDL0Sl6ehQHOvk2NTpH_aTG2vGXdDhNIo,250
|
64
64
|
plain/admin/templates/elements/admin/Select.html,sha256=CUJD4cHno_bc0g_SQN0IV0a5sZL7Gx4fFB44xBse-Ic,458
|
65
|
-
plain/admin/templates/elements/admin/SelectField.html,sha256=
|
66
|
-
plain/admin/templates/elements/admin/Submit.html,sha256=
|
65
|
+
plain/admin/templates/elements/admin/SelectField.html,sha256=mEA7m9DPB5Xd2GF5fEtHIk71XN6QXd23cBdXvZb14aM,249
|
66
|
+
plain/admin/templates/elements/admin/Submit.html,sha256=9HGqeDnAzhDaL3PM7WxS4Xf8Xu6G9sCx9kh2-4W5GF8,150
|
67
67
|
plain/admin/templates/elements/admin/Textarea.html,sha256=nCSaGa9t5A5Oj6ZPWW-jSJiGqI1NLPahhXJblq62QME,363
|
68
|
-
plain/admin/templates/elements/admin/TextareaField.html,sha256=
|
68
|
+
plain/admin/templates/elements/admin/TextareaField.html,sha256=ubgfio0UoWRUnpzjEep61tdoSQI1osGdJuEq0rFBVBA,243
|
69
69
|
plain/admin/templates/querystats/querystats.html,sha256=xJ6fU22aWFQq3wATmRo7vFakmq-x7P6Z3OdZ2aVYmSs,7514
|
70
70
|
plain/admin/templates/querystats/toolbar.html,sha256=mvERfzU-CdzIBS7aQNosazSeCe9iyDOsswCGFxssdXc,4319
|
71
71
|
plain/admin/templates/toolbar/exception.html,sha256=4WcrcBTCuyO_Jket8aaMFEL17o3FN3pF2QLrP7Pr60o,937
|
@@ -79,7 +79,7 @@ plain/admin/views/objects.py,sha256=eKL8A2B1ZMgTrCbTXnh6vCeju_HObxwetn_xc1vYlfY,
|
|
79
79
|
plain/admin/views/registry.py,sha256=Lxib4YSQCMHb_zACnLKymJakV8jCZPWYll7J8-aV9Xw,3712
|
80
80
|
plain/admin/views/types.py,sha256=ONMMdUoapgMoUVYgSIe-4YCdfvaVMQ4jgPWYiMo0pDk,178
|
81
81
|
plain/admin/views/viewsets.py,sha256=dqMlQ6kLn9iqd9BwBWAZT1S271wH1FdfM5HXbOgBMEw,1655
|
82
|
-
plain_admin-0.
|
83
|
-
plain_admin-0.
|
84
|
-
plain_admin-0.
|
85
|
-
plain_admin-0.
|
82
|
+
plain_admin-0.31.0.dist-info/METADATA,sha256=RePsrs1QzTf3coZSCpPHVfmOMAaISqxgaAafAtL30Rc,4237
|
83
|
+
plain_admin-0.31.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
84
|
+
plain_admin-0.31.0.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
|
85
|
+
plain_admin-0.31.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|