added default index controller. template. using bulma.io

This commit is contained in:
tp_dhu 2025-02-08 05:55:03 +00:00
parent e8b13ad9f5
commit 368cb5fff3
6 changed files with 142 additions and 1 deletions

View File

@ -7,4 +7,8 @@ Used to keep track of ongoing projects/tasks, allow to view and search historic
## Plesk - quest notes
- plesk ext composer --application -register -domain desk.tinylink.uk -path desk.tinylink.uk/tp_servicedesk
~ https://www.plesk.com/kb/support/how-to-change-in-the-php-composer-extension-the-path-of-the-composer-json-file/
~ https://www.plesk.com/kb/support/how-to-change-in-the-php-composer-extension-the-path-of-the-composer-json-file/
## Milestones
- Database created locally
- .gitignore added

View File

@ -0,0 +1,15 @@
<?php
class HomeController {
public function display($f3){
// $db = $f3->get('DB');
// echo \Template::instance()->render('../ui/views/home.html');
echo \Template::instance()->render('../ui/views/home.html');
// Query
// View
}
// ...
}

39
public/index.php Normal file
View File

@ -0,0 +1,39 @@
<?php
require '../lib/vendor/autoload.php';
$f3 = \Base::instance();
$f3->set('DEBUG', 3); // development debug
$f3->config('../app/.env.cfg');
// Routing and Controller Setup
// home
$f3->route('GET /', 'HomeController->display');
// auth
$f3->route('GET /login', 'Auth->login');
$f3->route('POST /login', 'Auth->login');
$f3->route('GET /logout', 'Auth->logout');
// tickets - CRUD (CREATE, READ, UPDATE, DELETE)
$f3->route('GET /tickets', 'Tickets->list'); // view all tickets
$f3->route('GET /ticket/create', 'Tickets->create'); // show form to create
$f3->route('POST /ticket/create', 'Tickets->create'); // save
$f3->route('GET /ticket/@id', 'Tickets->read'); // view ticket details
$f3->route('GET /ticket/@id/edit', 'Tickets->edit'); // edit ticket
$f3->route('POST /ticket/@id/update', 'Tickets->update(PARAMS.id)'); //
// knowledgebase
$f3->route('GET /kb', 'KB->list');
$f3->route('GET /kb/create', 'KB->create');
$f3->route('GET /kb/@id', 'KB->read');
$f3->route('GET /kb/@id/edit', 'KB->edit');
$f3->route('POST /kb/@id/edit', 'KB->update');
// tags
$f3->route('GET /tags', 'Tag->list');
$f3->route('POST /tag/create', 'Tag->create');
$f3->run();

1
public/logo.svg Normal file
View File

@ -0,0 +1 @@
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="300.000000pt" height="300.000000pt" viewBox="0 0 300.000000 300.000000" preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,300.000000) scale(0.100000,-0.100000)" fill="#03045e" stroke="none"> <path d="M465 2639 c-88 -12 -236 -51 -312 -83 l-58 -24 0 -1054 c0 -880 2 -1053 14 -1050 177 37 258 45 461 46 187 1 230 -2 328 -22 145 -29 257 -69 414 -148 70 -35 130 -64 133 -64 3 0 5 470 5 1044 l0 1044 -26 31 c-14 17 -55 50 -92 74 -256 170 -569 244 -867 206z m397 -313 c85 -17 147 -37 241 -79 l67 -30 0 -318 c0 -176 -2 -319 -5 -319 -4 0 -46 14 -95 31 l-88 31 -4 97 c-3 90 -5 101 -32 135 -16 22 -50 48 -80 62 -33 16 -43 24 -29 24 12 0 37 15 56 33 46 43 56 98 29 161 -26 59 -66 80 -139 74 -77 -7 -114 -45 -121 -122 -6 -68 21 -119 74 -138 l34 -12 -51 -24 c-76 -36 -103 -84 -108 -189 -3 -82 -3 -83 -30 -84 -14 0 -65 -10 -114 -23 -48 -12 -90 -20 -92 -17 -3 2 -5 156 -5 342 l0 339 23 5 c148 36 343 45 469 21z m26 -990 c99 -22 209 -59 285 -97 34 -17 64 -33 66 -35 1 -1 -7 -20 -19 -42 l-22 -40 -86 40 c-244 113 -543 132 -803 52 -12 -3 -19 6 -27 38 -6 24 -8 46 -4 49 8 8 123 35 202 49 78 13 322 5 408 -14z m-5 -281 c110 -23 321 -100 355 -130 2 -2 -6 -22 -18 -44 l-20 -41 -48 24 c-74 37 -213 83 -302 100 -154 30 -381 17 -536 -29 -18 -6 -23 -1 -32 37 -6 23 -8 46 -4 50 7 7 175 43 242 52 67 8 285 -3 363 -19z m-33 -286 c88 -13 219 -54 313 -96 42 -20 77 -38 77 -41 0 -11 -44 -82 -49 -79 -105 58 -268 111 -397 129 l-94 12 0 41 c0 23 3 44 6 48 6 6 30 3 144 -14z m-334 -23 c3 -19 4 -40 2 -47 -2 -7 -42 -20 -89 -29 -46 -10 -96 -21 -110 -25 -23 -6 -27 -3 -37 33 -7 22 -12 42 -12 45 0 7 62 25 145 43 92 19 93 18 101 -20z"/> <path d="M2180 2634 c-218 -35 -517 -171 -605 -275 l-25 -31 0 -1044 c0 -574 2 -1044 5 -1044 3 0 63 29 133 64 157 79 269 119 414 148 98 20 141 23 328 22 203 -1 284 -9 461 -46 12 -3 14 170 17 1049 l2 1052 -47 21 c-188 83 -472 118 -683 84z m118 -246 l3 -48 -34 0 c-92 0 -268 -47 -393 -105 l-72 -33 -22 40 c-12 22 -20 41 -19 42 9 8 110 55 159 74 81 31 165 53 255 68 118 18 119 18 123 -38z m352 15 c36 -9 68 -19 72 -22 11 -10 -13 -93 -26 -88 -10 4 -81 19 -193 43 -24 5 -29 26 -16 72 5 22 9 23 52 17 25 -4 75 -14 111 -22z m-180 -253 c93 -10 231 -38 250 -50 9 -6 9 -17 -1 -49 -7 -22 -13 -41 -15 -41 -1 0 -42 10 -91 22 -75 19 -114 23 -263 22 -156 0 -186 -3 -272 -27 -53 -14 -136 -44 -184 -66 -48 -23 -88 -41 -90 -41 -2 0 -13 18 -24 39 l-19 39 22 14 c47 31 197 88 279 108 155 37 274 45 408 30z m-15 -280 c94 -8 259 -41 272 -54 3 -2 -1 -23 -8 -46 -11 -38 -15 -41 -38 -36 -14 3 -55 13 -91 21 -103 25 -298 30 -411 11 -100 -16 -239 -61 -321 -102 -26 -13 -50 -24 -52 -24 -3 0 -15 18 -26 40 l-20 40 57 29 c129 64 282 108 428 121 44 4 85 8 90 8 6 1 60 -3 120 -8z m130 -398 l40 -7 3 -340 c1 -187 0 -345 -2 -351 -3 -8 -22 -7 -68 2 -168 36 -398 27 -581 -22 -51 -13 -104 -27 -120 -30 l-27 -7 2 328 3 328 95 34 c103 37 190 60 285 73 65 10 305 4 370 -8z"/> <path d="M2174 1248 c-15 -29 -27 -54 -29 -56 -1 -1 -30 -7 -64 -13 l-63 -11 47 -48 47 -47 -11 -58 c-6 -32 -11 -63 -11 -68 0 -4 25 6 56 24 l57 32 59 -33 c51 -28 59 -30 55 -14 -3 11 -9 41 -13 67 -6 48 -6 49 41 97 l48 48 -49 8 c-77 11 -89 19 -113 73 -12 28 -24 51 -26 51 -3 0 -17 -24 -31 -52z"/> </g> </svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

6
public/style.css Normal file
View File

@ -0,0 +1,6 @@
html, body {padding:0; margin:0;}
html, body, #sidebar, #page,#base_body {
min-height: 100%
}
#page { min-height: calc(100vh - 170px - 52px) }

76
ui/views/home.html Normal file
View File

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bulma Dashboard</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.2/css/bulma.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma-checkradio@2.1/dist/css/bulma-checkradio.min.css">
</head>
<body>
<!-- Navigation Bar -->
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="/">
<!-- Your logo or app name -->
<img src="logo.svg" alt="App Logo">
</a>
<!-- Burger menu for mobile -->
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="mainNavbar">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="mainNavbar" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="/tickets">Tickets</a>
<a class="navbar-item" href="/projects">Projects</a>
<a class="navbar-item" href="/knowledge">Knowledge Base</a>
</div>
<div class="navbar-end">
<div class="navbar-item">
<div class="buttons">
<a class="button is-primary">Log in</a>
</div>
</div>
</div>
</div>
</nav>
<!-- Main Content Area -->
<main class="section" id="page">
<div class="container">
<!-- Fat-Free Framework content injection -->
@content
</div>
</main>
<!-- Footer -->
<footer class="footer">
<div class="content has-text-centered">
<p>&copy; <?php echo date('Y'); ?> Terry Probert</p>
</div>
</footer>
<!-- JavaScript for Bulma navbar burger (mobile) -->
<script>
document.addEventListener('DOMContentLoaded', () => {
const burgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
if (burgers.length > 0) {
burgers.forEach(el => {
el.addEventListener('click', () => {
const target = document.getElementById(el.dataset.target);
el.classList.toggle('is-active');
target.classList.toggle('is-active');
});
});
}
});
</script>
</body>
</html>