Skip to content

Commit 56d84ef

Browse files
authored
Merge pull request #81 from LaswitchTech/dev
General: Version bumped to v0.0.81
2 parents 2bfab24 + 1a2e89c commit 56d84ef

18 files changed

Lines changed: 818 additions & 463 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.0.80
1+
v0.0.81

View/330.php

Lines changed: 68 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,75 @@
1-
<?php if(!$this->Auth->isAuthenticated()): ?>
2-
<div class="row g-0 flex-row overflow-hidden">
3-
<div class="col-lg-6 p-5" style="background: var(--bs-body-bg);">
4-
<?php if(is_null($this->Request->getParams('GET','verify'))): ?>
5-
<div class="mb-4">
6-
<h2 class="h4 mb-1"><?= $this->Locale->get('Reset your password') ?></h2>
7-
<p class="opacity-50 mb-0"><?= $this->Locale->get('Use your company account') ?></p>
1+
<div class="row g-0 flex-row overflow-hidden">
2+
<div class="col-lg-6 p-5" style="background: var(--bs-body-bg);">
3+
<?php if(is_null($this->Request->getParams('GET','verify'))): ?>
4+
<div class="mb-4">
5+
<h2 class="h4 mb-1"><?= $this->Locale->get('Reset your password') ?></h2>
6+
<p class="opacity-50 mb-0"><?= $this->Locale->get('Use your company account') ?></p>
7+
</div>
8+
<form method="POST" action="?forgot&verify" class="needs-validation" autocomplete="off" novalidate>
9+
<?= $this->CSRF->field(); ?>
10+
<div class="mb-3">
11+
<label for="username" class="form-label"><?= $this->Locale->get('Username') ?></label>
12+
<input type="email" class="form-control" name="username" id="username" autocomplete="off" placeholder="username@domain.com" required>
13+
<div class="invalid-feedback"><?= $this->Locale->get('Please enter a valid email.') ?></div>
814
</div>
9-
<form method="POST" action="?forgot&verify" class="needs-validation" autocomplete="off" novalidate>
10-
<?= $this->CSRF->field(); ?>
11-
<div class="mb-3">
12-
<label for="username" class="form-label"><?= $this->Locale->get('Username') ?></label>
13-
<input type="email" class="form-control" name="username" id="username" autocomplete="off" placeholder="username@domain.com" required>
14-
<div class="invalid-feedback"><?= $this->Locale->get('Please enter a valid email.') ?></div>
15-
</div>
16-
<div class="d-flex justify-content-between align-items-center gap-3 mt-4 mb-2">
17-
<button type="button" class="btn btn-outline-secondary" onclick="window.history.back();"><i class="bi bi-arrow-left me-1"></i><?= $this->Locale->get('Go Back') ?></button>
18-
<button type="submit" class="btn btn-primary flex-grow-1" name="reset"><?= $this->Locale->get('Continue') ?></button>
19-
</div>
20-
</form>
21-
<?php else: ?>
22-
<div class="mb-4">
23-
<h2 class="h4 mb-1"><?= $this->Locale->get('Enter your verification code') ?></h2>
24-
<p class="opacity-50 mb-0"><?= $this->Locale->get('We sent you a code to your email') ?></p>
15+
<div class="d-flex justify-content-between align-items-center gap-3 mt-4 mb-2">
16+
<button type="button" class="btn btn-outline-secondary" onclick="window.history.back();"><i class="bi bi-arrow-left me-1"></i><?= $this->Locale->get('Go Back') ?></button>
17+
<button type="submit" class="btn btn-primary flex-grow-1" name="reset"><?= $this->Locale->get('Continue') ?></button>
2518
</div>
26-
<form method="POST" action="<?= $this->Request->getHostAddress() . '/' . $this->Request->getUri() ?>" class="needs-validation" autocomplete="off" novalidate>
27-
<?= $this->CSRF->field(); ?>
28-
<input type="email" class="d-none" name="username" id="username" autocomplete="off" value="<?=$this->Request->getParams('POST','username')?>">
29-
<div class="mb-3">
30-
<label for="code" class="form-label"><?= $this->Locale->get('Code') ?></label>
31-
<input type="text" class="form-control" name="code" id="code" autocomplete="off" placeholder="000000" value="<?=$this->Request->getParams('GET','verify')?>" required>
32-
<div class="invalid-feedback"><?= $this->Locale->get('Please enter a valid pin.') ?></div>
33-
</div>
34-
<div class="d-flex justify-content-between align-items-center gap-3 mt-4 mb-2">
35-
<button type="button" class="btn btn-outline-secondary" onclick="window.history.back();"><i class="bi bi-arrow-left me-1"></i><?= $this->Locale->get('Go Back') ?></button>
36-
<button type="submit" class="btn btn-primary flex-grow-1" name="reset"><?= $this->Locale->get('Continue') ?></button>
37-
</div>
38-
</form>
39-
<?php endif; ?>
40-
</div>
41-
<div class="col-lg-6 p-5 d-flex flex-column text-white" style="background: linear-gradient(120deg, var(--bs-primary), var(--bs-dark));">
42-
<div class="d-flex align-items-center gap-2 mb-4">
43-
<img src="/logo" alt="<?= $this->Config->get('application','name'); ?>" style="max-height: 4rem; max-width: 4rem;">
44-
<h3 class="fw-lighter m-0"><?= $this->Config->get('application','name'); ?></h3>
45-
</div>
46-
<div class="mt-auto">
47-
<h3 class="h4 fw-light"><?= $this->Locale->get($this->Config->get('application','slogan') ?? ''); ?></h3>
48-
<p class="opacity-50"><?= $this->Locale->get($this->Config->get('application','tagline') ?? ''); ?></p>
19+
</form>
20+
<?php else: ?>
21+
<div class="mb-4">
22+
<h2 class="h4 mb-1"><?= $this->Locale->get('Enter your verification code') ?></h2>
23+
<p class="opacity-50 mb-0"><?= $this->Locale->get('We sent you a code to your email') ?></p>
4924
</div>
25+
<form method="POST" action="<?= $this->Request->getHostAddress() . '/' . $this->Request->getUri() ?>" class="needs-validation" autocomplete="off" novalidate>
26+
<?= $this->CSRF->field(); ?>
27+
<input type="email" class="d-none" name="username" id="username" autocomplete="off" value="<?=$this->Request->getParams('POST','username')?>">
28+
<div class="mb-3">
29+
<label for="code" class="form-label"><?= $this->Locale->get('Code') ?></label>
30+
<input type="text" class="form-control" name="code" id="code" autocomplete="off" placeholder="000000" value="<?=$this->Request->getParams('GET','verify')?>" required>
31+
<div class="invalid-feedback"><?= $this->Locale->get('Please enter a valid pin.') ?></div>
32+
</div>
33+
<div class="d-flex justify-content-between align-items-center gap-3 mt-4 mb-2">
34+
<button type="button" class="btn btn-outline-secondary" onclick="window.history.back();"><i class="bi bi-arrow-left me-1"></i><?= $this->Locale->get('Go Back') ?></button>
35+
<button type="submit" class="btn btn-primary flex-grow-1" name="reset"><?= $this->Locale->get('Continue') ?></button>
36+
</div>
37+
</form>
38+
<?php endif; ?>
39+
</div>
40+
<div class="col-lg-6 p-5 d-flex flex-column text-white" style="background: linear-gradient(120deg, var(--bs-primary), var(--bs-dark));">
41+
<div class="d-flex align-items-center gap-2 mb-4">
42+
<img src="/logo" alt="<?= $this->Config->get('application','name'); ?>" style="max-height: 4rem; max-width: 4rem;">
43+
<h3 class="fw-lighter m-0"><?= $this->Config->get('application','name'); ?></h3>
44+
</div>
45+
<div class="mt-auto">
46+
<h3 class="h4 fw-light"><?= $this->Locale->get($this->Config->get('application','slogan') ?? ''); ?></h3>
47+
<p class="opacity-50"><?= $this->Locale->get($this->Config->get('application','tagline') ?? ''); ?></p>
5048
</div>
5149
</div>
52-
<script>
50+
</div>
51+
<script>
5352

54-
// Bootstrap validation
55-
(() => {
56-
const forms = document.querySelectorAll('.needs-validation');
57-
Array.from(forms).forEach(form => {
58-
form.addEventListener('submit', event => {
59-
if (!form.checkValidity()) {
60-
event.preventDefault();
61-
event.stopPropagation();
62-
}
63-
form.classList.add('was-validated');
64-
}, false);
65-
});
53+
// Bootstrap validation
54+
(() => {
55+
const forms = document.querySelectorAll('.needs-validation');
56+
Array.from(forms).forEach(form => {
57+
form.addEventListener('submit', event => {
58+
if (!form.checkValidity()) {
59+
event.preventDefault();
60+
event.stopPropagation();
61+
}
62+
form.classList.add('was-validated');
63+
}, false);
64+
});
6665

67-
// Configure Input Mask
68-
$('input[name="verify"]').inputmask({
69-
mask: ["999999"],
70-
placeholder: " ",
71-
greedy: false,
72-
showMaskOnHover: false,
73-
showMaskOnFocus: true
74-
});
75-
})();
76-
</script>
77-
<?php else: $this->interrupt()->Router->render('503'); endif; ?>
66+
// Configure Input Mask
67+
$('input[name="verify"]').inputmask({
68+
mask: ["999999"],
69+
placeholder: " ",
70+
greedy: false,
71+
showMaskOnHover: false,
72+
showMaskOnFocus: true
73+
});
74+
})();
75+
</script>

View/400.php

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
1-
<!--
2-
Core Framework - View File
3-
4-
@license MIT (https://mit-license.org/)
5-
@author Louis Ouellet <louis@laswitchtech.com>
6-
-->
1+
<div class="card-body p-5">
2+
<div class="d-flex flex-column align-items-center justify-content-center">
3+
<h1 class="fw-bold m-0" style="font-size: calc(var(--bs-body-font-size) * 5)">400</h1>
4+
</div>
5+
<div class="d-flex align-items-center justify-content-center">
6+
<svg xmlns="http://www.w3.org/2000/svg" class="border-0" viewBox="0 0 465 210" role="img" aria-labelledby="title">
7+
<title id="title">Bob is confused by a bad request.</title>
8+
<defs>
9+
<filter id="drop" x="-20%" y="-20%" width="140%" height="140%">
10+
<feGaussianBlur in="SourceAlpha" stdDeviation="6"/>
11+
<feOffset dx="0" dy="6" result="off"/>
12+
<feColorMatrix in="off" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .25 0"/>
13+
<feBlend in="SourceGraphic" mode="normal"/>
14+
</filter>
15+
<pattern id="stripes" width="20" height="20" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
16+
<rect width="10" height="20" fill="var(--bs-warning)"/>
17+
<rect x="10" width="10" height="20" fill="var(--bs-dark)"/>
18+
</pattern>
19+
</defs>
20+
<g transform="translate(232,110)" filter="url(#drop)">
21+
<g class="bob">
22+
<ellipse cx="0" cy="75" rx="64" ry="16" fill="#000" opacity=".1"/>
23+
<path transform="scale(7) translate(-8,-3)" fill="var(--bs-light)" d="M7.03 1.88 c.252-1.01 1.688-1.01 1.94 0 l2.905 11.62 H4.125 Z"/>
24+
<path transform="scale(7) translate(-8,-3)" fill="var(--bs-orange)" d="m9.97 4.88.953 3.811C10.159 8.878 9.14 9 8 9s-2.158-.122-2.923-.309L6.03 4.88C6.635 4.957 7.3 5 8 5s1.365-.043 1.97-.12m-.245-.978L8.97.88C8.718-.13 7.282-.13 7.03.88L6.275 3.9C6.8 3.965 7.382 4 8 4s1.2-.036 1.725-.098m4.396 8.613a.5.5 0 0 1 .037.96l-6 2a.5.5 0 0 1-.316 0l-6-2a.5.5 0 0 1 .037-.96l2.391-.598.565-2.257c.862.212 1.964.339 3.165.339s2.303-.127 3.165-.339l.565 2.257z"/>
25+
<circle cx="-10" cy="22" r="4" fill="var(--bs-dark)"/>
26+
<circle cx="10" cy="22" r="4" fill="var(--bs-dark)"/>
27+
<circle cx="-9" cy="21" r="1" fill="var(--bs-light)"/>
28+
<circle cx="11" cy="21" r="1" fill="var(--bs-light)"/>
29+
<rect x="-6" y="32" width="12" height="3" rx="2" fill="var(--bs-dark)"/>
30+
</g>
31+
<g class="bubble">
32+
<path transform="scale(4) translate(-8,-25)" fill="var(--bs-warning)" d="M14 1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-2.5a2 2 0 0 0-1.6.8L8 14.333 6.1 11.8a2 2 0 0 0-1.6-.8H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2.5a1 1 0 0 1 .8.4l1.9 2.533a1 1 0 0 0 1.6 0l1.9-2.533a1 1 0 0 1 .8-.4H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/>
33+
<g transform="scale(2) translate(-8,-45)">
34+
<path fill="var(--bs-primary)" d="M4.475 5.458c-.284 0-.514-.237-.47-.517C4.28 3.24 5.576 2 7.825 2c2.25 0 3.767 1.36 3.767 3.215 0 1.344-.665 2.288-1.79 2.973-1.1.659-1.414 1.118-1.414 2.01v.03a.5.5 0 0 1-.5.5h-.77a.5.5 0 0 1-.5-.495l-.003-.2c-.043-1.221.477-2.001 1.645-2.712 1.03-.632 1.397-1.135 1.397-2.028 0-.979-.758-1.698-1.926-1.698-1.009 0-1.71.529-1.938 1.402-.066.254-.278.461-.54.461h-.777ZM7.496 14c.622 0 1.095-.474 1.095-1.09 0-.618-.473-1.092-1.095-1.092-.606 0-1.087.474-1.087 1.091S6.89 14 7.496 14"/>
35+
</g>
36+
</g>
37+
</g>
38+
</svg>
39+
</div>
40+
<div class="d-flex flex-column align-items-center justify-content-center">
41+
<p class="lead mb-1"><?= $this->Locale->get("Hmm... that request doesn't look right.") ?></p>
42+
<p class="opacity-50 text-center mb-4">
43+
<?= $this->Locale->get("Bob thinks the URL or parameters are malformed. Check the address, try removing special characters, or submit the form again.") ?>
44+
</p>
45+
</div>
46+
<div class="d-flex gap-3 justify-content-center">
47+
<button class="btn btn-outline-orange" type="button" onclick="window.history.back();"><i class="bi bi-arrow-left me-1"></i><?= $this->Locale->get('Go Back') ?></button>
48+
<button class="btn btn-outline-primary" type="button" onclick="location.reload()"><i class="bi bi-arrow-clockwise me-1"></i><?= $this->Locale->get('Retry') ?></button>
49+
<a class="btn btn-outline-secondary" href="/"><i class="bi bi-house me-1"></i><?= $this->Locale->get('Home') ?></a>
50+
<a class="btn btn-outline-dark" href="/contact"><i class="bi bi-life-preserver me-1"></i><?= $this->Locale->get('Contact Support') ?></a>
51+
</div>
52+
</div>

0 commit comments

Comments
 (0)