From 61c2ba7801d3b0776cb2126b0980dedee172bfb0 Mon Sep 17 00:00:00 2001 From: AmonDeShir Date: Thu, 29 Aug 2024 23:25:25 +0200 Subject: [PATCH 01/60] create button components --- resources/js/components/Common/FormButton.vue | 33 +++++++++++++++++++ resources/js/components/Common/LinkButton.vue | 19 +++++++++++ 2 files changed, 52 insertions(+) create mode 100644 resources/js/components/Common/FormButton.vue create mode 100644 resources/js/components/Common/LinkButton.vue diff --git a/resources/js/components/Common/FormButton.vue b/resources/js/components/Common/FormButton.vue new file mode 100644 index 00000000..71619adf --- /dev/null +++ b/resources/js/components/Common/FormButton.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/resources/js/components/Common/LinkButton.vue b/resources/js/components/Common/LinkButton.vue new file mode 100644 index 00000000..1b737fb8 --- /dev/null +++ b/resources/js/components/Common/LinkButton.vue @@ -0,0 +1,19 @@ + + + + + From 29a2aa329566cf9d07a688dbcff797412947ce16 Mon Sep 17 00:00:00 2001 From: AmonDeShir Date: Thu, 29 Aug 2024 23:25:46 +0200 Subject: [PATCH 02/60] update favicon --- public/favicon.ico | 0 public/favicon.png | Bin 0 -> 5348 bytes public/favicon.svg | 4 ++++ resources/views/app.blade.php | 1 + 4 files changed, 5 insertions(+) delete mode 100644 public/favicon.ico create mode 100644 public/favicon.png create mode 100644 public/favicon.svg diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index e69de29b..00000000 diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..c92ba5cc4db39c7b221a997684c2bf9c4f3cb17b GIT binary patch literal 5348 zcmaJ_cU;on_kL@ZqqNlArbU`*&K#MUXksdE#njZuy~-JmRIn^ZDt_F1mMc@!)ZCbR zkIKFG-iZT&ANczH{e>4VxR-O!dCqg5bMJ*vU2Ro*I!-zO0O-}#Ao>76LHbAm&|D(D znYriNk_I0fl$CYWm6dP0y1Upqys`m+yHWm8kJXwLxm)1|t@=U?w%7DJbkjDoLFfuP zmHcatAD`X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G6=Vg~|Aw#RdC+>0UDp`g-09xgwd*XF!9=uJ+ zD;j8J;HN-fAjE|Iv@+!HgkN&_@gg_RCM~7ngLu3S!KV8v>EM;~v+P)t5jz{(zd(`s zId?gE47AVBC5Eg#Qv~e0zaI|5U!A-I29osGui(%k-J@i)g0&)z=dJ%e_2s-gb}f3c z7sf#qP+UT=oR~t9m#y*wSoza15wIT`!&v1&z7C4ux+jFdY>q?2SDj^J=mHrOt>R~r z?V4Nr<9TU-NMS%|ituBJnzHe7t`59BlIdYtwp$bVE0?>}cssR=yggmykr)f6?Eirq zasM4=WYlXn+#Mnb@fz?#Px84(8B-|CeyKl?1i~BInts+zUZmsTRC~`pBvt>NvdO$; zpB*{v;4k~l9*{2HIHRlv_vqT5d*Ip1AA8}{rr+^QHkAMZg6$pn-# zgn?tF5NwLP3Dk|@O&4Af$&}4bZJ^Bh307pMUK7OlJ`T`tsW$j|kUTiPo%Ewd1U!06 zk(OIJ7mGUbIw@VEe)J-CHl(fDh+BBc^3@gTes%?ig<|k3P}d{W$7?Vvw6MM%G2*rt z=nG6U1eBH&Nvvs&;L-CWSl`e0%OLKGV77B4*h{}G_hcDqx79I?fscPZ4ygZNu{k!4 zxgWk{>hoP-6~IOV*E%0p@4%D`EUHvudY)Ih + + + diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php index 9911d029..18c39277 100644 --- a/resources/views/app.blade.php +++ b/resources/views/app.blade.php @@ -3,6 +3,7 @@ + @vite('resources/js/app.ts') @inertiaHead From 9d1aa3d42b27884b9db509f9f79a13d3478d99c8 Mon Sep 17 00:00:00 2001 From: AmonDeShir Date: Thu, 29 Aug 2024 23:29:06 +0200 Subject: [PATCH 03/60] clean up route files structure --- .../Controllers/AdminDashboardController.php | 16 --------- .../AuthenticateSessionController.php | 4 +-- app/Http/Controllers/ContestController.php | 2 +- .../Controllers/ProfileUserController.php | 2 +- app/Http/Controllers/SchoolsController.php | 2 +- resources/js/Pages/Admin/Quizzes.vue | 11 ++++++ resources/js/Pages/Admin/SchoolsPanel.vue | 11 ++++++ resources/js/Pages/Auth/Admin/Dashboard.vue | 9 ----- resources/js/Pages/Profile.vue | 34 ------------------- resources/js/Pages/SchoolsPanel.vue | 0 resources/js/Pages/{ => User}/Dashboard.vue | 2 -- resources/js/Pages/User/Profile.vue | 24 +++++++++++++ resources/js/Types/Page.d.ts | 4 +++ routes/web.php | 5 +-- tests/Feature/SchoolTest.php | 2 +- 15 files changed, 57 insertions(+), 71 deletions(-) delete mode 100644 app/Http/Controllers/AdminDashboardController.php create mode 100644 resources/js/Pages/Admin/SchoolsPanel.vue delete mode 100644 resources/js/Pages/Auth/Admin/Dashboard.vue delete mode 100644 resources/js/Pages/Profile.vue delete mode 100644 resources/js/Pages/SchoolsPanel.vue rename resources/js/Pages/{ => User}/Dashboard.vue (99%) create mode 100644 resources/js/Pages/User/Profile.vue create mode 100644 resources/js/Types/Page.d.ts diff --git a/app/Http/Controllers/AdminDashboardController.php b/app/Http/Controllers/AdminDashboardController.php deleted file mode 100644 index 6ebdf585..00000000 --- a/app/Http/Controllers/AdminDashboardController.php +++ /dev/null @@ -1,16 +0,0 @@ -session()->regenerate(); return $request->user()->hasRole(["admin", "super_admin"]) - ? Redirect::route("admin.dashboard")->with("success", "Witaj na Panelu Administratora") - : Redirect::route("dashboard")->with("success"); + ? Redirect::route("admin.quizzes.index") + : Redirect::route("dashboard"); } throw ValidationException::withMessages([ diff --git a/app/Http/Controllers/ContestController.php b/app/Http/Controllers/ContestController.php index df030400..d757266a 100644 --- a/app/Http/Controllers/ContestController.php +++ b/app/Http/Controllers/ContestController.php @@ -20,6 +20,6 @@ public function index(): Response public function create(): Response { - return Inertia::render("Dashboard"); + return Inertia::render("User/Dashboard"); } } diff --git a/app/Http/Controllers/ProfileUserController.php b/app/Http/Controllers/ProfileUserController.php index 97806e27..671342aa 100644 --- a/app/Http/Controllers/ProfileUserController.php +++ b/app/Http/Controllers/ProfileUserController.php @@ -19,7 +19,7 @@ public function create(Request $request): Response $user = $request->user()->load("school"); return Inertia::render( - "Profile", + "User/Profile", [ "user" => UserResource::make($user), "status" => session("status"), diff --git a/app/Http/Controllers/SchoolsController.php b/app/Http/Controllers/SchoolsController.php index bfc69547..9f7ae7b1 100644 --- a/app/Http/Controllers/SchoolsController.php +++ b/app/Http/Controllers/SchoolsController.php @@ -26,7 +26,7 @@ class SchoolsController extends Controller { public function index(): Response { - return Inertia::render("SchoolsPanel", ["schools" => SchoolResource::collection(School::all())]); + return Inertia::render("Admin/SchoolsPanel", ["schools" => SchoolResource::collection(School::all())]); } public function store(SchoolRequest $request): RedirectResponse diff --git a/resources/js/Pages/Admin/Quizzes.vue b/resources/js/Pages/Admin/Quizzes.vue index e69de29b..31d2c341 100644 --- a/resources/js/Pages/Admin/Quizzes.vue +++ b/resources/js/Pages/Admin/Quizzes.vue @@ -0,0 +1,11 @@ + + + diff --git a/resources/js/Pages/Admin/SchoolsPanel.vue b/resources/js/Pages/Admin/SchoolsPanel.vue new file mode 100644 index 00000000..c9f4550a --- /dev/null +++ b/resources/js/Pages/Admin/SchoolsPanel.vue @@ -0,0 +1,11 @@ + + + diff --git a/resources/js/Pages/Auth/Admin/Dashboard.vue b/resources/js/Pages/Auth/Admin/Dashboard.vue deleted file mode 100644 index 7436d1e8..00000000 --- a/resources/js/Pages/Auth/Admin/Dashboard.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/resources/js/Pages/Profile.vue b/resources/js/Pages/Profile.vue deleted file mode 100644 index c1b524bd..00000000 --- a/resources/js/Pages/Profile.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/resources/js/Pages/SchoolsPanel.vue b/resources/js/Pages/SchoolsPanel.vue deleted file mode 100644 index e69de29b..00000000 diff --git a/resources/js/Pages/Dashboard.vue b/resources/js/Pages/User/Dashboard.vue similarity index 99% rename from resources/js/Pages/Dashboard.vue rename to resources/js/Pages/User/Dashboard.vue index cf5bfd82..4b602b26 100644 --- a/resources/js/Pages/Dashboard.vue +++ b/resources/js/Pages/User/Dashboard.vue @@ -1,5 +1,4 @@