From d32bb29df61c387570f7c639b4c7bc434a6fee3a Mon Sep 17 00:00:00 2001 From: Mateus Koppe Date: Sun, 6 Oct 2019 22:50:46 -0300 Subject: [PATCH] Improve visual stuffs --- App/Controllers/HomeController.php | 11 +++++++++++ App/Views/auth/profile.php | 6 ++++-- App/Views/dashboard.php | 6 ++++++ App/Views/event/create.php | 2 +- App/Views/event/edit.php | 2 +- App/Views/home.php | 4 +++- App/router.php | 1 + 7 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 App/Views/dashboard.php diff --git a/App/Controllers/HomeController.php b/App/Controllers/HomeController.php index b4ee561..e73dbf8 100644 --- a/App/Controllers/HomeController.php +++ b/App/Controllers/HomeController.php @@ -44,4 +44,15 @@ public function home ($request, $response, $args) { View::render('layout/website/footer', $data); return $response; } + + public function dashboard ($request, $response, $args) { + AuthHelper::restrictToPermission(User::USER_LEVEL_ADMIN); + $user = AuthHelper::getAuthenticatedUser(); + + $data = compact(['user']); + View::render('layout/admin/header', $data); + View::render('dashboard', $data); + View::render('layout/admin/footer', $data); + return $response; + } } \ No newline at end of file diff --git a/App/Views/auth/profile.php b/App/Views/auth/profile.php index 9b9fa1c..32a3423 100644 --- a/App/Views/auth/profile.php +++ b/App/Views/auth/profile.php @@ -1,7 +1,6 @@
@@ -11,6 +10,9 @@

Perfil

+ isLevel(User::USER_LEVEL_ADMIN)): ?> + " class="btn btn--medium btn--secondary">Dashboard + " class="btn btn--medium btn--primary">Sair
diff --git a/App/Views/dashboard.php b/App/Views/dashboard.php new file mode 100644 index 0000000..1e2631e --- /dev/null +++ b/App/Views/dashboard.php @@ -0,0 +1,6 @@ +
+
+

Painel Administrativo

+

Gerencie os dados da SACC

+
+
diff --git a/App/Views/event/create.php b/App/Views/event/create.php index d1e9502..53eeeef 100644 --- a/App/Views/event/create.php +++ b/App/Views/event/create.php @@ -93,7 +93,7 @@ diff --git a/App/Views/event/edit.php b/App/Views/event/edit.php index 85de7f0..7c3c277 100644 --- a/App/Views/event/edit.php +++ b/App/Views/event/edit.php @@ -93,7 +93,7 @@ diff --git a/App/Views/home.php b/App/Views/home.php index 4008ef8..6fe0782 100644 --- a/App/Views/home.php +++ b/App/Views/home.php @@ -139,8 +139,10 @@
description?>
+ speaker)): ?> Palestrante: - speaker) ? $event->speaker : 'Fausto Silva' ?>
+ speaker ?>
+ InĂ­cio: time . ' hrs'?>
diff --git a/App/router.php b/App/router.php index 6094dc6..efbeaa1 100644 --- a/App/router.php +++ b/App/router.php @@ -48,6 +48,7 @@ $app->get('/perfil', 'App\Controllers\AuthController:profile'); $app->post('/perfil/atualizar', 'App\Controllers\AuthController:profileUpdate'); +$app->get('/admin', 'App\Controllers\HomeController:dashboard'); $app->get('/admin/permissoes', 'App\Controllers\UserController:index'); $app->post('/admin/permissoes/{id}', 'App\Controllers\UserController:update');