I lowkey forgot to commit
This commit is contained in:
17
templates/account/dashboard.html.twig
Normal file
17
templates/account/dashboard.html.twig
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% block title %}Dashboard{% endblock %}
|
||||
{% block body %}
|
||||
<h1 class="h4 mb-3">Your profile</h1>
|
||||
{% for msg in app.flashes('success') %}<div class="alert alert-success">{{ msg }}</div>{% endfor %}
|
||||
|
||||
{{ form_start(form, {attr: {class: 'vstack gap-3', novalidate: 'novalidate'}}) }}
|
||||
<div>{{ form_label(form.email) }}{{ form_widget(form.email, {attr: {class: 'form-control'}}) }}{{ form_errors(form.email) }}</div>
|
||||
<div>{{ form_label(form.displayName) }}{{ form_widget(form.displayName, {attr: {class: 'form-control'}}) }}{{ form_errors(form.displayName) }}</div>
|
||||
<div>{{ form_label(form.currentPassword) }}{{ form_widget(form.currentPassword, {attr: {class: 'form-control'}}) }}{{ form_errors(form.currentPassword) }}</div>
|
||||
<div>{{ form_label(form.newPassword.first) }}{{ form_widget(form.newPassword.first, {attr: {class: 'form-control'}}) }}{{ form_errors(form.newPassword.first) }}</div>
|
||||
<div>{{ form_label(form.newPassword.second) }}{{ form_widget(form.newPassword.second, {attr: {class: 'form-control'}}) }}{{ form_errors(form.newPassword.second) }}</div>
|
||||
<button class="btn btn-success" type="submit">Save changes</button>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
35
templates/account/settings.html.twig
Normal file
35
templates/account/settings.html.twig
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% block title %}Settings{% endblock %}
|
||||
{% block body %}
|
||||
<h1 class="h4 mb-3">Settings</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h2 class="h6">Appearance</h2>
|
||||
<div class="form-check form-switch mt-2">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="themeToggle">
|
||||
<label class="form-check-label" for="themeToggle">Dark mode</label>
|
||||
</div>
|
||||
<small class="text-secondary">Your choice is saved in a cookie.</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function(){
|
||||
const key = 'theme';
|
||||
const root = document.documentElement;
|
||||
const current = (document.cookie.match(/(?:^|; )theme=([^;]+)/)?.[1] || '').replace(/\+/g,' ');
|
||||
const initial = current || root.getAttribute('data-bs-theme') || 'light';
|
||||
const toggle = document.getElementById('themeToggle');
|
||||
toggle.checked = initial === 'dark';
|
||||
function setTheme(t){
|
||||
root.setAttribute('data-bs-theme', t);
|
||||
const d = new Date(); d.setFullYear(d.getFullYear()+1);
|
||||
document.cookie = key+'='+t+'; path=/; SameSite=Lax; expires='+d.toUTCString();
|
||||
}
|
||||
toggle.addEventListener('change', ()=> setTheme(toggle.checked ? 'dark' : 'light'));
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user