diff --git a/.sqlx/query-6f540be5517aaffe1774bebe9a2c0eba835e11cd8e1b07ea44046ae795008704.json b/.sqlx/query-6f540be5517aaffe1774bebe9a2c0eba835e11cd8e1b07ea44046ae795008704.json new file mode 100644 index 0000000..6a0f189 --- /dev/null +++ b/.sqlx/query-6f540be5517aaffe1774bebe9a2c0eba835e11cd8e1b07ea44046ae795008704.json @@ -0,0 +1,44 @@ +{ + "db_name": "SQLite", + "query": "SELECT * FROM users WHERE id = ?", + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Integer" + }, + { + "name": "first_name", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "last_name", + "ordinal": 2, + "type_info": "Text" + }, + { + "name": "email", + "ordinal": 3, + "type_info": "Text" + }, + { + "name": "created_at", + "ordinal": 4, + "type_info": "Datetime" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + true, + true, + false, + false + ] + }, + "hash": "6f540be5517aaffe1774bebe9a2c0eba835e11cd8e1b07ea44046ae795008704" +} diff --git a/.sqlx/query-73ffdf5be39aa5c4c160c2f77d6634a6970eeb4e1d3395f045ded747f0ce9d2a.json b/.sqlx/query-73ffdf5be39aa5c4c160c2f77d6634a6970eeb4e1d3395f045ded747f0ce9d2a.json new file mode 100644 index 0000000..3427c65 --- /dev/null +++ b/.sqlx/query-73ffdf5be39aa5c4c160c2f77d6634a6970eeb4e1d3395f045ded747f0ce9d2a.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM users WHERE id = ?", + "describe": { + "columns": [], + "parameters": { + "Right": 1 + }, + "nullable": [] + }, + "hash": "73ffdf5be39aa5c4c160c2f77d6634a6970eeb4e1d3395f045ded747f0ce9d2a" +} diff --git a/.sqlx/query-d23b45d169c59a7dd2c4756b49e6322b98a16fa81e362e138d7ce99c4a020b4f.json b/.sqlx/query-d23b45d169c59a7dd2c4756b49e6322b98a16fa81e362e138d7ce99c4a020b4f.json new file mode 100644 index 0000000..e8bbded --- /dev/null +++ b/.sqlx/query-d23b45d169c59a7dd2c4756b49e6322b98a16fa81e362e138d7ce99c4a020b4f.json @@ -0,0 +1,44 @@ +{ + "db_name": "SQLite", + "query": "SELECT u.*\n FROM users u\n LIMIT ?\n OFFSET ?", + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Integer" + }, + { + "name": "first_name", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "last_name", + "ordinal": 2, + "type_info": "Text" + }, + { + "name": "email", + "ordinal": 3, + "type_info": "Text" + }, + { + "name": "created_at", + "ordinal": 4, + "type_info": "Datetime" + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false, + true, + true, + false, + false + ] + }, + "hash": "d23b45d169c59a7dd2c4756b49e6322b98a16fa81e362e138d7ce99c4a020b4f" +} diff --git a/.sqlx/query-e3f19de7c663b21e992056bdce331c5aac9eded9d0381e42b39d06e79547c5a6.json b/.sqlx/query-e3f19de7c663b21e992056bdce331c5aac9eded9d0381e42b39d06e79547c5a6.json new file mode 100644 index 0000000..c0cf8d1 --- /dev/null +++ b/.sqlx/query-e3f19de7c663b21e992056bdce331c5aac9eded9d0381e42b39d06e79547c5a6.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM user_roles WHERE user_id=? AND role=?", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "e3f19de7c663b21e992056bdce331c5aac9eded9d0381e42b39d06e79547c5a6" +} diff --git a/config/seed_data.toml b/config/seed_data.toml index 066ff87..1a6c998 100644 --- a/config/seed_data.toml +++ b/config/seed_data.toml @@ -1,7 +1,140 @@ [[users]] -email = "test@test.com" -first_name = "Test" +email = "test1@test.com" +first_name = "Test1" last_name = "Testington" +[[users]] +email = "test2@test.com" +first_name = "Test2" +last_name = "Testington" +[[users]] +email = "test3@test.com" +first_name = "Test3" +last_name = "Testington" +[[users]] +email = "test4@test.com" +first_name = "Test4" +last_name = "Testington" +[[users]] +email = "test5@test.com" +first_name = "Test5" +last_name = "Testington" +[[users]] +email = "test6@test.com" +first_name = "Test6" +last_name = "Testington" +[[users]] +email = "test7@test.com" +first_name = "Test7" +last_name = "Testington" +[[users]] +email = "test8@test.com" +first_name = "Test8" +last_name = "Testington" +[[users]] +email = "test9@test.com" +first_name = "Test9" +last_name = "Testington" +[[users]] +email = "test10@test.com" +first_name = "Test10" +last_name = "Testington" +[[users]] +email = "test11@test.com" +first_name = "Test11" +last_name = "Testington" +[[users]] +email = "test12@test.com" +first_name = "Test12" +last_name = "Testington" +[[users]] +email = "test13@test.com" +first_name = "Test13" +last_name = "Testington" +[[users]] +email = "test14@test.com" +first_name = "Test14" +last_name = "Testington" +[[users]] +email = "test15@test.com" +first_name = "Test15" +last_name = "Testington" +[[users]] +email = "test16@test.com" +first_name = "Test16" +last_name = "Testington" +[[users]] +email = "test17@test.com" +first_name = "Test17" +last_name = "Testington" +[[users]] +email = "test18@test.com" +first_name = "Test18" +last_name = "Testington" +[[users]] +email = "test19@test.com" +first_name = "Test19" +last_name = "Testington" +[[users]] +email = "test20@test.com" +first_name = "Test20" +last_name = "Testington" +[[users]] +email = "test21@test.com" +first_name = "Test21" +last_name = "Testington" +[[users]] +email = "test22@test.com" +first_name = "Test22" +last_name = "Testington" +[[users]] +email = "test23@test.com" +first_name = "Test23" +last_name = "Testington" +[[users]] +email = "test24@test.com" +first_name = "Test24" +last_name = "Testington" +[[users]] +email = "test25@test.com" +first_name = "Test25" +last_name = "Testington" +[[users]] +email = "test26@test.com" +first_name = "Test26" +last_name = "Testington" +[[users]] +email = "test27@test.com" +first_name = "Test27" +last_name = "Testington" +[[users]] +email = "test28@test.com" +first_name = "Test28" +last_name = "Testington" +[[users]] +email = "test29@test.com" +first_name = "Test29" +last_name = "Testington" +[[users]] +email = "test30@test.com" +first_name = "Test30" +last_name = "Testington" +[[users]] +email = "test31@test.com" +first_name = "Test31" +last_name = "Testington" +[[users]] +email = "test32@test.com" +first_name = "Test32" +last_name = "Testington" +[[users]] +email = "test33@test.com" +first_name = "Test33" +last_name = "Testington" +[[users]] +email = "test34@test.com" +first_name = "Test34" +last_name = "Testington" + [[user_roles]] user_id = 1 diff --git a/frontend/styles/admin/dashboard.css b/frontend/styles/admin/dashboard.css new file mode 100644 index 0000000..4dbe570 --- /dev/null +++ b/frontend/styles/admin/dashboard.css @@ -0,0 +1,47 @@ +#admin\/ { + @apply flex h-[calc(100vh-59px)] max-h-[calc(100vh-59px)] min-h-[calc(100vh-59px)] flex-row; +} +#sidebar { + @apply relative z-30 flex min-w-64 flex-col border-r-1 border-neutral-800 p-2; + > a { + @apply m-1 flex cursor-pointer items-center rounded-sm border border-transparent p-2 text-sm text-neutral-600 no-underline hover:bg-neutral-800 hover:text-white; + &.active { + @apply border border-neutral-700 bg-neutral-900 text-white hover:bg-neutral-800; + svg { + @apply text-white; + } + } + span { + @apply ms-2; + } + svg { + @apply fill-current text-neutral-600; + } + &:hover { + svg { + @apply text-white; + } + } + } +} +#admin\/dashboard { + @apply flex flex-1 flex-col overflow-auto p-3; +} +.widget-container { + @apply rounded-sm border border-neutral-800 bg-neutral-950 p-4; + a > .widget-nav { + @apply ml-auto h-7 w-7 cursor-pointer rounded-sm p-1 hover:bg-neutral-800; + } + .widget-content-stat { + @apply flex flex-col items-center; + h1 { + @apply text-5xl; + } + h2 { + @apply text-xl text-neutral-400; + } + } +} + +@import "./dashboard/overview.css"; +@import "./dashboard/users.css"; diff --git a/frontend/styles/admin/dashboard/overview.css b/frontend/styles/admin/dashboard/overview.css new file mode 100644 index 0000000..bcc8757 --- /dev/null +++ b/frontend/styles/admin/dashboard/overview.css @@ -0,0 +1,45 @@ +#admin\/dashboard\/overview { + @apply grid h-full w-full grid-cols-3 gap-2; + grid-template-rows: 0.25fr minmax(0, 1fr); +} + +#widget-attendees { + @apply col-start-1 col-end-4 row-start-2 row-end-3 flex h-full w-full flex-col; + .widget-content { + @apply flex-1 overflow-auto; + #chart1 { + .ct-series-a .ct-line { + @apply stroke-green-600 stroke-2; + } + .ct-series-a .ct-point { + @apply stroke-green-600; + } + .ct-series-a .ct-area { + @apply fill-green-600; + } + .ct-label { + @apply fill-white text-white; + } + + .ct-horizontal:first-child { + @apply stroke-neutral-500; + } + + .ct-vertical:nth-child(6) { + @apply stroke-neutral-500; + } + + .ct-axis-title, + .ct-axis-title text { + @apply fill-white; + } + + .chartist-tooltip { + @apply absolute z-100 hidden min-w-5 cursor-none rounded-sm border-1 border-neutral-500 bg-neutral-800 px-2.5 py-2 text-center transition-opacity delay-200 ease-linear; + } + .chartist-tooltip.show { + @apply block; + } + } + } +} diff --git a/frontend/styles/admin/dashboard/users.css b/frontend/styles/admin/dashboard/users.css new file mode 100644 index 0000000..f39cf2b --- /dev/null +++ b/frontend/styles/admin/dashboard/users.css @@ -0,0 +1,38 @@ +#admin\/dashboard\/users { + @apply grid h-full w-full grid-cols-3 gap-2; + grid-template-rows: 0.1fr minmax(0, 1fr); +} + +#widget-table { + @apply col-start-1 col-end-4 row-start-2 row-end-3 flex w-full flex-col; + .widget-item-table { + @apply h-full w-full flex-1 overflow-auto text-left; + } + table { + @apply w-full border-separate border-spacing-0 text-left; + thead { + th { + @apply sticky top-0 border-b border-neutral-700; + } + } + td, + th { + @apply py-1.5 text-sm overflow-ellipsis; + } + th { + @apply sticky bg-black; + } + td { + @apply border-b border-neutral-800; + } + input { + @apply h-3.5 w-3.5 rounded-sm border-gray-300 bg-gray-100 text-blue-600 focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:ring-offset-gray-800 dark:focus:ring-blue-600; + } + } + .table-footer { + @apply py-1.5; + a { + @apply inline-flex w-12 justify-center rounded-sm border-1 border-neutral-700 py-1.5 first-of-type:mr-3; + } + } +} diff --git a/frontend/styles/extentions/form.css b/frontend/styles/extentions/form.css index 6198f9e..59266b7 100644 --- a/frontend/styles/extentions/form.css +++ b/frontend/styles/extentions/form.css @@ -54,6 +54,9 @@ &.\:red { @apply border-lsd-red/30 bg-lsd-red/20 hover:bg-lsd-red/30; } + &.\:disabled { + @apply border-lsd-white/10 bg-lsd-white/5 hover:bg-lsd-white/5 cursor-default; + } } .ext\/button:disabled { diff --git a/frontend/styles/main.css b/frontend/styles/main.css index 602e982..5915c25 100644 --- a/frontend/styles/main.css +++ b/frontend/styles/main.css @@ -69,3 +69,6 @@ body > header { @import "./posts/list.css"; @import "./posts/send.css"; @import "./posts/view.css"; + +/* Admin */ +@import "./admin/dashboard.css"; diff --git a/frontend/templates/admin/dashboard.html b/frontend/templates/admin/dashboard.html new file mode 100644 index 0000000..86db7c0 --- /dev/null +++ b/frontend/templates/admin/dashboard.html @@ -0,0 +1,138 @@ +{% extends "layout.html" %} +{% block title %}light and sound - admin{% endblock title %} +{% block styles %} + {% call super() %} +{% endblock styles %} +{% block content %} +