From ca38ecbf57088b9c51b43cac33b17de3432738a2 Mon Sep 17 00:00:00 2001 From: Corban-Lee Jones Date: Mon, 3 Feb 2025 02:13:22 +0000 Subject: [PATCH] pagination & page size --- src/client/public/css/tailwind.css | 46 ++++++++++- src/client/public/js/guild/subscriptions.js | 23 +++--- src/client/views/guild/subscriptions.ejs | 85 ++++++++++++--------- 3 files changed, 102 insertions(+), 52 deletions(-) diff --git a/src/client/public/css/tailwind.css b/src/client/public/css/tailwind.css index 66d4cb1..50cda98 100644 --- a/src/client/public/css/tailwind.css +++ b/src/client/public/css/tailwind.css @@ -881,6 +881,10 @@ select { z-index: 20; } +.z-50 { + z-index: 50; +} + .z-\[48\] { z-index: 48; } @@ -1184,6 +1188,10 @@ select { width: 2.5rem; } +.w-20 { + width: 5rem; +} + .w-28 { width: 7rem; } @@ -1224,6 +1232,10 @@ select { min-width: 15rem; } +.min-w-\[40px\] { + min-width: 40px; +} + .min-w-full { min-width: 100%; } @@ -1387,6 +1399,12 @@ select { row-gap: 0.5rem; } +.space-x-1 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.25rem * var(--tw-space-x-reverse)); + margin-left: calc(0.25rem * calc(1 - var(--tw-space-x-reverse))); +} + .space-y-0\.5 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(0.125rem * calc(1 - var(--tw-space-y-reverse))); @@ -1639,10 +1657,6 @@ select { padding: 1rem; } -.p-6 { - padding: 1.5rem; -} - .p-px { padding: 1px; } @@ -2359,6 +2373,11 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te position: absolute; } +.before\:inset-0::before { + content: var(--tw-content); + inset: 0px; +} + .before\:-top-4::before { content: var(--tw-content); top: -1rem; @@ -2369,6 +2388,11 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te inset-inline-start: 0px; } +.before\:z-\[1\]::before { + content: var(--tw-content); + z-index: 1; +} + .before\:inline-block::before { content: var(--tw-content); display: inline-block; @@ -2865,6 +2889,10 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te display: inline; } + .sm\:inline-flex { + display: inline-flex; + } + .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } @@ -3364,3 +3392,13 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te .\[\&\:\:-webkit-scrollbar\]\:w-2::-webkit-scrollbar { width: 0.5rem; } + +.\[\&\>\.active\]\:bg-gray-100>.active { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)); +} + +.dark\:\[\&\>\.active\]\:bg-neutral-700>.active:where(.dark, .dark *) { + --tw-bg-opacity: 1; + background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1)); +} diff --git a/src/client/public/js/guild/subscriptions.js b/src/client/public/js/guild/subscriptions.js index 8f2526a..8f4b85d 100644 --- a/src/client/public/js/guild/subscriptions.js +++ b/src/client/public/js/guild/subscriptions.js @@ -43,6 +43,9 @@ const defineTable = () => { serverSide: true, processing: true, selecting: true, + pagingOptions: { + pageBtnClasses: "min-w-[40px] flex justify-center items-center text-gray-800 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 py-2.5 text-sm rounded-full disabled:opacity-50 disabled:pointer-events-none dark:text-white dark:focus:bg-neutral-700 dark:hover:bg-neutral-700" + }, rowSelectingOptions: { selectAllSelector: "#selectAllBox" }, @@ -83,11 +86,11 @@ const defineTable = () => { render: (data, type, row) => { return ` -
- +
+
`; @@ -102,7 +105,7 @@ const defineTable = () => { render: (data, type, row) => { return ` - + ${row.name} @@ -118,7 +121,7 @@ const defineTable = () => { render: (data, type, row) => { return ` - + ${row.url} @@ -170,7 +173,7 @@ const defineTable = () => { render: data => { return ` -
+
${formatTimestamp(data)} @@ -189,7 +192,7 @@ const defineTable = () => { render: (data, type, row) => { if (!row.active) { return ` -
+
@@ -200,7 +203,7 @@ const defineTable = () => { `; } return ` -
+
diff --git a/src/client/views/guild/subscriptions.ejs b/src/client/views/guild/subscriptions.ejs index b16cf85..e2946ca 100644 --- a/src/client/views/guild/subscriptions.ejs +++ b/src/client/views/guild/subscriptions.ejs @@ -180,37 +180,46 @@
-
- -
- -
-
+ +
+ + -
-
- - - -
+
+ +
+
@@ -229,7 +238,7 @@

- Modal title + Add Subscription