Merge pull request 'TIST-24: Fixed small issues on admin page' (#19) from TIST-24 into develop

Reviewed-on: #19
Reviewed-by: steve_dekart <stevedekart2020@gmail.com>
This commit is contained in:
greendavid004 2025-06-29 13:43:48 +02:00
commit c35cf57eab
8 changed files with 167 additions and 50 deletions

View File

@ -3,28 +3,28 @@ use Lycoreco\Includes\Routing\Router;
$sidebar_links = [
[
'name' => 'Dashboard',
'icon' => 'fa-solid fa-house',
'name' => 'Dashboard',
'icon' => 'fa-solid fa-house',
'router_name' => 'admin:home',
],
[
'name' => 'Users',
'icon' => 'fa-solid fa-users',
'name' => 'Users',
'icon' => 'fa-solid fa-users',
'router_name' => 'admin:user-list',
],
[
'name' => 'Recipes',
'icon' => 'fa-solid fa-bowl-food',
'name' => 'Recipes',
'icon' => 'fa-solid fa-bowl-food',
'router_name' => 'admin:recipe-list'
],
[
'name' => 'Categories',
'icon' => 'fa-solid fa-tag',
'name' => 'Categories',
'icon' => 'fa-solid fa-tag',
'router_name' => 'admin:category-list'
],
[
'name' => 'Ingredients',
'icon' => 'fa-solid fa-carrot',
'name' => 'Ingredients',
'icon' => 'fa-solid fa-carrot',
'router_name' => 'admin:ingredient-list'
]
];
@ -32,20 +32,24 @@ $sidebar_links = [
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo get_title_website($title); ?></title>
<link rel="shortcut icon" type="image/x-icon" href="<?php echo ASSETS_PATH . '/images/favicon.ico' ?>">
<!-- Google fonts -->
<!-- Google fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Play:wght@400;700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&family=Roboto+Slab:wght@100..900&display=swap"
rel="stylesheet">
<!-- Google fonts/ -->
<!-- Google fonts/ -->
<!-- Font Awesome -->
<link href="<?php echo ASSETS_PATH . '/fontawesome-free-6.6.0-web/css/fontawesome.min.css' ?>" rel="stylesheet" />
<!-- Font Awesome -->
<link href="<?php echo ASSETS_PATH . '/fontawesome-free-6.6.0-web/css/fontawesome.min.css' ?>" rel="stylesheet" />
<link href="<?php echo ASSETS_PATH . '/fontawesome-free-6.6.0-web/css/brands.min.css' ?>" rel="stylesheet" />
<link href="<?php echo ASSETS_PATH . '/fontawesome-free-6.6.0-web/css/solid.min.css' ?>" rel="stylesheet" />
<!-- Font Awesome/ -->
@ -54,6 +58,7 @@ $sidebar_links = [
<link rel="stylesheet" href="<?php echo ASSETS_PATH . '/css/style.css' ?>">
<link rel="stylesheet" href="<?php echo ASSETS_PATH . '/css/admin.css' ?>">
</head>
<body>
<header class="header-admin">
<div class="logo-admin">
@ -65,7 +70,7 @@ $sidebar_links = [
</div>
<div class="links">
<a href="<?php the_permalink('index:home') ?>" class="hover-anim">View site</a>
|
|
<a href="<?php the_permalink('users:logout') ?>" class="hover-anim">Log Out</a>
</div>
</div>
@ -73,20 +78,18 @@ $sidebar_links = [
<div class="wrapper-admin">
<aside class="admin-sidebar">
<a href="<?php the_permalink('admin:recipe-new') ?>" class="btn btn-primary"><i class="fa-solid fa-plus"></i> New recipe</a>
<a href="<?php the_permalink('admin:recipe-new') ?>" class="btn btn-primary"><i
class="fa-solid fa-plus"></i> New recipe</a>
<hr>
<ul class="admin-sidebar__list">
<?php foreach ($sidebar_links as $link): ?>
<li>
<a class="<?php echo Router::$current_router_name == $link['router_name'] ? "active" : "" ?>" href="<?php the_permalink($link['router_name']) ?>">
<i class="<?= $link['icon'] ?>"></i> <?= $link['name'] ?>
</a>
</li>
<li>
<a class="<?php echo Router::$current_router_name == $link['router_name'] ? "active" : "" ?>"
href="<?php the_permalink($link['router_name']) ?>">
<i class="<?= $link['icon'] ?>"></i> <?= $link['name'] ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</aside>
<div class="wrapper-admin__content">
<div class="wrapper-admin__content">

View File

@ -57,7 +57,7 @@
<form action="<?php the_permalink('admin:recipe-list') ?>" method="get">
<div class="input-admin">
<input type="text" name="s" placeholder="Search for recipes">
<button class="hover-anim" type="submit"><i class="fa-solid fa-magnifying-glass"></i></button>
<button class="btn btn-secondary hover-anim" type="submit"><i class="fa-solid fa-magnifying-glass"></i></button>
</div>
</form>

View File

@ -15,7 +15,7 @@
<form method="get">
<div class="input-admin">
<input type="text" name="s" placeholder="Search for <?php echo $context['verbose_name_multiply'] ?>" value="<?php echo isset($_GET['s']) ? $_GET['s'] : '' ?>">
<button type="submit" class="hover-anim"><i class="fa-solid fa-magnifying-glass"></i></button>
<button type="submit" class="hover-anim btn btn-secondary"><i class="fa-solid fa-magnifying-glass"></i></button>
</div>
</form>
</div>

View File

@ -15,8 +15,8 @@
<?php endif ?>
</div>
<div class="btn-control">
<a href="<?php the_permalink('admin:ing-cat-rel-list', [$recipe->get_id()]) ?>" class="btn">Show all</a>
<a href="<?php the_permalink('admin:ing-cat-rel-new', [$recipe->get_id()]) ?>" class="btn btn-primary">Add ingredient</a>
<a href="<?php the_permalink('admin:ing-cat-rel-list', [$recipe->get_id()]) ?>" class="btn btn-secondary hover-anim">Show all</a>
<a href="<?php the_permalink('admin:ing-cat-rel-new', [$recipe->get_id()]) ?>" class="btn btn-primary hover-anim">Add ingredient</a>
</div>
</div>
</div>

View File

@ -1,6 +1,6 @@
<div class="admin-block">
<div class="admin-block__title">Author</div>
<div class="admin-block__content">
<a href="<?php the_permalink('admin:user', [$author->get_id()]) ?>"><?php echo $author->field_username ?></a>
<a href="<?php the_permalink('admin:user', [$author->get_id()]) ?>" class="recipe-author"><?php echo $author->field_username ?></a>
</div>
</div>

View File

@ -20,19 +20,26 @@
* {
box-sizing: border-box;
}
body {
min-height: 100vh;
font-family: var(--common-font);
font-size: 14px;
color: var(--common-text);
}
.wrapper-admin {
display: flex;
min-height: calc(100vh - 64px);
}
.wrapper-admin__content {
width: 100%;
}
.header-admin {
height: 80px;
display: flex;
@ -41,9 +48,11 @@ body {
padding: 15px 10px;
}
.header-admin__control {
display: flex;
}
.header-admin__control .username {
color: var(--common-text);
font-size: 16px;
@ -51,30 +60,36 @@ body {
font-family: var(--common-font);
margin-right: 10px;
}
.header-admin__control .username span {
color: var(--title-color);
}
.header-admin__control .links a {
text-decoration: none;
font-size: 16px;
font-weight: 500;
font-family: var(--common-font);
color: var(--common-text);
}
.admin-sidebar {
width: 100%;
max-width: 314px;
flex-shrink: 0;
background: var(--panel-background);
}
.admin-sidebar .btn {
display: block;
margin: 20px 20px 20px 20px;
}
.admin-sidebar__list {
list-style: none;
}
.admin-sidebar__list a {
display: block;
padding: 10px 20px;
@ -82,37 +97,45 @@ body {
font-size: 20px;
text-decoration: none;
}
.admin-sidebar__list a:hover,
.admin-sidebar__list a.active {
color: #000;
}
.admin-sidebar__list a i {
width: 34px;
}
.admin-sidebar__list a span {
background: #f00;
padding: 2px 7px;
font-size: 15px;
border-radius: 100%;
}
.admin-container {
margin: 0 auto;
width: 100%;
max-width: 1100px;
padding: 22px 30px;
}
.admin-container h2 {
font-size: 24px;
margin-bottom: 20px;
}
.admin-container section {
margin-bottom: 25px;
}
#dashboard-stats {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
}
.dashboard-stats__item {
display: flex;
align-items: center;
@ -122,24 +145,30 @@ body {
border-radius: 5px;
padding: 12px 20px;
}
.dashboard-stats__item .icon {
font-size: 36px;
margin-right: 20px;
flex-shrink: 0;
}
.dashboard-stats__item .value {
font-size: 24px;
font-weight: 700;
}
.dashboard-stats__item.top-sales .icon {
color: #FF7B00;
}
.dashboard-stats__item.new-users .icon {
color: #00A3E8;
}
.dashboard-stats__item.orders .icon {
color: #BA00E8;
}
.dashboard-stats__item.profit .icon {
color: #00E842;
}
@ -153,6 +182,7 @@ body {
background: var(--panel-background);
border-radius: 10px;
}
.admin-table {
color: var(--common-text);
@ -163,43 +193,52 @@ body {
border-radius: 5px;
overflow: hidden;
}
.admin-table thead {
background: #0DBB99;
color: #eaf8eb;
}
.admin-table td,
.admin-table th {
padding: 15px 10px;
}
.admin-table a{
.admin-table a {
color: var(--title-color);
}
.admin-block__content .admin-block__table {
border-radius: 5px;
overflow: hidden;
margin-bottom: 10px;
}
.admin-table tbody tr:nth-child(odd),
.admin-block__table .row:nth-child(odd) {
background: #eaf8eb;
}
.admin-table tbody tr:nth-child(even),
.admin-block__table .row:nth-child(even) {
background: #b6f1ba;
}
.admin-block__table {
color: var(--common-text);
}
.admin-block__table .row {
display: flex;
justify-content: space-between;
}
.admin-single {
display: grid;
grid-template-columns: 1fr 320px;
gap: 20px;
}
.admin-block {
overflow: hidden;
border-radius: 5px;
@ -207,9 +246,11 @@ body {
margin-bottom: 20px;
background: #f1fff2
}
.admin-block__content {
padding: 10px;
}
.admin-block__title {
font-size: 18px;
font-family: var(--common-font);
@ -217,19 +258,28 @@ body {
padding: 10px 10px;
color: #eaf8eb;
}
.admin-block__table .row {
padding: 10px;
}
.admin-block__table a {
color: var(--title-color);
}
.admin-container.delete {
text-align: center;
}
.admin-container.delete .meta-text {
font-size: 18px;
margin-bottom: 15px;
}
.admin-container.delete .btn-control {
justify-content: space-around;
}
.order-stat {
display: flex;
align-items: center;
@ -237,18 +287,22 @@ body {
font-size: 18px;
justify-content: space-between;
}
.order-content .admin-block__table {
margin-top: 15px;
}
.order-stat span:first-child {
color: var(--common-text);
font-weight: 400;
font-family: var(--common-font);
}
.order-stat span:last-child {
color: var(--title-color);
}
.header-admin{
.header-admin {
position: fixed;
top: 0;
left: 0;
@ -257,7 +311,7 @@ body {
background-color: var(--panel-background);
}
.logo-admin{
.logo-admin {
color: var(--title-color);
font-family: var(--title-font);
font-size: 20px;
@ -265,7 +319,7 @@ body {
}
.input-admin input{
.input-admin input {
background: var(--input-background);
border: 1px solid var(--input-border);
color: var(--input-text-color);
@ -275,14 +329,16 @@ body {
box-sizing: border-box;
}
.input-admin button{
.input-admin button {
border: 1px solid var(--input-border);
}
.admin-container .title{
.admin-container .title {
text-align: start;
}
.input-admin button{
.input-admin button {
padding: 10px;
border-radius: 10px;
}
@ -290,6 +346,31 @@ body {
.admin-block__content .btn-control {
display: flex;
justify-content: space-between;
}
.admin-single__form img {
height: 260px;
width: 350;
border-radius: 10px;
margin-bottom: 20px;
}
.admin-single__form input[type="file"] {
margin-bottom: 20px;
}
.recipe-author {
color: var(--title-color);
}
.admin-single__form .input-checkbox {
accent-color: #0DBB99;
}

View File

@ -155,26 +155,31 @@ body {
color: var(--panel-text);
text-align: center;
}
.quote h2 {
margin-right: 10px;
margin-bottom: 5px;
}
.welcome {
background: var(--panel-background);
margin-bottom: 30px;
font-size: 24px;
line-height: 32px;
}
.welcome__inner {
display: flex;
justify-content: space-between;
align-items: center;
}
.welcome__inner .quote {
font-size: 38px;
text-align: left;
margin-bottom: 20px;
}
.welcome .text-container {
padding: 50px 0;
}
@ -992,16 +997,16 @@ label span {
/* flex-wrap: wrap; */
}
.single-instructions{
.single-instructions {
width: 50%;
font-size: 16px;
}
.single-ingredients{
.single-ingredients {
width: 50%;
}
.ingredients-table{
.ingredients-table {
width: 400px;
border-radius: 10px;
overflow: hidden;
@ -1009,17 +1014,43 @@ label span {
border-collapse: separate;
}
.ingredients-table th{
.ingredients-table th {
background-color: #008B70;
color: #fff;
padding: 10px 20px;
text-align: start;
}
.ingredients-table td{
.ingredients-table td {
padding: 10px 20px;
border-top: 2px solid #b3b3b3;
}
input:disabled {
background-color: #e9ecef;
color: #6c757d;
}
select {
padding: 6px;
border-radius: 10px;
margin-bottom: 20px;
}
textarea{
width: 400px;
padding: 10px;
background-color: var(--input-background);
border: 1px solid var(--input-border);
border-radius: 10px;
}
label {
display: inline-block;
margin-bottom: 5px;
}
@media (max-width: 768px) {
.catalog-items {
@ -1027,10 +1058,11 @@ label span {
grid-template-columns: repeat(2, 1fr);
margin-right: 0;
}
.welcome__inner {
flex-direction: column;
}
.single-recipe-content {
flex-wrap: wrap;
@ -1101,7 +1133,7 @@ label span {
gap: 12px;
}
.small-btns{
.small-btns {
display: flex;
justify-content: center;
gap: 10px;
@ -1113,7 +1145,7 @@ label span {
width: auto;
}
.btn-small{
.btn-small {
width: 35px;
}
@ -1235,6 +1267,7 @@ label span {
justify-content: center;
width: 200px;
}
#food-3d {
display: none;
}

View File

@ -64,7 +64,7 @@
<div class="search-and-login">
<i class="fa-solid fa-magnifying-glass search-icon"></i>
<input type="text" class="search-input" placeholder="Search recipes...">
<a href="<?php the_permalink("users:login") ?>" class="login-link hover-anim">
<a href="<?php the_permalink(CURRENT_USER ? 'users:profile' : 'users:login') ?>" class="login-link hover-anim">
<i class="fa-regular fa-user"></i>
</a>
</div>