Compare commits
No commits in common. "9c90710bf3f81479c5f4ffce10b24389343d9d70" and "147e3b149906519ad2671d4fb24abe79cb03118f" have entirely different histories.
9c90710bf3
...
147e3b1499
@ -25,10 +25,10 @@ class AuthController extends Controller {
|
|||||||
if($result === true) {
|
if($result === true) {
|
||||||
$this->redirect('/dashboard');
|
$this->redirect('/dashboard');
|
||||||
} else {
|
} else {
|
||||||
$this->view('auth/signin', ['error' => $result], 'noheader');
|
$this->view('auth/signin', ['error' => $result]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->view('auth/signin', ['title' => 'Log In'], 'noheader');
|
$this->view('auth/signin', ['title' => 'Log In']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ class AuthController extends Controller {
|
|||||||
$this->view('auth/signup', [
|
$this->view('auth/signup', [
|
||||||
'error' => 'Please correct the errors below.',
|
'error' => 'Please correct the errors below.',
|
||||||
'validationErrors' => $validator->errors() ?: [],
|
'validationErrors' => $validator->errors() ?: [],
|
||||||
], 'noheader');
|
]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,13 +67,13 @@ class AuthController extends Controller {
|
|||||||
$this->view('auth/signup', [
|
$this->view('auth/signup', [
|
||||||
'error' => $result,
|
'error' => $result,
|
||||||
'validationErrors' => [],
|
'validationErrors' => [],
|
||||||
], 'noheader');
|
]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->view('auth/signup', [
|
$this->view('auth/signup', [
|
||||||
'title' => 'Register',
|
'title' => 'Register',
|
||||||
'validationErrors' => [],
|
'validationErrors' => [],
|
||||||
], 'noheader');
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,9 +25,4 @@
|
|||||||
|
|
||||||
<input type="submit" value="Sign In">
|
<input type="submit" value="Sign In">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="bordered">
|
|
||||||
<p>New to Habit Tracker?</p>
|
|
||||||
<a href="/auth/signup">Create an account</a>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
|
@ -37,9 +37,4 @@
|
|||||||
|
|
||||||
<input type="submit" value="Sign Up">
|
<input type="submit" value="Sign Up">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="bordered">
|
|
||||||
<p>Already have an account?</p>
|
|
||||||
<a href="/auth/signin">Sign in</a>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
|
@ -10,23 +10,13 @@
|
|||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="stylesheet" href="/css/global.css">
|
<link rel="stylesheet" href="/css/global.css">
|
||||||
<link rel="stylesheet" href="/css/vars.css">
|
<link rel="stylesheet" href="/css/vars.css">
|
||||||
<link rel="stylesheet" href="/css/header.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/img/favicon.ico">
|
<link rel="icon" type="image/x-icon" href="/img/favicon.ico">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<div id="hd-left">
|
|
||||||
<a href="/"><img src="/img/logo.jpg" alt="home"></a>
|
|
||||||
<a href="/"><?= $data['title'] ?></a>
|
|
||||||
</div>
|
|
||||||
<div id="hd-right">
|
|
||||||
<?php if (!isset($_SESSION['user'])): ?>
|
|
||||||
<a href="/auth/signin">Log In</a>
|
<a href="/auth/signin">Log In</a>
|
||||||
<a href="/auth/signup">Sign Up</a>
|
<a href="/auth/signup">Sign Up</a>
|
||||||
<?php else: ?>
|
|
||||||
<a href="/auth/logout">Log Out</a>
|
<a href="/auth/logout">Log Out</a>
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
<main class="content">
|
<main class="content">
|
||||||
<?= $content ?>
|
<?= $content ?>
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta name="author" content="Filip Rojek | http://filiprojek.cz">
|
|
||||||
<meta name="email" content="webmaster(@)fofrweb.com">
|
|
||||||
<meta name="copyright" content="(c) filiprojek.cz">
|
|
||||||
<title>Habit Tracker | <?= $data['title'] ?></title>
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
|
||||||
<link rel="stylesheet" href="/css/global.css">
|
|
||||||
<link rel="stylesheet" href="/css/vars.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/img/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<main class="content">
|
|
||||||
<?= $content ?>
|
|
||||||
</main>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
define('DB_HOST', '0.0.0.0');
|
|
||||||
define('DB_NAME', 'habit_tracker');
|
|
||||||
define('DB_USER', 'username');
|
|
||||||
define('DB_PASS', 'password');
|
|
@ -16,8 +16,8 @@ class Controller {
|
|||||||
* @param string $viewName
|
* @param string $viewName
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*/
|
*/
|
||||||
public function view($viewName, $data = [], $layout = "base") {
|
public function view($viewName, $data = []) {
|
||||||
$view = new View();
|
$view = new View();
|
||||||
$view->render($viewName, $data, $layout);
|
$view->render($viewName, $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ class Router {
|
|||||||
} else {
|
} else {
|
||||||
http_response_code(404);
|
http_response_code(404);
|
||||||
$view = new View();
|
$view = new View();
|
||||||
$view->render('errors/404', [], 'noheader');
|
$view->render('errors/404');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ services:
|
|||||||
MARIADB_ROOT_PASSWORD: root
|
MARIADB_ROOT_PASSWORD: root
|
||||||
ports:
|
ports:
|
||||||
- 3306:3306
|
- 3306:3306
|
||||||
profiles: ["prod", "dev"]
|
|
||||||
|
|
||||||
phpmyadmin:
|
phpmyadmin:
|
||||||
image: phpmyadmin
|
image: phpmyadmin
|
||||||
@ -15,7 +14,6 @@ services:
|
|||||||
- 8080:80
|
- 8080:80
|
||||||
environment:
|
environment:
|
||||||
- PMA_ARBITRARY=1
|
- PMA_ARBITRARY=1
|
||||||
profiles: ["dev"]
|
|
||||||
|
|
||||||
habittracker:
|
habittracker:
|
||||||
build:
|
build:
|
||||||
@ -27,4 +25,3 @@ services:
|
|||||||
- 8000:80
|
- 8000:80
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
- mariadb
|
||||||
profiles: ["prod"]
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
.dashboard {
|
.dashboard {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
width: 100vw;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@ -58,21 +59,3 @@ select {
|
|||||||
.form small.error {
|
.form small.error {
|
||||||
width: 15rem;
|
width: 15rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form .bordered {
|
|
||||||
border-radius: var(--border-radious);
|
|
||||||
border: var(--borderWidth-thin) solid var(--clr-border);
|
|
||||||
width: 17rem;
|
|
||||||
padding: 1rem;
|
|
||||||
margin-top: 1rem;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form .bordered a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: var(--clr-link-blue);
|
|
||||||
}
|
|
||||||
|
|
||||||
.form .bordered a:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 0 2rem;
|
|
||||||
width: 100vw;
|
|
||||||
height: 3rem;
|
|
||||||
background: var(--clr-secondary);
|
|
||||||
border-radius: var(--border-radious);
|
|
||||||
border-bottom: var(--borderWidth-thin) solid var(--clr-border);
|
|
||||||
}
|
|
||||||
|
|
||||||
#hd-left,
|
|
||||||
#hd-right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
header a img {
|
|
||||||
height: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
header a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
main {
|
main {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
gap: 2rem;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
padding: 0 var(--container-size);
|
padding: 0 var(--container-size);
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
--clr-green: #238636;
|
--clr-green: #238636;
|
||||||
--clr-danger-muted: #f851491a;
|
--clr-danger-muted: #f851491a;
|
||||||
|
|
||||||
--clr-link-blue: #4493f8;
|
|
||||||
|
|
||||||
--border-radious: 5px;
|
--border-radious: 5px;
|
||||||
--borderWidth-thin: max(1px, 0.0625rem);
|
--borderWidth-thin: max(1px, 0.0625rem);
|
||||||
--clr-border: #3d444db3;
|
--clr-border: #3d444db3;
|
||||||
|
Loading…
Reference in New Issue
Block a user