From 15c97859a45bf827f99fb27eb0a5451b087b1b2c Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Tue, 6 Aug 2024 10:40:52 +0300 Subject: [PATCH] Cleans up login and register pages. --- public_html/index.php | 9 ++++++- public_html/static/all.css | 12 +++++++++ public_html/templates/form-login.php | 33 ++++++++++++++----------- public_html/templates/form-register.php | 23 ++++++++++------- public_html/templates/page-menu.php | 2 -- public_html/templates/page-sidebar.php | 4 ++- 6 files changed, 56 insertions(+), 27 deletions(-) diff --git a/public_html/index.php b/public_html/index.php index 40a7c0f..ba7ee55 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -65,6 +65,7 @@ if (isset($_GET['page'])) { } // check if logged in +unset($user); if (isset($_COOKIE['username'])) { if ( !isset($_SESSION['username']) ) { $_SESSION['username'] = $_COOKIE['username']; @@ -107,15 +108,21 @@ if (in_array($page, $allowed_urls)) { include 'templates/page-header.php'; include 'templates/page-menu.php'; include 'templates/block-message.php'; - include 'templates/page-sidebar.php'; + if (isset($user)) { + include 'templates/page-sidebar.php'; + } include "pages/{$page}.php"; } // the page is not in allowed urls, loading front page } else { + $error = 'The page "' . $page . '" is not found'; include 'templates/page-header.php'; include 'templates/page-menu.php'; include 'templates/block-message.php'; + if (isset($user)) { + include 'templates/page-sidebar.php'; + } include 'pages/front.php'; } include 'templates/page-footer.php'; diff --git a/public_html/static/all.css b/public_html/static/all.css index 3b35798..3c75c43 100644 --- a/public_html/static/all.css +++ b/public_html/static/all.css @@ -123,7 +123,19 @@ /* collapsing sidebar */ +.toggle-sidebar-button { + position: absolute; + top: -10px; + left: 0; + z-index: 100; + margin: 10px; + height: 22px; + width: 22px; + padding-left: 2px; + padding-top: 0px; +} .sidebar-wrapper { + position: relative; width: 275px; transition: width 0.5s ease; overflow-x: hidden; diff --git a/public_html/templates/form-login.php b/public_html/templates/form-login.php index 7d783db..3508d9c 100644 --- a/public_html/templates/form-login.php +++ b/public_html/templates/form-login.php @@ -1,17 +1,22 @@ -

Login

+
+ +

Login

+ +
+

Welcome to JILO!
Please enter login credentials:

+
+ +
+ +
+ +
 
+ +
+
- diff --git a/public_html/templates/form-register.php b/public_html/templates/form-register.php index d4ca7e3..cfd9454 100644 --- a/public_html/templates/form-register.php +++ b/public_html/templates/form-register.php @@ -1,12 +1,17 @@ -

Register

+
+ +

Register

+ +
+

Enter credentials for registration:

+
+ +
+ +
 
+ +
+
-
-
- -
- -
- -
diff --git a/public_html/templates/page-menu.php b/public_html/templates/page-menu.php index f636323..17aa6b0 100644 --- a/public_html/templates/page-menu.php +++ b/public_html/templates/page-menu.php @@ -5,11 +5,9 @@
-
-
  • config
  • conferences
  • diff --git a/public_html/templates/page-sidebar.php b/public_html/templates/page-sidebar.php index 1f1ff25..e76e5dc 100644 --- a/public_html/templates/page-sidebar.php +++ b/public_html/templates/page-sidebar.php @@ -5,11 +5,13 @@ +
    +