3161 - Важно - Не работает форма подписки на кейс

parent 9c791f2a
...@@ -33,7 +33,7 @@ class BidAdminController extends AdminController { ...@@ -33,7 +33,7 @@ class BidAdminController extends AdminController {
public function actionManage() public function actionManage()
{ {
$dataProvider = new ActiveDataProvider([ $dataProvider = new ActiveDataProvider([
'query' => BlogBids::find() 'query' => BlogBids::find()->orderBy(['date' => SORT_DESC])
]); ]);
return $this->render( return $this->render(
......
...@@ -32,7 +32,7 @@ class CasesBidsAdminController extends AdminController{ ...@@ -32,7 +32,7 @@ class CasesBidsAdminController extends AdminController{
public function actionManage() public function actionManage()
{ {
$dataProvider = new ActiveDataProvider([ $dataProvider = new ActiveDataProvider([
'query' => CasesBids::find() 'query' => CasesBids::find()->orderBy(['date' => SORT_DESC])
]); ]);
return $this->render( return $this->render(
......
...@@ -14,14 +14,15 @@ $cacheEmail = Yii::$app->session->get('user_email'); ...@@ -14,14 +14,15 @@ $cacheEmail = Yii::$app->session->get('user_email');
if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->exists()===true) if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->exists()===true)
$userIsSubscribed = true; $userIsSubscribed = true;
$more = CaseContent::find() $contents = CaseContent::find()
->where([ ->where([
'category_id' => \common\models\Settings::getValue('case-category-id'), 'category_id' => \common\models\Settings::getValue('case-category-id'),
'active' => true 'active' => true
]) ])
->andWhere(['!=', 'id', $model->id]) ->andWhere(['!=', 'id', $model->id])
->orderBy('RAND()') ->orderBy('RAND()')
->one(); ->limit($userIsSubscribed ? 2 : 1)
->all();
?> ?>
<!-- <section class="short_keys_sect"> <!-- <section class="short_keys_sect">
...@@ -32,7 +33,8 @@ $more = CaseContent::find() ...@@ -32,7 +33,8 @@ $more = CaseContent::find()
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<?php if($more) : ?> <?php if($contents) : ?>
<?php foreach ($contents as $more) : ?>
<div class="col-md-6 col-xs-6 col-sm-12"> <div class="col-md-6 col-xs-6 col-sm-12">
<div class="short_keys_block"> <div class="short_keys_block">
<img src="<?= ($more->previewType->type == CasesPreviewType::PREVIEW_RECTANGLE && $more->preview_mob) ? $more->preview_mob : $more->preview ?>" height="338" width="455"> <img src="<?= ($more->previewType->type == CasesPreviewType::PREVIEW_RECTANGLE && $more->preview_mob) ? $more->preview_mob : $more->preview ?>" height="338" width="455">
...@@ -43,6 +45,7 @@ $more = CaseContent::find() ...@@ -43,6 +45,7 @@ $more = CaseContent::find()
</div> </div>
</div> </div>
</div> </div>
<?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
<?php <?php
...@@ -51,7 +54,7 @@ $more = CaseContent::find() ...@@ -51,7 +54,7 @@ $more = CaseContent::find()
// $show = false; // $show = false;
//if ($show===true): //if ($show===true):
if ($userIsSubscribed===false): ?> if (!$userIsSubscribed): ?>
<div class="col-md-6 col-xs-6 col-sm-12"> <div class="col-md-6 col-xs-6 col-sm-12">
<div class="subsc_block"> <div class="subsc_block">
......
...@@ -13,7 +13,6 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e ...@@ -13,7 +13,6 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e
<div class="row"> <div class="row">
<div class="col-md-12 col-xs-12 col-sm-12"> <div class="col-md-12 col-xs-12 col-sm-12">
<div class="keys_send_mail"> <div class="keys_send_mail">
<p><?=\Yii::t('form', 'The cases description process require a lot of time. Thus, we write them at free time. Subscribe to follow the updates.')?></p>
<?php <?php
$model = new CasesBids(); $model = new CasesBids();
...@@ -21,7 +20,7 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e ...@@ -21,7 +20,7 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e
'action' => '/cases/default/add', 'action' => '/cases/default/add',
'enableClientValidation' => false, 'enableClientValidation' => false,
'options' => [ 'options' => [
'class' => 'keys_mail_form bids-form', 'class' => 'keys_mail_form bids-form portfolio-subscribe-form',
'data-title' => 'Страница Кейсы', 'data-title' => 'Страница Кейсы',
'data-form' => 'Подпись на обновления в кейсах', 'data-form' => 'Подпись на обновления в кейсах',
], ],
...@@ -38,14 +37,33 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e ...@@ -38,14 +37,33 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e
<?php //echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?> <?php //echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
<div class="case-subscribe-email">
<div class="subsc_block_txt"><?=\Yii::t('form', 'The cases description process require a lot of time. Thus, we write them at free time. Subscribe to follow the updates.')?></div>
<?php echo $form->field($model, 'email', [ <?php echo $form->field($model, 'email', [
'template' => '<div class="row"><div class="col-sm-12">{input}</div></div>', 'template' => '<div class="row"><div class="col-sm-12">{input}</div></div>',
'errorOptions' => [] 'errorOptions' => []
])->textInput([ ])->textInput([
'placeholder' => 'E-mail*', 'placeholder' => 'E-mail*'
]); ?> ]); ?>
</div>
<div class="case-subscribe-name case-subscribe-hide">
<div class="subsc_block_txt"><?=\Yii::t('form', 'You have successfully subscribed to the update notification.')?></div>
<div class="subsc_block_txt2"><strong><?=\Yii::t('form', 'Please enter your name.')?></strong></div>
<?php echo $form->field($model, 'name', [
'template' => '<div class="row"><div class="col-sm-12">{input}</div></div>',
'errorOptions' => []
])->textInput([
'placeholder' => 'Имя'
]); ?>
</div>
<div class="case-subscribe-success case-subscribe-hide">
<div class="subsc_block_txt"><?=\Yii::t('form', 'Thank you very much for showing interest!')?></div>
<img src="/images/thanks.png" alt="">
</div>
<?php echo Html::button(\Yii::t('form', 'Subscribe'), ['class' => 'save-button']); ?> <?php echo Html::button(\Yii::t('form', 'Subscribe'), ['class' => 'case-subscribe-button']); ?>
</div> </div>
......
...@@ -444,6 +444,18 @@ html {overflow-x: hidden;} ...@@ -444,6 +444,18 @@ html {overflow-x: hidden;}
margin-bottom: 0; margin-bottom: 0;
} }
.portfolio-subscribe-form .subsc_block_txt {
margin-top: 0;
}
.portfolio-subscribe-form .case-subscribe-button {
margin-left: 0;
}
.portfolio-subscribe-form .case-subscribe-name .form-group {
margin-bottom: 15px;
}
#footer { #footer {
background: url(../images/taskon_1/footer_bg.png) no-repeat center center; background: url(../images/taskon_1/footer_bg.png) no-repeat center center;
-webkit-background-size: cover; -webkit-background-size: cover;
......
...@@ -93,6 +93,7 @@ $(document).ready(function () { ...@@ -93,6 +93,7 @@ $(document).ready(function () {
} else { } else {
$('.case-subscribe-name').addClass('case-subscribe-hide'); $('.case-subscribe-name').addClass('case-subscribe-hide');
$('.case-subscribe-button').hide(); $('.case-subscribe-button').hide();
$('.blog-subscribe-button').hide();
$('.case-subscribe-success').removeClass('case-subscribe-hide'); $('.case-subscribe-success').removeClass('case-subscribe-hide');
} }
} else { } else {
......
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