Skip to content

Commit

Permalink
Roles: Added the roles and statuses for the applications
Browse files Browse the repository at this point in the history
  • Loading branch information
fet1sov committed May 27, 2024
1 parent d7c6f44 commit a0a41a4
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 7 deletions.
4 changes: 1 addition & 3 deletions www/_styles/_css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ section {
display: flex;
justify-content: center;
align-items: center;

height: 100vh;
}

Expand All @@ -83,8 +83,6 @@ body {

font-family: 'Montserrat', 'Segoe UI', Tahoma, sans-serif;
margin: 0 auto;

width: 60%;
}

ul {
Expand Down
26 changes: 26 additions & 0 deletions www/backend/routes/index/index.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@
top: -20px;
}

.red-section-block {
display: flex;
flex-direction: column;

background-color: var(--primary-color-01);
}

.companies-list {
display: flex;
flex-direction: row;
}

.companies-list li {
margin: 10px;
}

@media (max-width: 600px) {
#contactForm {
display: flex;
Expand Down Expand Up @@ -158,6 +174,16 @@
</div>
</div>
</section>

<section class="red-section-block">
<h2 style="color: #FFFFFF;"><?= $GLOBALS["locale"]["sections"]["companiestrustus"] ?></h2>
<ul class="companies-list">
<li><img width="300" height="64" src="_assets/brusnika-logo.png"></li>
<li><img width="96" height="64" src="_assets/atom-logo.png"></li>
<li><img width="128" height="76" src="_assets/securenet.png"></li>
</ul>
</section>

<section>
<a name="form"></a>
<div class="description-block offer-block" id="contactForm">
Expand Down
11 changes: 11 additions & 0 deletions www/backend/routes/user/user.ctrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@
}
break;
}

case "application": {
Renderer::includeTemplate("frontend/components/layout.php", [
"layout_path" => ROUTE_ROOT . "user/user.view.php",
"layout_data" => [
"category" => $params['category'],
"footerShow" => false,
]
]);
break;
}
}
} else {
Renderer::includeTemplate("frontend/components/layout.php", [
Expand Down
24 changes: 22 additions & 2 deletions www/backend/routes/user/user.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,26 @@
</form>
<?php
}

case "application": { ?>
<section>
<?php if ($_SERVER["REQUEST_METHOD"] != "POST") { ?>
<style>
.application-form {
padding: 20px;
border-radius: 10px;
box-shadow: 0px 1px 23px 0px rgba(34, 60, 80, 0.3);
}
</style>

<form class="application-form" action="/" method="post" >
<input type="text" placeholder="<?= $GLOBALS["locale"]["userPage"][""] ?>">
</form>
<?php } else { ?>

<?php } ?>
</section>
<?php }
}
} else { ?>
<section class="user-info">
Expand Down Expand Up @@ -187,10 +207,10 @@
<div id="appInfo" class="lk-block" style="display: none;">
<div class="buttons-block">
<h2><?= $GLOBALS["locale"]["titles"]["applicationsTitle"] ?></h2>
<button class="small-primary-button">
<a href="/user/application" class="small-primary-button">
<svg viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <title>plus-circle</title> <desc>Created with Sketch Beta.</desc> <defs> </defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"> <g id="Icon-Set-Filled" sketch:type="MSLayerGroup" transform="translate(-466.000000, -1089.000000)" fill="#ffffff"> <path d="M488,1106 L483,1106 L483,1111 C483,1111.55 482.553,1112 482,1112 C481.447,1112 481,1111.55 481,1111 L481,1106 L476,1106 C475.447,1106 475,1105.55 475,1105 C475,1104.45 475.447,1104 476,1104 L481,1104 L481,1099 C481,1098.45 481.447,1098 482,1098 C482.553,1098 483,1098.45 483,1099 L483,1104 L488,1104 C488.553,1104 489,1104.45 489,1105 C489,1105.55 488.553,1106 488,1106 L488,1106 Z M482,1089 C473.163,1089 466,1096.16 466,1105 C466,1113.84 473.163,1121 482,1121 C490.837,1121 498,1113.84 498,1105 C498,1096.16 490.837,1089 482,1089 L482,1089 Z" id="plus-circle" sketch:type="MSShapeGroup"> </path> </g> </g> </g></svg>
<p><?= $GLOBALS["locale"]["userPage"]["account"]["createApplication"] ?></p>
</button>
</a>
</div>

<div>
Expand Down
3 changes: 3 additions & 0 deletions www/data/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
"aboutusmainDescription5": "PR and Corporate Communications:",
"aboutussecondDescription5": "Management of public relations, event organization, media interaction, and crisis communication management."
},
"sections": {
"companiestrustus": "COMPANY TRUST US"
},
"userMenu": {
"personalCabinet": "Personal cabinet",
"admin": "Admin",
Expand Down
3 changes: 3 additions & 0 deletions www/data/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
"aboutusmainDescription5": "PR и Корпоративные Коммуникации:",
"aboutussecondDescription5": "Управление общественными связями, организация мероприятий, взаимодействие со СМИ и кризисное коммуникационное управление."
},
"sections": {
"companiestrustus": "КОМПАНИИ КОТОРЫЕ НАМ ДОВЕРЯЮТ"
},
"userMenu": {
"personalCabinet": "Личный кабинет",
"admin": "Админ",
Expand Down
2 changes: 1 addition & 1 deletion www/frontend/components/elems/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
window.addEventListener("scroll", function(event) {
if (document.body.scrollTop > 80
|| document.documentElement.scrollTop > 80) {
document.querySelector(".navigation").style.backgroundColor = "rgba(255, 255, 255, 0.9);";
document.querySelector(".navigation").style.backgroundColor = "rgb(0 0 0 / 30%)";
document.querySelector(".navigation").style.backdropFilter = "blur(10px)";
} else {
document.querySelector(".navigation").style.backgroundColor = "transparent";
Expand Down
17 changes: 16 additions & 1 deletion www/includes/wtframework/database/db_connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,22 @@
);
');
$stmt->execute();


/* Creating admin role */
$stmt = $GLOBALS["dbAdapter"]->prepare('INSERT INTO `role`(`name`, `admin_right`, `applications_list`) VALUES(\'administrator\', \'1\', \'1\')');
$stmt->execute();

$stmt = $GLOBALS["dbAdapter"]->prepare('INSERT INTO `role`(`name`, `admin_right`, `applications_list`) VALUES(\'administrator\', \'0\', \'1\')');
$stmt->execute();

/* Applications statuses */
$stmt = $GLOBALS["dbAdapter"]->prepare('INSERT INTO `applications_statuses`(`name`, `color`) VALUES(\'waiting\', \'#ffd500\')');
$stmt->execute();
$stmt = $GLOBALS["dbAdapter"]->prepare('INSERT INTO `applications_statuses`(`name`, `color`) VALUES(\'desclined\', \'#FF0000\')');
$stmt->execute();
$stmt = $GLOBALS["dbAdapter"]->prepare('INSERT INTO `applications_statuses`(`name`, `color`) VALUES(\'success\', \'#00FF00\')');
$stmt->execute();

} catch (mysqli_sql_exception $databaseException) {
return;
}

0 comments on commit a0a41a4

Please sign in to comment.