Commit 8893bf63 authored by Шакарим Сапа's avatar Шакарим Сапа

Merge remote-tracking branch 'origin/master'

parents ffb9b1da 5e4cf68c
...@@ -37,16 +37,10 @@ class SiteController extends Controller ...@@ -37,16 +37,10 @@ class SiteController extends Controller
]; ];
} }
/** public function actionError()
* @inheritdoc
*/
public function actions()
{ {
return [ $this->layout = "clear";
'error' => [ return $this->render('error');
'class' => 'yii\web\ErrorAction',
],
];
} }
public function actionLogin() public function actionLogin()
......
<?php
use yii\helpers\Html;
use backend\assets\AppAsset;
AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="ru">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<title>Произошла какая-то ошибка</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
<?= Html::csrfMetaTags() ?>
<?php $this->head() ?>
<?php echo $this->render('head')?>
</head>
<body>
<?php $this->beginBody() ?>
<?=$content?>
<?php $this->endBody() ?>
<?php echo $this->render('foot')?>
</body>
</html>
<?php $this->endPage() ?>
\ No newline at end of file
<?php <?php
use yii\helpers\Html; use yii\helpers\Html;
use common\models\Settings;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $name string */ /* @var $name string */
/* @var $message string */ /* @var $message string */
/* @var $exception Exception */ /* @var $exception Exception */
$this->title = $name;
?> ?>
<div class="site-error"> <!-- begin #page-loader -->
<div id="page-loader" class="fade in"><span class="spinner"></span></div>
<!-- end #page-loader -->
<h1><?= Html::encode($this->title) ?></h1> <!-- begin #page-container -->
<div id="page-container" class="fade">
<div class="alert alert-danger"> <!-- begin error -->
<?= nl2br(Html::encode($message)) ?> <div class="error">
<div class="error-code m-b-10">404 <i class="fa fa-warning"></i></div>
<div class="error-content">
<div class="error-message">Произошла какая-то ошибка</div>
<div class="error-desc m-b-20">
Страница не существует или у вас нет прав для ее просмотра.<br />
Проверьте введенный URL-адрес страницы или обратитесь в Службу технической поддержки для решения данного вопроса
<?=Html::a(Settings::getValue('content-support-email'), 'mailto:'.Settings::getValue('content-support-email'))?>
</div> </div>
<div>
<p> <a href="/" class="btn btn-success">Вернуться на главную страницу</a>
The above error occurred while the Web server was processing your request. </div>
</p> </div>
<p> </div>
Please contact us if you think this is a server error. Thank you. <!-- end error -->
</p>
</div> </div>
<!-- end page container -->
...@@ -113,59 +113,7 @@ WidgetAssetBundle::register($this); ...@@ -113,59 +113,7 @@ WidgetAssetBundle::register($this);
</section> </section>
<?php endif;*/?> <?php endif;*/?>
<div class="tr_foot"></div> <?php echo $this->render('@app/views/layouts/footer'); ?>
<footer>
<div class="container">
<div class="row">
<div class="col-md-4 col-xs-4 col-sm-12">
<a href="mailto:info@task-on.com" class="foot_mail">info@task-on.com</a>
</div>
<div class="col-md-4 col-xs-4 col-sm-12"><a href="#zvonok_form" class="zvonok_bt popup-form"><span>Заказать звонок</span></a></div>
<div class="col-md-4 col-xs-4 col-sm-12">
<!--<div class="phone_hover_foot">Стоимость звонка 0 руб,<br> в том числе с мобильного</div>-->
<span class="foot_phone">8-495-749-29-69</span>
</div>
</div>
<div class="footbottom_line">
<div class="row">
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="foot_logo">
<img src="/images/foot_logo.png" height="51" width="192" alt="">
</div>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
<ul class="social_link">
<li><a href="#" class="soc_item"><i class="fa fa-vk"></i></a></li>
<li><a href="#" class="soc_item"><i class="fbicon"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-youtube"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-instagram"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" class="soc_item"><i class="gplusicon"></i></a></li>
</ul>
</div>
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div>
<div class="copyring">Powered by Taskon <br> Собственная разработка Арт Проект</div>
</div>
</div>
</div>
</div>
</footer>
<div class="hidden">
<div id="zvonok_form" class="popup">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<span class="popup__title">Заказать звонок</span>
<span class="popup__subtittle">Чтобы мы могли вам перезвонить укажите свой номер телефона:</span>
<form class="valid_form">
<input type="text" class="input_st field-input required alphanumeric" placeholder="Ваше имя">
<input type="tel" class="input_st field-input required email" placeholder="Ваш телефон">
<button class="save-button popup_bt_send">Заказать звонок</button>
</form>
</div>
<?php echo \common\modules\users\widgets\LoginWidget::widget(); ?>
<?php echo \common\modules\users\widgets\RegistrationWidget::widget(); ?>
</div>
...@@ -5,22 +5,9 @@ ...@@ -5,22 +5,9 @@
WidgetAssetBundle::register($this); WidgetAssetBundle::register($this);
?> ?>
<section class="ks_header">
<div class="container"> <?=$this->render('@frontend/views/layouts/header-school-auth')?>
<div class="row">
<div class="col-md-5 col-xs-7 col-sm-12">
<div class="ball-block">Накоплено баллов:
<span class="col-ball">0</span>
<a href="#" class="ball-link">Как увеличить?</a>
<div class="ball_hover">Текст как увеличить,<br> текст как увеличить,</div>
</div>
</div>
<div class="col-md-5 col-md-offset-2 col-xs-5 col-sm-12">
<?php echo \common\modules\users\widgets\UserBoxWidget::widget() ?>
</div>
</div>
</div>
</section>
<section class="les_list_top" style="background: url(<?php echo $model->getUrl($model->image);?>) no-repeat center center; background-size: 100% auto;"> <section class="les_list_top" style="background: url(<?php echo $model->getUrl($model->image);?>) no-repeat center center; background-size: 100% auto;">
<div class="ls_top_over"> <div class="ls_top_over">
<div class="container"> <div class="container">
...@@ -76,46 +63,5 @@ ...@@ -76,46 +63,5 @@
<?php endif;?> <?php endif;?>
</div> </div>
</section> </section>
<footer>
<div class="container">
<div class="footbottom_line"> <?php echo $this->render('@app/views/layouts/footer-short'); ?>
<div class="row"> \ No newline at end of file
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="foot_logo">
<img src="/images/foot_logo.png" height="51" width="192" alt="">
</div>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
<ul class="social_link">
<li><a href="#" class="soc_item"><i class="fa fa-vk"></i></a></li>
<li><a href="#" class="soc_item"><i class="fbicon"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-youtube"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-instagram"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" class="soc_item"><i class="gplusicon"></i></a></li>
</ul>
</div>
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div>
<div class="copyring">Powered by Taskon <br> Собственная разработка Арт Проект</div>
</div>
</div>
</div>
</div>
</footer>
<div class="hidden">
<div id="zvonok_form" class="popup">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<span class="popup__title">Заказать звонок</span>
<span class="popup__subtittle">Чтобы мы могли вам перезвонить укажите свой номер телефона:</span>
<form class="valid_form">
<input type="text" class="input_st field-input required alphanumeric" placeholder="Ваше имя">
<input type="tel" class="input_st field-input required email" placeholder="Ваш телефон">
<button class="save-button popup_bt_send">Заказать звонок</button>
</form>
</div>
<?php echo \common\modules\users\widgets\LoginWidget::widget(); ?>
<?php echo \common\modules\users\widgets\RegistrationWidget::widget(); ?>
</div>
...@@ -8,22 +8,9 @@ use common\modules\testings\models\Passing; ...@@ -8,22 +8,9 @@ use common\modules\testings\models\Passing;
WidgetAssetBundle::register($this); WidgetAssetBundle::register($this);
?> ?>
<section class="ks_header">
<div class="container"> <?=$this->render('@frontend/views/layouts/header-school-auth')?>
<div class="row">
<div class="col-md-5 col-xs-7 col-sm-12">
<div class="ball-block">Накоплено баллов:
<span class="col-ball">0</span>
<a href="#" class="ball-link">Как увеличить?</a>
<div class="ball_hover">Текст как увеличить,<br> текст как увеличить,</div>
</div>
</div>
<div class="col-md-5 col-md-offset-2 col-xs-5 col-sm-12">
<?php echo UserBoxWidget::widget() ?>
</div>
</div>
</div>
</section>
<section class="video-container"> <section class="video-container">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
...@@ -206,46 +193,5 @@ WidgetAssetBundle::register($this); ...@@ -206,46 +193,5 @@ WidgetAssetBundle::register($this);
</div> </div>
</div> </div>
</section> </section>
<footer>
<div class="container">
<div class="footbottom_line"> <?php echo $this->render('@app/views/layouts/footer-short'); ?>
<div class="row"> \ No newline at end of file
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="foot_logo">
<img src="/images/foot_logo.png" height="51" width="192" alt="">
</div>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
<ul class="social_link">
<li><a href="#" class="soc_item"><i class="fa fa-vk"></i></a></li>
<li><a href="#" class="soc_item"><i class="fbicon"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-youtube"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-instagram"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" class="soc_item"><i class="gplusicon"></i></a></li>
</ul>
</div>
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div>
<div class="copyring">Powered by Taskon <br> Собственная разработка Арт Проект</div>
</div>
</div>
</div>
</div>
</footer>
<div class="hidden">
<div id="zvonok_form" class="popup">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<span class="popup__title">Заказать звонок</span>
<span class="popup__subtittle">Чтобы мы могли вам перезвонить укажите свой номер телефона:</span>
<form class="valid_form">
<input type="text" class="input_st field-input required alphanumeric" placeholder="Ваше имя">
<input type="tel" class="input_st field-input required email" placeholder="Ваш телефон">
<button class="save-button popup_bt_send">Заказать звонок</button>
</form>
</div>
<?php echo \common\modules\users\widgets\LoginWidget::widget(); ?>
<?php echo \common\modules\users\widgets\RegistrationWidget::widget(); ?>
</div>
...@@ -5,14 +5,16 @@ namespace common\modules\testings\controllers; ...@@ -5,14 +5,16 @@ namespace common\modules\testings\controllers;
use Yii; use Yii;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
use yii\web\Response; use yii\web\Response;
use yii\filters\AccessControl;
use common\components\FrontendController;
use common\models\Settings; use common\models\Settings;
use common\modules\testings\models\Test; use common\modules\testings\models\Test;
use common\modules\testings\models\Passing; use common\modules\testings\models\Passing;
use common\modules\testings\models\Question; use common\modules\testings\models\Question;
use common\modules\testings\models\QuestionPassing; use common\modules\testings\models\QuestionPassing;
class TestController extends \common\components\BaseController class TestController extends FrontendController
{ {
public static function actionsTitles() public static function actionsTitles()
{ {
...@@ -27,6 +29,23 @@ class TestController extends \common\components\BaseController ...@@ -27,6 +29,23 @@ class TestController extends \common\components\BaseController
); );
} }
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'user' => 'user',
'only' => ['info', 'pass', 'finish-test', 'set-answer', 'gen-pass', 'statistic', 'send-not-attempt'],
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],
];
}
public function actionInfo($id) public function actionInfo($id)
{ {
$model = $this->findModel($id); $model = $this->findModel($id);
......
...@@ -33,6 +33,8 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter ...@@ -33,6 +33,8 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
const PAGE_SIZE = 10; const PAGE_SIZE = 10;
const CACHE_SCORE = 'user.scores.';
const OCCUPATION_CHIEF_IT = 1; const OCCUPATION_CHIEF_IT = 1;
const OCCUPATION_MANAGER_IT = 2; const OCCUPATION_MANAGER_IT = 2;
const OCCUPATION_CREATOR = 3; const OCCUPATION_CREATOR = 3;
...@@ -357,6 +359,23 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter ...@@ -357,6 +359,23 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
return "Пользователи"; return "Пользователи";
} }
public function clearScoreCache()
{
Yii::$app->cache->delete(self::CACHE_SCORE . $this->id);
}
public function getScores()
{
$score = Yii::$app->cache->get(self::CACHE_SCORE . $this->id);
if($score === false)
{
Yii::$app->cache->set(self::CACHE_SCORE . $this->id, $score);
}
return $score;
}
public function getCustomName($user = null) public function getCustomName($user = null)
{ {
......
...@@ -75,7 +75,7 @@ return [ ...@@ -75,7 +75,7 @@ return [
'name' => '_frontendIdentity' 'name' => '_frontendIdentity'
], ],
'enableAutoLogin' => true, 'enableAutoLogin' => true,
'loginUrl' => ['/site/login'], 'loginUrl' => ['/school'],
], ],
'support' => [ 'support' => [
'class' => 'yii\web\User', 'class' => 'yii\web\User',
......
...@@ -162,7 +162,7 @@ class SiteController extends FrontendController ...@@ -162,7 +162,7 @@ class SiteController extends FrontendController
echo json_encode(['errors' => []]); echo json_encode(['errors' => []]);
} }
$this->redirect(array("/school/course/index")); $this->redirect(['/support']);
} }
else else
{ {
......
...@@ -57,4 +57,7 @@ use common\modules\bids\models\Bid; ...@@ -57,4 +57,7 @@ use common\modules\bids\models\Bid;
<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>
</div> </div>
<?php echo \common\modules\users\widgets\LoginWidget::widget(); ?>
<?php echo \common\modules\users\widgets\RegistrationWidget::widget(); ?>
</div> </div>
\ No newline at end of file
<footer>
<div class="container">
<div class="footbottom_line">
<div class="row">
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="foot_logo">
<img src="/images/foot_logo.png" height="51" width="192" alt="">
</div>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
<?php echo $this->render('block/social'); ?>
</div>
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div>
<div class="copyring">Powered by Taskon <br> Собственная разработка Арт Проект</div>
</div>
</div>
</div>
</div>
</footer>
<div class="up-button-container">
<div class="up-button"></div>
</div>
<?php echo $this->render('block/callback'); ?>
\ No newline at end of file
<header>
<div class="container">
<div class="row">
<div class="col-md-2 col-xs-12 col-sm-12">
<a href="http://mikulin.cz/project/artproject/" class="logo_testing">
<img src="images/logo.png" height="34" width="125" alt="">
</a>
</div>
<div class="col-md-5 col-md-offset-1 col-xs-7 col-sm-12">
<div class="ball-block_testing">Накоплено баллов:
<span class="col-ball_testing">99 999</span>
<a href="#" class="ball-link_testing">Как увеличить?</a>
<div class="ball_hover">Текст как увеличить,<br/> текст как увеличить,</div>
</div>
</div>
<div class="col-md-3 col-md-offset-1 col-xs-5 col-sm-12">
<div class="prof_block_testing">
<span class="prof_name_testing"><?php echo Yii::$app->user->identity->name; ?></span>
<?php echo \yii\helpers\Html::a('Выход', ['/users/user/logout']); ?>
</div>
</div>
</div>
</div>
</header>
\ No newline at end of file
<section class="ks_header">
<div class="container">
<div class="row">
<div class="col-md-5 col-xs-7 col-sm-12">
<div class="ball-block">Накоплено баллов:
<span class="col-ball"><?=\Yii::$app->user->identity->getScores();?></span>
<a href="#" class="ball-link">Как увеличить?</a>
<div class="ball_hover">Текст как увеличить,<br> текст как увеличить,</div>
</div>
</div>
<div class="col-md-5 col-md-offset-2 col-xs-5 col-sm-12">
<?php echo \common\modules\users\widgets\UserBoxWidget::widget() ?>
</div>
</div>
</div>
</section>
\ No newline at end of file
...@@ -26,7 +26,7 @@ AppAsset::register($this); ...@@ -26,7 +26,7 @@ AppAsset::register($this);
<?php $this->beginBody() ?> <?php $this->beginBody() ?>
<?php echo (Yii::$app->user->isGuest) ? $this->render('header') : $this->render('header-auth'); // Добавить проверку на авторизацию и вывести другую шапку header-auth.php ?> <?php echo $this->render('header'); ?>
<?php echo $content ?> <?php echo $content ?>
......
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