Registration popup

parent 0d7a4ce1
......@@ -20,7 +20,6 @@ class BaseForm extends \yii\widgets\ActiveForm
{
$this->model = $model;
$behaviors = $model->behaviors();
//die(print_r($behaviors));
$metaFlags = false;
......@@ -172,9 +171,11 @@ class BaseForm extends \yii\widgets\ActiveForm
break;
}
}
/*временная заплатка*/
$config['options'][] = '<div style="clear: both;"></div>';
/* **************** */
if($element != '</div>'){
/*временная заплатка*/
$config['options'][] = '<div style="clear: both;"></div>';
/* **************** */
}
}
unset($config['elements']);
if($metaFlags) {
......
......@@ -182,9 +182,9 @@ JS;
break;
}
}
/*временная заплатка*/
$config['options'][] = '<div style="clear: both;"></div>';
/* **************** */
/*временная заплатка*/
$config['options'][] = '<div style="clear: both;"></div>';
/* **************** */
}
unset($config['elements']);
......
......@@ -17,6 +17,7 @@ class WidgetAssetBundle extends AssetBundle
public $sourcePath = '@common/modules/school/assets';
public $css = [
'css/school.css',
'css/style_add.css',
];
public $js = [
'js/school.js',
......
......@@ -39,9 +39,6 @@ a.login_form_link, a.login_form_popup_link, a.reg_popup_link, a.reg_form_link {
margin-top: 20px;
display: block;
}
#login_form, #login_form_popup {
display:none;
}
.mfp-container {
height: auto;
}
......@@ -51,3 +48,16 @@ a.login_form_link, a.login_form_popup_link, a.reg_popup_link, a.reg_form_link {
.soc_item .fa, .fbicon:before, .gplusicon:before {
margin-top: 10px;
}
.popup_bt_send{
padding-top: 16px;
margin-left: 0px;
}
.registration_form input:not(:last-child) {
margin-bottom: 7px;
}
.registration_form .form-group {
margin-bottom: 7px !important;
}
.input_st {
margin-bottom: 12px !important;
}
.clear {
clear: both;
}
.support_form {
width: 760px;
padding: 30px;
padding-bottom: 40px;
color: #525252;
}
.popup_2 .popup__title {
font-size: 38px;
font-weight: bold;
color: #344555;
text-align: left;
}
.support_form_left {
width: 45%;
float: left;
padding-right: 15px;
}
.support_form_right {
width: 55%;
float: right;
padding-left: 15px;
}
.popup_2 p {
font-size: 17px;
color: #525252;
line-height: 22px;
font-weight: 400;
}
.support_form .support_block__link_pv {
margin-top: 10px;
}
.popup_2 input:not([type="radio"]):not([type="checkbox"]){
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-o-border-radius: 10px;
-ms-border-radius: 10px;
width: 100%;
}
.popup_2 input {
margin-bottom: 10px;
}
.popup_2 input:not(:last-child) {
margin-bottom: 30px;
}
.popup_2 .checkbox:not(checked) + label {
position: relative;
padding: 6px 0px 0px 28px;
margin-bottom: 30px;
}
.popup_2 label {
margin-bottom: 10px;
}
.support_form_left2 {
float: left;
width: 50%;
padding-right: 15px;
}
.support_form_right2 {
float: right;
width: 50%;
padding-left: 15px;
margin-bottom: 30px;
}
.popup_2 .sect_cont_form__textarea {
background-color: #f1f1f1;
height: 170px;
width: 100%;
line-height: 24px;
resize: none;
}
.file-upload_block_cs2 {
height: 170px;
background-color: #f8f8f8;
padding-top: 30px;
border: 2px solid #f1f1f1;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-o-border-radius: 10px;
-ms-border-radius: 10px;
}
.file-upload_block_cs2 .filename_cs {
background-color: #f8f8f8;
margin-bottom: 0px !important;
}
.button-lg {
padding-left: 30px;
padding-right: 30px;
width: auto;
}
.blog_form {
width: 820px;
padding: 30px;
padding-bottom: 40px;
color: #525252;
}
.blog_form_left {
width: 280px;
float: left;
padding-right: 18px;
}
.blog_form_right {
width: 340px;
float: left;
font-size: 15px;
}
.blog_form_right p {
font-size: 15px;
}
.blog_lmg {
float: right;
}
.blog_form_2 {
width: 670px;
padding: 30px;
padding-bottom: 40px;
color: #525252;
}
.blog_form_left50 {
float: left;
width: 50%;
padding-right: 15px;
}
.blog_form_right50 {
float: right;
width: 50%;
padding-left: 15px;
}
.registration_form {
width: 940px;
padding: 0;
color: #525252;
}
.popup__title2 {
display: block;
background-color: #3a4447;
padding: 30px;
font-size: 25px;
line-height: 30px;
color: #fff;
-moz-border-radius: 6px 6px 0 0;
-webkit-border-radius: 6px 6px 0 0;
-o-border-radius: 6px 6px 0 0;
-ms-border-radius: 6px 6px 0 0;
margin-top: -1px;
}
.validreg_form2 {
padding: 30px;
}
.registration_form .mfp-close {
color: #fff;
}
.registration_form_left {
width: 40%;
float: left;
padding-right: 15px;
}
.registration_form_right {
width: 60%;
float: right;
padding-left: 15px;
}
.save-button-lg {
height: 60px;
font-size: 24px;
margin-bottom: 30px;
}
.popup__title3 {
font-size: 25px;
line-height: 27px;
font-weight: bold;
margin-bottom: 18px;
display: block;
}
.registration_form p {
font-size: 16px;
color: #3c4755;
line-height: 27px;
font-weight: 400;
}
.registration_form input:not([type="radio"]):not([type="checkbox"]), select.input_st {
width: 100%;
}
.registration_form input:not(:last-child) {
margin-bottom: 20px;
}
.red_text {
color: #bb6e6e;
}
.registration_form_img img {
width: 100%;
}
.registration_form2 {
width: 700px;
}
.registration_form_left50 {
float: left;
width: 50%;
padding-right: 35px;
}
.registration_form_right50 {
float: right;
width: 50%;
padding-left: 35px;
}
.button_social a:hover {
opacity: 0.8;
}
.input_st_wr {
padding: 0 10px;
background: #F5F5F5;
border-radius: 50px;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
-o-border-radius: 50px;
-ms-border-radius: 50px;
margin-bottom: 20px;
}
.input_st_wr .input_st {
margin: 0;
}
@media only screen and (max-width: 992px) {
.registration_form, .blog_form_2, .blog_form, .support_form {
width: 100%;
height: auto;
}
.popup_2 .popup__title {
font-size: 32px;
}
}
@media only screen and (max-width: 820px) {
.blog_lmg {
display: none;
}
}
@media only screen and (max-width: 767px) {
.form_resp {
float: none;
width: 100%;
padding-left: 0;
padding-right: 0;
}
.support_form_right {
margin-bottom: 20px;
}
}
@media only screen and (max-width: 479px) {
.popup_2 .popup__title {
font-size: 22px;
}
.blog_form_right {
width: 100%;
}
}
.button_social p img{
margin-bottom: 5px;
}
\ No newline at end of file
......@@ -66,6 +66,7 @@ $(document).ready(function() {
});
$(".submit_form_reg_popup").on('click', function () {
alert(1);
$('#reg_form_popup').ajaxSubmit(optionsPopup);
return false;
});
......
......@@ -31,12 +31,12 @@ class CourseController extends BaseController
$modelUser = new User();
$modelLogin = new LoginForm();
$form = new \common\components\BaseForm('/common/modules/users/forms/RegistrationUserForm', $modelUser);
$formPopup = new \common\components\BaseForm('/common/modules/users/forms/RegistrationUserPopupForm', $modelUser);
$formLogin = new \common\components\BaseForm('/common/modules/users/forms/LoginForm', $modelLogin);
//$form = new \common\components\BaseForm('/common/modules/users/forms/RegistrationUserForm', $modelUser);
//$formLogin = new \common\components\BaseForm('/common/modules/users/forms/LoginForm', $modelLogin);
$formLoginPopup = new \common\components\BaseForm('/common/modules/users/forms/LoginPopupForm', $modelLogin);
return $this->render('index', ['dataProvider' => $dataProvider, 'form' => $form->out, 'formLogin' => $formLogin->out,
return $this->render('index', ['dataProvider' => $dataProvider,
'formPopup' => $formPopup->out, 'formLoginPopup' => $formLoginPopup->out]);
}
......
......@@ -90,7 +90,7 @@ WidgetAssetBundle::register($this);
</div>
</div>
</section>
<?php if (Yii::$app->user->isGuest):?>
<?php /*if (Yii::$app->user->isGuest):?>
<section class="sh_ft">
<div class="container">
<div class="row">
......@@ -111,7 +111,7 @@ WidgetAssetBundle::register($this);
</div>
</div>
</section>
<?php endif;?>
<?php endif;*/?>
<div class="tr_foot"></div>
<footer>
......@@ -163,17 +163,26 @@ WidgetAssetBundle::register($this);
<button class="save-button popup_bt_send">Заказать звонок</button>
</form>
</div>
<div id="reg_form" class="popup">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<?php
echo $formPopup;
?>
<!--<div id="reg_form" class="popup">
<?php
echo $formLoginPopup;
/*echo $formLoginPopup;
?>
<?php echo \common\modules\eauth\widgets\SocialWidget::widget(['action' => '/site/login']); ?>
<?php echo \common\modules\eauth\widgets\SocialWidget::widget(['action' => '/site/login']); */?>
</div>
</div>-->
<!-- add 00.02.16 -->
<div id="registration_form" class="popup registration_form">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<span class="popup__title2">Регистрация на курс <br>Лекции для менеджеров it-отрасли</span>
<?php
echo $formPopup;
?>
</div>
<div id="registration_form2" class="popup registration_form registration_form2">
<span class="popup__title2">Войти как пользователь</span>
<?php echo $formLoginPopup;?>
</div>
</div>
......
......@@ -18,7 +18,7 @@
<?php endif;?>
<div class="kurs_foot clearfix">
<?php if($model->type == Courses::TYPE_DV && Yii::$app->user->isGuest):?>
<a href="#reg_form" class="kurs_bt popup-form">Предварительная регистрация</a>
<a href="#registration_form" class="kurs_bt popup-form">Предварительная регистрация</a>
<?php else:?>
<a href="<?php echo Url::toRoute(['/school/course/view', 'id' => $model->id]);?>" class="kurs_bt">Подробнее</a>
<?php endif;?>
......
......@@ -122,7 +122,6 @@ class UserController extends \common\components\BaseController {
if (isset($_POST['User'])) {
$model->attributes = $_POST['User'];
if ($model->validate()) {
$password = $model->password;
$model->password = Yii::$app->getSecurity()->generatePasswordHash($model->password);
......
<?php
$elements = [
'title_login' => '<span class="popup__title">Авторизация</span>',
'open_form_login' => '<div class="registration_form_left form_resp">',
'errors_login' => '<div class="errors_login_popup"></div>',
'username' => ['type' => 'text', 'placeholder'=>"E-mail", 'options'=>['label'=>false],
'inputOptions'=>['class'=>'input_st field-input required alphanumeric']],
'inputOptions'=>['class'=>'input_st field-input required email']],
'password' => ['type' => 'password', 'placeholder'=>"Пароль", 'options'=>['label'=>false],
'inputOptions'=>['class'=>'input_st field-input required alphanumeric']],
'inputOptions'=>['class'=>'input_st field-input required email']],
'button_submit' => '<a href="javascript:void(0)" class="submit_form_login_popup">
<div class="save-button sh_bt_send">
<div class="save-button popup_bt_send save-button-lg">
Войти
</div>
</a>',
'registration_link' => '<a class="reg_popup_link" href="javascript:void(0)">Регистрация</a>',
];
'close_form_login' => '</div>',
'soc_buttons' =>'<div class="registration_form_right50 form_resp">
<p>Войти через</p>
<br>
<div class="button_social">
<p>
<a href=""><img src="images/button_g.jpg" height="39" width="186" alt=""></a>
</p>
<p>
<a href=""><img src="images/button_vk.jpg" height="39" width="186" alt=""></a>
</p>
<p>
<a href=""><img src="images/button_f.jpg" height="39" width="186" alt=""></a>
</p>
</div>
</div>
<div class="clear"></div>
<br>
<p>Если у Вас еще нет аккаунта <a href="#registration_form" class="popup-form">Зарегистрируйтесь.</a></p>'
];
return [
'activeForm'=>[
'id' => 'login_form_popup',
'options' => [
'enctype' => 'multipart/form-data'
'enctype' => 'multipart/form-data',
'class' =>'validreg_form2',
],
],
'elements' => $elements,
......
......@@ -2,45 +2,57 @@
use common\modules\users\models\User;
$elements = [
'title_reg' => '<span class="popup__title">Регистрация</span>',
'open_form_reg' => '<div class="registration_form_left form_resp">',
'errors_reg' => '<div class="errors-reg_popup"></div>',
'name' => ['type' => 'text', 'placeholder'=>"Ваше имя*", 'options'=>['label'=>false],
'inputOptions'=>['class'=>'input_st field-input required alphanumeric']],
'email' => ['type' => 'text', 'placeholder'=>"E-mail*", 'options'=>['label'=>false],
'inputOptions'=>['class'=>'input_st field-input required alphanumeric']],
'inputOptions'=>['class'=>'input_st field-input required email']],
'password' => ['type' => 'password', 'placeholder'=>"Придумайте пароль*", 'options'=>['label'=>false],
'inputOptions'=>['class'=>'input_st field-input required alphanumeric']],
'inputOptions'=>['class'=>'input_st field-input required email']],
'password_c' => ['type' => 'password', 'placeholder'=>"Повторите пароль*", 'options'=>['label'=>false],
'inputOptions'=>['class'=>'input_st field-input required alphanumeric']],
'inputOptions'=>['class'=>'input_st field-input required email']],
'phone' => ['type' => 'text', 'placeholder'=>"Телефон", 'options'=>['label'=>false],
'inputOptions'=>['class'=>'input_st field-input required alphanumeric']],
'teltext' => '<div class="teltext-block">Для участие в проводимых конкурсах укажите Ваш реальный номер телефона,
что бы мы смогли вас оповестить о результатах</div>',
'inputOptions'=>['class'=>'input_st field-input required email']],
'occupation' => [
'type' => 'dropdownlist',
'items' => User::$occupation_list,
'placeholder'=>"Род занятий",
'placeholder'=>"Чем вы занимаетесь",
'options'=>['label'=>false],
'empty'=>'Чем вы занимаетесь',
'inputOptions'=>['class'=>'input_st field-input required alphanumeric']
],
'button_submit' => '<a href="javascript:void(0)" class="submit_form_reg_popup">
<div class="save-button sh_bt_send">
Записаться
<div class="save-button popup_bt_send save-button-lg">
Начать обучение
</div>
</a>',
'login_popup_link' => '<a class="login_form_popup_link" href="javascript:void(0)">Уже есть аккаунт?</a>',
'text-reg' => '<span class="popup_text">Проходя регистрацию вы подтверждаете<br>
<a href="javascript:void(0)">согласие на обработку персональных данных.</a></span>',
'close_form_reg' => '</div>',
'how_work' =>' <div class="registration_form_right form_resp">
<span class="popup__title3">Как это работает?</span>
<p>Каждую неделю мы будем высылать тебе по 1 видео-уроку, который позволит освоить данную тему. Просмотр уроков и бонусных материалов - бесплатный!</p>
<div class="registration_form_img">
<br>
<img src="images/registration_form_img.jpg" alt="">
<br>
<br>
</div>
<p><strong>Более того, самому активному пользвотелю мы предусмотрели <span class="red_text">приз в размере 15 000 руб</span>. Все что надо, чтобы получить награду, это смотреть ролики и проявлять активность.</strong></p>
<br>
<br>
<p>Если у Вас уже есть аккаунт <a href="#registration_form2" class="popup-form">Войти</a></p>
</div>
<div class="clear"></div>'
];
return [
'activeForm'=>[
'id' => 'reg_form_popup',
'id'=>'reg_form_popup',
'options' => [
'enctype' => 'multipart/form-data'
'enctype' => 'multipart/form-data',
'class' =>'validreg_form2',
],
],
'elements' => $elements,
......
......@@ -130,7 +130,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
public function rules()
{
return [
[['email'], 'required', 'on' => [
/*[['email'], 'required', 'on' => [
self::SCENARIO_ACTIVATE_REQUEST,
self::SCENARIO_CHANGE_PASSWORD_REQUEST,
self::SCENARIO_CREATE,
......@@ -140,7 +140,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
self::SCENARIO_UPDATE,
self::SCENARIO_SEND_NEW_PASSWORD,
self::SCENARIO_RECOVER_PASSWORD
], 'message' => 'Пожалуйста, укажите корректный e-mail адрес'],
], 'message' => 'Пожалуйста, укажите корректный e-mail адрес'],*/
[['send_email'], 'safe'],
[['fio','name', 'surname'], 'safe', 'on' => [
self::SCENARIO_CREATE,
......@@ -184,11 +184,11 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
self::SCENARIO_SEND_NEW_PASSWORD,
self::SCENARIO_LOGIN,
]],*/
[['email'], 'unique','on' => [
/*[['email'], 'unique','on' => [
self::SCENARIO_REGISTRATION,
self::SCENARIO_CREATE,
]],
[['email'], '\common\components\validators\RuEmailValidator'],
], 'message' => 'Данный email уже есть'],*/
//[['email'], '\common\components\validators\RuEmailValidator'],
[['password_c'], 'compare', 'compareAttribute' => 'password', 'on' => [
self::SCENARIO_REGISTRATION,
self::SCENARIO_CHANGE_PASSWORD,
......@@ -204,11 +204,11 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
[['is_deleted'], 'integer','integerOnly' => true],
//array('phone', 'integer'),
[['fio'], 'string','min' => 2],
[['email'], 'string','max' => 200],
//[['email'], 'string','max' => 200],
[['source'], 'string','max' => 50],
[['status'], '\yii\validators\RangeValidator', 'range' => ['active','new','blocked'], 'allowArray' => true],
[['activate_code'], 'safe'],
[['email'], 'filter','filter' => 'trim'],
//[['email'], 'filter','filter' => 'trim'],
[['csv_file'], 'file', 'mimeTypes' => 'csv', 'on' => [
self::SCENARIO_CSV_IMPORT,
]],
......@@ -518,11 +518,10 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
public function validate($attributeNames = null, $clearErrors = true) {
if (!parent::validate($attributeNames = null, $clearErrors = true))
return false;
if ($this->scenario===self::SCENARIO_REGISTRATION) {
/*if ($this->scenario===self::SCENARIO_REGISTRATION) {
if (!$this->afterRegistration(['email' => $this->email, 'user_fio' => $this->getFio()]))
return false;
}
}*/
return true;
}
......
......@@ -59,9 +59,7 @@ a.login_form_link, a.login_form_popup_link, a.reg_popup_link, a.reg_form_link{
margin-top: 20px;
display: block;
}
#login_form, #login_form_popup{
display:none;
}
.sh_ft .popup_text, .reg_form .popup_text{
margin-top: 10px;
}
......
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