Убрал смену языка, лоика редиректа вкабинет иформу авторизации, перенес плашку профиля

parent cc66f538
......@@ -882,7 +882,9 @@ footer {
.header-user a.annotation {
color: #0071BC;
}
.header-logout a.annotation {
color: #0071BC;
}
.header-user ul {
padding: 5px 10px 5px 10px;
left: 50px;
......
......@@ -2,7 +2,7 @@
.b-content__work
{
padding-top: 40px;
padding-top: 100px;
background: #FFFFFF;
}
......
/* Таблица стилей к странице редактирования профиля */
main {
transition: opacity 0.2s ease;
}
main.show {
pointer-events: none;
opacity: 0.7;
}
.connection.b-popup__window {
width: 460px;
}
.connection.b-popup__window .form-wrapp {
padding: 150px 2rem 2rem 2rem;
background-image: url('../img/icon-popup-connection.svg');
background-position: center 40px;
background-repeat: no-repeat;
background-size: auto 75px;
}
.connection.b-popup__window .form-wrapp h1 {
margin-bottom: 20px;
text-align: center;
}
.connection.b-popup__window .form-wrapp h1 + p.text {
text-align: center;
}
.l-content {
padding-top: 0;
}
.b-content__title {
padding-top: 85px;
height: 33ex;
background-color: #EAEFF1;
}
.b-content__title picture {
display: block;
margin: 0 auto;
width: 90px;
margin-bottom: 5px;
}
.b-content__title picture source {
}
.b-content__title picture img {
height: 90px;
width: 90px;
object-fit: cover;
border-radius: 50%;
}
.b-content__title p.lead {
margin-bottom: 10px;
text-align: center;
}
.b-content__title-settings {
text-align: center;
}
.b-content__title-settings .annotation {
color : #0071BC;
}
.b-content__title-settings .annotation:first-child {
margin-right: 30px;
}
.b-content__form {
}
.b-content__form .wrapp {
padding: 40px 0 50px;
}
.b-content__form-set {
margin-left: 25%;
margin-right: 25%;
}
.b-content__form-set .input__field {
font-weight: normal;
opacity: 0.7;
transition: opacity 0.2s ease;
}
.input-site {
margin: 1rem 0 1rem;
}
.b-content__form-set .input__field:focus {
opacity: 1;
}
.b-content__form-set-item-label {
width: 32%;
font-size: 0;
}
.b-content__form-set-item-label p.text {
display: inline-block;
margin-top: 1.5rem;
line-height: normal;
}
.b-content__form-set-item-label p.text,
.wrapp-button.submit {
width: 32%;
}
.b-content__form-set span.input {
font-size: 0;
width: 66.666666%;
}
.b-content__form-set .droplist-current:after {
width: 10px;
background-image: url('../img/icon-droplist-pointter-dark.svg');
}
.wrapp-button {
display: inline-block;
}
.show.wrapp-button[data-action]:after {
position: fixed;
top: 100px;
left: 0;
width: 100%;
display: block;
height: auto;
content: attr(data-action);
background-color: #39B54A;
padding: 15px 0;
font-family: 'RalewayBold', sans-serif;
color: #FFFFFF;
font-size: 0.8rem;
line-height: 1.625em;
text-align: center;
box-shadow: 1px 1px 15px -2px rgba(0,0,0,0.5);
z-index: 10000;
}
.wrapp-button.submit {
margin-left: 32%;
}
.wrapp-button.submit,
.wrapp-button.reset {
width: 32%;
}
.wrapp-button.reset {
text-align: right;
}
.b-content__form-set input[type='submit'] {
width: 80%;
}
.b-content__form-set input[type='reset'] {
border: none;
outline: none;
background: transparent;
color: #B3B3B3;
cursor: pointer;
transition: color 0.2s ease;
}
.b-content__form-set input[type='reset']:hover {
color: #7F6363;
}
.b-content__form-set .wrapp-button.delete {
margin-left: 32%;
display: block;
margin-top: 80px;
line-height: 46px;
}
.b-content__form-set .wrapp-button.delete button {
display: block;
margin: 0 auto;
border: none;
outline: none;
background-color: transparent;
color: #FF3B3B;
cursor: pointer;
}
.b-content__form-set .wrapp-button.delete button:hover {
color: #A51515;
}
@media (max-width: 1025px) {
section .wrapp {
padding-left: 10px;
padding-right: 10px;
}
}
@media (max-width: 768px) {
.b-content__title {
padding-top: 120px;
}
.b-content__form-set {
margin-left: 10%;
margin-right: 10%;
}
.b-content__form-set .wrapp-button.delete {
margin-top: 60px;
}
.b-content__form-set .wrapp-button.delete button {
margin: 0;
}
}
@media (max-width: 550px) {
.b-content__title {
padding-top: 80px;
}
.b-content__form .wrapp {
padding: 10px 10px 30px;
}
.b-content__form-set {
margin-right: 0;
margin-left: 0;
}
.b-content__form-set-item-label p.text {
display: block;
width: 100%;
line-height: normal;
margin-top: 20px;
}
.b-content__form-set span.input {
margin-top: 10px;
width: 100%;
}
.wrapp-button.submit {
margin-left: 0;
width: 49%;
}
.b-content__form-set .wrapp-button.delete {
margin-left: 0;
margin-top: 50px;
}
.b-content__form-set .wrapp-button.delete button {
margin: 0 auto;
}
}
\ No newline at end of file
......@@ -423,6 +423,9 @@ $(document).ready(function(){
var lang = $('.header-lang').attr('lang');
var newLocation = '/cabinet/';
newLocation = '/'+'ru'+newLocation;
/*
if (location.pathname == '/') {
if(data.type == 'support') {
......@@ -436,6 +439,7 @@ $(document).ready(function(){
} else {
newLocation = location.pathname;
}
*/
document.cookie = data.token;
location.href = newLocation;
......
......@@ -30,7 +30,6 @@ use App\Action\Common;
use App\Authentication\UserService;
use App\Entity\User;
use App\Model\Users;
use App\Model\Sites;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\HtmlResponse;
......@@ -55,8 +54,6 @@ class Profile extends Common
/** @var Users $usersModel */
$usersModel = $this->container->get(Users::class);
$sitesModel = $this->container->get(Sites::class);
/** @var UserService $auth */
$auth = $this->container->get(UserService::class);
......@@ -73,30 +70,6 @@ class Profile extends Common
if (isset($data['currency'])) {
$result = false;
/*
if (isset($data['currency']) && !$data['currency']) {
unset($data['currency']);
} else {
$userFromDb->setCurrencyCode($data['currency']);
}
*/
/** @var User $newUserData */
/*
$validator = new \App\Validator\User($hydrator);
if ($validator->isValid($userFromDb)) {
$result = $usersModel->save($userFromDb);
if ($result) {
$msg['text'] = 'success';
} else {
$msg['text'] = 'db error';
}
} else {
$result = false;
$msg['text'] = $validator->getMessages();
}
*/
}
else
{
......@@ -137,7 +110,6 @@ class Profile extends Common
$userId = $auth->getIdentity()->getId();
$user = $usersModel->findById($userId);
$sites = $sitesModel->findByUserId($userId);
$currencyModel = $this->container->get(\App\Model\Currencies::class);
$currencies = array();
......@@ -148,7 +120,6 @@ class Profile extends Common
$response = new HtmlResponse($this->template->render('app::user/profile', [
'user' => $user,
'sites' => $sites,
'lang' => $request->getAttribute('layoutInfo')->getLang(),
'currencies' => $currencies,
'currency' => ['code' => $currentCurencyCode, 'name' => $currencies[$currentCurencyCode]]
......
......@@ -202,7 +202,8 @@ class Authorization
$this->layout->setTemplate('layout/default');
}
$body = $this->renderer->render('error::unauthorized', ['lang' => $request->getAttribute('layoutInfo')->getLang()]);
//$body = $this->renderer->render('error::unauthorized', ['lang' => $request->getAttribute('layoutInfo')->getLang()]);
$body = $this->renderer->render('app::index', ['lang' => $request->getAttribute('layoutInfo')->getLang()]);
$response = new HtmlResponse($body);
}
......
......@@ -74,6 +74,10 @@ class Transactions extends Common
. ' ORDER BY EventDate desc';
$res = $adapter->query($sql, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
if (count($res) == 0) {
return null;
}
$stats = array(
'period' => [],
'localmoney' => [],
......
......@@ -44,7 +44,7 @@ class Locales
const LOCALE_UA = 'uk_UA';
const LOCALE_FR = 'fr_FR';
const DEFAULT_LANG = self::LANG_EN;
const DEFAULT_LANG = self::LANG_RU;
const DEFAULT_LANG_ADMIN = self::LANG_RU;
protected $available = [
......
......@@ -84,6 +84,7 @@ $system_link = $this->url('adm.system.actions');
?>
<?php /* ?>
<section class="b-content__title">
<div class="wrapp">
<!-- Вход произведен -->
......@@ -97,6 +98,7 @@ $system_link = $this->url('adm.system.actions');
</p>
</div>
</section>
<?php */ ?>
<?php if($error): ?>
......
......@@ -29,6 +29,7 @@ $this->headScript()
;
$this->headLink()
->appendStylesheet('/css/styles-feeds-stat.css')
->appendStylesheet('/css/styles-set-prof.css')
;
......
......@@ -57,13 +57,8 @@ $lang = $layoutInfo ? $layoutInfo->getLang() : 'en';
</head>
<body>
<?php
$urlHome = $this->url(
in_array($identityRole, [
\App\Acl\Roles::ROLE_ADMIN,
\App\Acl\Roles::ROLE_MANAGER]) ?
'adm.index' :
'home',
['lang' => $lang]);
//$urlHome = $this->url(in_array($identityRole, [\App\Acl\Roles::ROLE_ADMIN,\App\Acl\Roles::ROLE_MANAGER]) ?'adm.index' :'home',['lang' => $lang]);
//$urlHome = $this->url('user.cabinet',['lang' => $lang]);
?>
......@@ -84,47 +79,47 @@ $urlHome = $this->url(
<li><a href="<?= $this->url('faq', ['lang' => $lang]) ?>" title="" class="text bold"><?= _t("Помощь") ?></a></li>
<li><a href="<?= $this->url('contacts', ['lang' => $lang]) ?>" title="" class="text bold"><?= _t("Контакты") ?></a></li>
</ul>
<?php
if ($identity ) :
$gravatar = $this->gravatar($identity->getEmail());
$gravatar->setDefaultImg(\Zend\View\Helper\Gravatar::DEFAULT_IDENTICON);
$sxml = new SimpleXMLElement(substr($gravatar, 0, -1) . '/>');
$src = $sxml['src'];
?>
<!-- Вход произведен -->
<div class="header-user col sm-3 order-xs-1">
<picture>
<img src="/img/bg-img-logo.svg" alt="No logo">
</picture>
<?php
if ($identity ) :
$gravatar = $this->gravatar($identity->getEmail());
$gravatar->setDefaultImg(\Zend\View\Helper\Gravatar::DEFAULT_IDENTICON);
$sxml = new SimpleXMLElement(substr($gravatar, 0, -1) . '/>');
$src = $sxml['src'];
?>
<!-- Вход произведен -->
<div class="header-user col sm-3 order-xs-1">
<picture>
<img src="/img/bg-img-logo.svg" alt="No logo">
</picture>
<?php
//$urlCabinet = $this->url(in_array($identityRole, [\App\Acl\Roles::ROLE_ADMIN,\App\Acl\Roles::ROLE_MANAGER]) ? 'adm.index' : 'user.cabinet', ['lang' => $lang]);
//$urlCabinet = $this->url('user.cabinet',['lang' => $lang]);
$urlCabinet = $this->url('user.cabinet.profile',['lang' => $lang]);
?>
<a href="<?= $urlCabinet ?>" class="annotation" title="<?= _t("Мой кабинет") ?>"><?= $identity->getEmail() ?></a>
</div>
<div class="header-logout col sm-2 order-xs-1">
<a href="<?= $this->url('logout', ['lang' => $lang]) ?>" title="<?= _t("Выход") ?>" class="annotation"><?= _t("Выход") ?></a>
</div>
<?php else : ?>
<!-- Вход не был произведен -->
<?php /* ?>
<p class="header-register col sm-3 order-xs-4 xs-2">
<a href="#" title="<?= _t("Вход") ?>" class="text bold login-button button-open"><?= _t("Вход") ?></a>
</p>
<?php */ ?>
<div class="col sm-2 order-xs-1"></div>
<?php endif; ?>
<?php /* ?>
<?= $this->partial('app::partial/language', [
'lang' => $lang,
'locales' => $layoutInfo->getLocales(),
'router' => $layoutInfo->getRouter(),
'request' => $layoutInfo->getRequest()
]); ?>
<?php */ ?>
<?php
/*
$urlCabinet = $this->url(
in_array($identityRole, [
\App\Acl\Roles::ROLE_ADMIN,
\App\Acl\Roles::ROLE_MANAGER]) ?
'adm.index' :
'user.cabinet',
['lang' => $lang]);
*/
$urlCabinet = $this->url('user.cabinet',['lang' => $lang]);
?>
<a href="<?= $urlCabinet ?>" class="annotation" title="<?= _t("Мой кабинет") ?>"><?= $identity->getEmail() ?></a>
</div>
<?php else : /* ?>
<!-- Вход не был произведен -->
<p class="header-register col sm-3 order-xs-4 xs-2">
<a href="#" title="<?= _t("Вход") ?>" class="text bold login-button button-open"><?= _t("Вход") ?></a>
</p>
<?php */ endif; ?>
<?= $this->partial('app::partial/language', [
'lang' => $lang,
'locales' => $layoutInfo->getLocales(),
'router' => $layoutInfo->getRouter(),
'request' => $layoutInfo->getRequest()
]); ?>
</nav>
</header>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment