[UI][CONTROLLER][ROUTES] Corrected core action name, UserPanel CSS work

This commit is contained in:
rainydaysavings 2020-07-20 00:22:41 +01:00 committed by Hugo Sales
parent 0b0bd31a4b
commit 63a443e78e
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
9 changed files with 253 additions and 279 deletions

View File

@ -66,7 +66,7 @@ b {
right: 0; right: 0;
background-color: #272E36; background-color: #272E36;
box-shadow: 0px 0px 60px -20px rgba(0, 0, 0, 0.75); box-shadow: 0px 0px 60px -20px rgba(0, 0, 0, 0.75);
padding: var(--medium-size) var(--unit-size) var(--medium-size) var(--unit-size); padding: var(--medium-size);
} }
#top { #top {

View File

@ -2,7 +2,6 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: calc(2 * var(--medium-size) + var(--main-size) + 0.15em); margin-top: calc(2 * var(--medium-size) + var(--main-size) + 0.15em);
;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-left: 0; margin-left: 0;

View File

@ -2,7 +2,6 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: calc(2 * var(--medium-size) + var(--main-size) + 0.15em); margin-top: calc(2 * var(--medium-size) + var(--main-size) + 0.15em);
;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-left: 0; margin-left: 0;

View File

@ -1,122 +1,110 @@
/*-------------------------------------*/ .content {
/* PAGES ------------------------------*/ display: flex;
flex-wrap: wrap;
margin-top: calc(2 * var(--unit-size) + var(--main-size) + 0.15em);
justify-content: center;
align-items: center;
margin-left: calc(var(--nav-size));
margin-right: 0;
box-shadow: 0px 0px 60px -20px rgba(0, 0, 0, 0.75);
height: 100%;
}
.set-nav { .set-nav {
display: flex; order: 1;
justify-content: space-between; display: flex;
flex-wrap: wrap; justify-content: space-between;
order: 2; flex-wrap: wrap;
width: 100%; width: 100%;
margin-left: var(--side-margin); background-color: #2A323B;
margin-right: var(--side-margin); padding: var(--medium-size);
background-color: #00000080; font-size: var(--medium-size);
padding: var(--medium-size) var(--medium-size); font-family: var(--head-font);
font-size: var(--medium-size);
font-family: var(--head-font);
box-shadow: 0px 0px 60px -20px rgba(41, 50, 60, 1);
} }
.set-nav ul { .set-nav ul {
display: flex; display: flex;
align-items: stretch; align-items: stretch;
justify-content: space-evenly; justify-content: space-evenly;
width: 100%; width: 100%;
margin-left: calc(var(--side-margin) * 0.25); margin-left: calc(2 * var(--side-margin));
margin-right: calc(var(--side-margin) * 0.25); margin-right: calc(2 * var(--side-margin));
padding: 0; padding: 0;
} }
.set-nav li { .set-nav li {
display: block; display: block;
flex: 0 1 auto; flex: 0 1 auto;
list-style-type: none; list-style-type: none;
font-weight: 700;
} }
.active { .active {
color: #F6F6F6 !important; color: #F6F6F6 !important;
font-weight: 700; font-weight: 700;
} }
.set-nav a { .set-nav a {
color: #91B9D0; color: #91B9D0;
} }
.set-nav a:hover { .set-nav a:hover {
color: #F6F6F6; color: #F6F6F6;
transition: all 0.8s ease; transition: all 0.8s ease;
} }
/*-------------------------------------*/
/*-------------------------------------*/
.set-nav2 { .set-nav2 {
display: flex; order: 2;
position: relative; display: flex;
flex-wrap: wrap; justify-content: space-between;
order: 2; flex-wrap: wrap;
width: 100%; width: 100%;
margin-left: var(--side-margin); background-color: #2A323B;
margin-right: var(--side-margin); padding: var(--medium-size);
margin-top: var(--unit-size); font-size: var(--medium-size);
background-color: #00000080; font-family: var(--head-font);
border-top-left-radius: var(--unit-size);
border-top-right-radius: var(--unit-size);
padding: var(--medium-size) var(--medium-size);
font-size: var(--medium-size);
font-family: var(--head-font);
box-shadow: 0px 0px 60px -20px rgba(41, 50, 60, 1);
} }
.set-nav2 ul { .set-nav2 ul {
display: flex; display: flex;
align-items: stretch; align-items: stretch;
justify-content: space-evenly; justify-content: space-evenly;
width: 100%; width: 100%;
margin-left: calc(var(--side-margin) * 0.5); margin-left: calc(2 * var(--side-margin));
margin-right: calc(var(--side-margin) * 0.5); margin-right: calc(2 * var(--side-margin));
padding: 0; padding: 0;
} }
.set-nav2 li { .set-nav2 li {
display: block; display: block;
flex: 0 1 auto; flex: 0 1 auto;
list-style-type: none; list-style-type: none;
font-weight: 700;
}
.active {
color: #F6F6F6 !important;
font-weight: 700;
} }
.set-nav2 a { .set-nav2 a {
color: #91B9D0; color: #91B9D0;
} }
.set-nav2 a:hover { .set-nav2 a:hover {
color: #F6F6F6; color: #F6F6F6;
transition: all 0.8s ease; transition: all 0.8s ease;
} }
hr { .form {
position: absolute; order: 3;
margin-bottom: 0; background-color: #00000040;
bottom: 0; font-size: var(--small-size);
left: 0; padding: calc(3*var(--unit-size));
width: 80%; padding-top: var(--unit-size);
margin-left: 10%; height: 100%;
color: #91b9d088;
} }
/* CONTENT ----------------------------*/
.content {
display: flex;
flex-wrap: wrap;
order: 3;
width: 100%;
margin-bottom: var(--unit-size);
margin-left: var(--side-margin);
margin-right: var(--side-margin);
background-color: rgba(0, 0, 0, 0.30);
padding: var(--unit-size);
border-bottom-left-radius: var(--unit-size);
border-bottom-right-radius: var(--unit-size);
box-shadow: 0px 0px 60px -20px rgba(41, 50, 60, 1);
}
/* FORMS ------------------------------*/ /* FORMS ------------------------------*/
label { label {
@ -139,4 +127,4 @@ input[type=text] {
border-radius: calc(var(--unit-size) * 0.5); border-radius: calc(var(--unit-size) * 0.5);
font-size: var(--medium-size); font-size: var(--medium-size);
margin-bottom: var(--unit-size); margin-bottom: var(--unit-size);
} }

View File

@ -1,128 +1,121 @@
/*-------------------------------------*/ .content {
/* PAGES ------------------------------*/ display: flex;
flex-wrap: wrap;
margin-top: calc(2 * var(--medium-size) + var(--main-size) + 0.15em);
justify-content: center;
align-items: center;
margin-left: 0;
margin-right: 0;
height: 100%;
}
.set-nav { .set-nav {
display: flex; order: 1;
justify-content: space-between; display: flex;
flex-wrap: wrap; justify-content: space-between;
order: 2; flex-wrap: wrap;
width: 100%; width: 100%;
margin-left: var(--side-margin); background-color: #2A323B;
margin-right: var(--side-margin); padding: var(--medium-size);
background-color: #00000080; font-size: var(--medium-size);
padding: var(--medium-size) var(--medium-size); font-family: var(--head-font);
font-size: var(--medium-size); box-shadow: 0px 0px 60px -20px rgba(0, 0, 0, 0.75);
font-family: var(--head-font);
box-shadow: 0px 0px 60px -20px rgba(41, 50, 60, 1);
} }
.set-nav ul { .set-nav ul {
display: flex; display: flex;
align-items: stretch; align-items: stretch;
justify-content: space-evenly; justify-content: space-evenly;
width: 100%; width: 100%;
margin-left: calc(var(--side-margin) * 0.25); margin-left: var(--side-margin);
margin-right: calc(var(--side-margin) * 0.25); margin-right: var(--side-margin);
padding: 0; padding: 0;
} }
.set-nav li { .set-nav li {
display: block; display: block;
flex: 0 1 auto; flex: 0 1 auto;
list-style-type: none; list-style-type: none;
} font-weight: 700;
font-size: var(--medium-size);
.active {
color: #F6F6F6 !important;
font-weight: 700;
} }
.set-nav a { .set-nav a {
color: #91B9D0; color: #91B9D0;
} }
.set-nav a:hover { .set-nav a:hover {
color: #F6F6F6; color: #F6F6F6;
transition: all 0.8s ease; transition: all 0.8s ease;
} }
/*-------------------------------------*/
/*-------------------------------------*/
.set-nav2 { .set-nav2 {
display: flex; order: 2;
position: relative; display: flex;
flex-wrap: wrap; justify-content: space-between;
order: 2; flex-wrap: wrap;
width: 100%; width: 100%;
margin-left: var(--side-margin); background-color: #00000030;
margin-right: var(--side-margin); padding: var(--medium-size);
margin-top: var(--unit-size); margin-top: calc(2 * var(--unit-size));
background-color: #00000080; margin-left: var(--side-margin);
border-top-left-radius: var(--unit-size); margin-right: var(--side-margin);
border-top-right-radius: var(--unit-size); font-size: var(--medium-size);
padding: var(--medium-size) var(--medium-size); font-family: var(--head-font);
font-size: var(--medium-size); border-radius: var(--unit-size) var(--unit-size) 0 0;
font-family: var(--head-font); box-shadow: 0px 0px 60px -20px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 60px -20px rgba(41, 50, 60, 1);
} }
.set-nav2 ul { .set-nav2 ul {
display: flex; display: flex;
align-items: stretch; align-items: stretch;
justify-content: space-evenly; justify-content: space-evenly;
width: 100%; width: 100%;
margin-left: calc(var(--side-margin) * 0.5); margin-left: var(--side-margin);
margin-right: calc(var(--side-margin) * 0.5); margin-right: var(--side-margin);
padding: 0; padding: 0;
} }
.set-nav2 li { .set-nav2 li {
display: block; display: block;
flex: 0 1 auto; flex: 0 1 auto;
list-style-type: none; list-style-type: none;
font-weight: 700;
font-size: var(--medium-size);
} }
.set-nav2 a { .set-nav2 a {
color: #91B9D0; color: #91B9D0;
} }
.set-nav2 a:hover { .set-nav2 a:hover {
color: #F6F6F6; color: #F6F6F6;
transition: all 0.8s ease; transition: all 0.8s ease;
} }
hr {
position: absolute; .active {
margin-bottom: 0; color: #F6F6F6 !important;
bottom: 0; font-weight: 700;
left: 0;
width: 80%;
margin-left: 10%;
color: #91b9d088;
} }
/* CONTENT ----------------------------*/ .form {
.content { order: 3;
display: flex; background-color: #00000040;
flex-wrap: wrap; padding: calc(2*var(--unit-size));
order: 3; font-size: var(--medium-size);
width: 100%; height: 100%;
margin-bottom: var(--unit-size); margin-left: var(--side-margin);
margin-left: var(--side-margin); margin-right: var(--side-margin);
margin-right: var(--side-margin); box-shadow: 0px 0px 60px -20px rgba(0, 0, 0, 0.75);
background-color: rgba(0, 0, 0, 0.30); border-radius: 0 0 var(--unit-size) var(--unit-size);
padding: var(--unit-size);
border-bottom-left-radius: var(--unit-size);
border-bottom-right-radius: var(--unit-size);
box-shadow: 0px 0px 60px -20px rgba(41, 50, 60, 1);
} }
/* FORMS ------------------------------*/ /* FORMS ------------------------------*/
label { label {
font-family: 'Montserrat', sans-serif; font-family: 'Montserrat', sans-serif;
font-weight: 800; font-weight: 800;
font-size: var(--medium-size);
} }
label:nth-child() { label:nth-child() {
@ -139,4 +132,4 @@ input[type=text] {
border-radius: calc(var(--unit-size) * 0.5); border-radius: calc(var(--unit-size) * 0.5);
font-size: var(--medium-size); font-size: var(--medium-size);
margin-bottom: var(--unit-size); margin-bottom: var(--unit-size);
} }

View File

@ -1,128 +1,122 @@
/*-------------------------------------*/ .content {
/* PAGES ------------------------------*/ display: flex;
flex-wrap: wrap;
margin-top: calc(2 * var(--medium-size) + var(--main-size) + 0.15em);
justify-content: center;
align-items: center;
margin-left: 0;
margin-right: 0;
height: 100%;
}
.set-nav { .set-nav {
display: flex; order: 1;
justify-content: space-between; display: flex;
flex-wrap: wrap; justify-content: space-between;
order: 2; flex-wrap: wrap;
width: 100%; width: 100%;
margin-left: var(--side-margin); background-color: #2A323B;
margin-right: var(--side-margin); padding: var(--medium-size);
background-color: #00000080; font-size: var(--medium-size);
padding: var(--medium-size) var(--medium-size); font-family: var(--head-font);
font-size: var(--medium-size); box-shadow: 0px 0px 60px -20px rgba(0, 0, 0, 0.75);
font-family: var(--head-font);
box-shadow: 0px 0px 60px -20px rgba(41, 50, 60, 1);
} }
.set-nav ul { .set-nav ul {
display: flex; display: flex;
align-items: stretch; align-items: stretch;
justify-content: space-evenly; justify-content: space-evenly;
width: 100%; width: 100%;
margin-left: calc(var(--side-margin) * 0.25); margin-left: var(--side-margin);
margin-right: calc(var(--side-margin) * 0.25); margin-right: var(--side-margin);
padding: 0; padding: 0;
} }
.set-nav li { .set-nav li {
display: block; display: block;
flex: 0 1 auto; flex: 0 1 auto;
list-style-type: none; list-style-type: none;
} font-weight: 700;
font-size: var(--medium-size);
.active {
color: #F6F6F6 !important;
font-weight: 700;
} }
.set-nav a { .set-nav a {
color: #91B9D0; color: #91B9D0;
} }
.set-nav a:hover { .set-nav a:hover {
color: #F6F6F6; color: #F6F6F6;
transition: all 0.8s ease; transition: all 0.8s ease;
} }
/*-------------------------------------*/
/*-------------------------------------*/
.set-nav2 { .set-nav2 {
display: flex; order: 2;
position: relative; display: flex;
flex-wrap: wrap; justify-content: space-between;
order: 2; flex-wrap: wrap;
width: 100%; width: 100%;
margin-left: calc(var(--side-margin) + 1%); background-color: #00000030;
margin-right: calc(var(--side-margin) + 1%); padding: var(--medium-size);
margin-top: var(--unit-size); margin-top: var(--unit-size);
background-color: #00000080; margin-left: 1%;
border-top-left-radius: var(--unit-size); margin-right: 1%;
border-top-right-radius: var(--unit-size); font-size: var(--medium-size);
padding: var(--medium-size) var(--medium-size); font-family: var(--head-font);
font-size: var(--medium-size); border-radius: var(--unit-size) var(--unit-size) 0 0;
font-family: var(--head-font); box-shadow: 0px 0px 60px -20px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 60px -20px rgba(41, 50, 60, 1);
} }
.set-nav2 ul { .set-nav2 ul {
display: flex; display: flex;
align-items: stretch; align-items: stretch;
justify-content: space-evenly; justify-content: space-evenly;
width: 100%; width: 100%;
margin-left: calc(var(--side-margin) * 0.5); margin-left: var(--side-margin);
margin-right: calc(var(--side-margin) * 0.5); margin-right: var(--side-margin);
padding: 0; padding: 0;
} }
.set-nav2 li { .set-nav2 li {
display: block; display: block;
flex: 0 1 auto; flex: 0 1 auto;
list-style-type: none; list-style-type: none;
font-weight: 700;
font-size: var(--medium-size);
} }
.set-nav2 a { .set-nav2 a {
color: #91B9D0; color: #91B9D0;
} }
.set-nav2 a:hover { .set-nav2 a:hover {
color: #F6F6F6; color: #F6F6F6;
transition: all 0.8s ease; transition: all 0.8s ease;
} }
hr {
position: absolute; .active {
margin-bottom: 0; color: #F6F6F6 !important;
bottom: 0; font-weight: 700;
left: 0;
width: 80%;
margin-left: 10%;
color: #91b9d088;
} }
/* CONTENT ----------------------------*/ .form {
.content { order: 3;
display: flex; background-color: #00000040;
flex-wrap: wrap; padding: calc(2*var(--unit-size));
order: 3; font-size: var(--medium-size);
width: 100%; height: 100%;
margin-bottom: var(--unit-size); margin-left: 1%;
margin-left: calc(var(--side-margin) + 1%); margin-right: 1%;
margin-right: calc(var(--side-margin) + 1%); margin-top: 0;
background-color: rgba(0, 0, 0, 0.30); box-shadow: 0;
padding: var(--unit-size); border-radius: 0 0 var(--unit-size) var(--unit-size);
border-bottom-left-radius: var(--unit-size);
border-bottom-right-radius: var(--unit-size);
box-shadow: 0px 0px 60px -20px rgba(41, 50, 60, 1);
} }
/* FORMS ------------------------------*/ /* FORMS ------------------------------*/
label { label {
font-family: 'Montserrat', sans-serif; font-family: 'Montserrat', sans-serif;
font-weight: 800; font-weight: 800;
font-size: var(--medium-size);
} }
label:nth-child() { label:nth-child() {
@ -139,4 +133,4 @@ input[type=text] {
border-radius: calc(var(--unit-size) * 0.5); border-radius: calc(var(--unit-size) * 0.5);
font-size: var(--medium-size); font-size: var(--medium-size);
margin-bottom: var(--unit-size); margin-bottom: var(--unit-size);
} }

View File

@ -31,28 +31,27 @@
namespace App\Controller; namespace App\Controller;
use App\Core\Controller;
// use App\Core\Event; // use App\Core\Event;
// use App\Util\Common; // use App\Util\Common;
use App\Core\DB\DB; use App\Core\DB\DB;
use App\Core\Form; use App\Core\Form;
use function App\Core\I18n\_m; use function App\Core\I18n\_m;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
class UserAdminPanel extends Controller class UserPanel extends AbstractController
{ {
public function handle(Request $request) public function __invoke(Request $request)
{ {
$prof = Form::create([ $prof = Form::create([
[_m('Nickname'), TextType::class], [_m('Nickname'), TextType::class],
[_m('FullName'), TextType::class], [_m('FullName'), TextType::class],
[_m('Homepage'), TextType::class], [_m('Homepage'), TextType::class],
[_m('Bio'), TextType::class], [_m('Bio'), TextType::class],
[_m('Location'), TextType::class], [_m('Location'), TextType::class],
['save', SubmitType::class, ['label' => _m('Save')]], ['save', SubmitType::class, ['label' => _m('Save')]], ]);
]);
$prof->handleRequest($request); $prof->handleRequest($request);
if ($prof->isSubmitted()) { if ($prof->isSubmitted()) {
@ -69,9 +68,8 @@ class UserAdminPanel extends Controller
} }
} }
return [ return $this->render('settings/profile.html.twig', [
'_template' => 'settings/profile.html.twig', 'prof' => $prof->createView(),
'prof' => $prof->createView(), ]);
];
} }
} }

View File

@ -49,9 +49,9 @@ abstract class Main
// Settings pages // Settings pages
foreach (['profile', 'avatar'] as $s) { foreach (['profile', 'avatar'] as $s) {
$r->connect('settings_' . $s, 'settings/' . $s, C\UserAdminPanel::class); $r->connect('settings_' . $s, 'settings/' . $s, C\UserPanel::class);
} }
$r->connect('settings_account', 'settings/account', C\UserAdminPanel::class); $r->connect('settings_account', 'settings/account', C\UserPanel::class);
} }
} }

View File

@ -6,7 +6,10 @@
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/settings/settings_small.css') }}" media="screen and (max-width: 750px)"> <link rel='stylesheet' type='text/css' href="{{ asset('assets/css/settings/settings_small.css') }}" media="screen and (max-width: 750px)">
{% endblock %} {% endblock %}
{% block title %}Profile Settings{% endblock %}
{% block nav %} {% block nav %}
<div class='content'>
<nav class='set-nav'> <nav class='set-nav'>
<ul> <ul>
<li> <li>
@ -29,12 +32,12 @@
<a href="{{ path('settings_avatar') }}" class='hover-effect {% if app.request.attributes.get('_route') starts with 'settings_avatar' %}active{% endif %}'>Avatar</a> <a href="{{ path('settings_avatar') }}" class='hover-effect {% if app.request.attributes.get('_route') starts with 'settings_avatar' %}active{% endif %}'>Avatar</a>
</li> </li>
</ul> </ul>
<hr>
</nav> </nav>
</div>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<div class='content'> <div class='form'>
{{ form(prof) }} {{ form(prof) }}
</div> </div>
{% endblock %} {% endblock %}