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

parent 9c791f2a
......@@ -33,7 +33,7 @@ class BidAdminController extends AdminController {
public function actionManage()
{
$dataProvider = new ActiveDataProvider([
'query' => BlogBids::find()
'query' => BlogBids::find()->orderBy(['date' => SORT_DESC])
]);
return $this->render(
......
......@@ -32,7 +32,7 @@ class CasesBidsAdminController extends AdminController{
public function actionManage()
{
$dataProvider = new ActiveDataProvider([
'query' => CasesBids::find()
'query' => CasesBids::find()->orderBy(['date' => SORT_DESC])
]);
return $this->render(
......
......@@ -14,14 +14,15 @@ $cacheEmail = Yii::$app->session->get('user_email');
if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->exists()===true)
$userIsSubscribed = true;
$more = CaseContent::find()
$contents = CaseContent::find()
->where([
'category_id' => \common\models\Settings::getValue('case-category-id'),
'active' => true
])
->andWhere(['!=', 'id', $model->id])
->orderBy('RAND()')
->one();
->limit($userIsSubscribed ? 2 : 1)
->all();
?>
<!-- <section class="short_keys_sect">
......@@ -32,7 +33,8 @@ $more = CaseContent::find()
</div>
</div>
<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="short_keys_block">
<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()
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php
......@@ -51,7 +54,7 @@ $more = CaseContent::find()
// $show = false;
//if ($show===true):
if ($userIsSubscribed===false): ?>
if (!$userIsSubscribed): ?>
<div class="col-md-6 col-xs-6 col-sm-12">
<div class="subsc_block">
......
......@@ -13,7 +13,6 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<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
$model = new CasesBids();
......@@ -21,7 +20,7 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e
'action' => '/cases/default/add',
'enableClientValidation' => false,
'options' => [
'class' => 'keys_mail_form bids-form',
'class' => 'keys_mail_form bids-form portfolio-subscribe-form',
'data-title' => 'Страница Кейсы',
'data-form' => 'Подпись на обновления в кейсах',
],
......@@ -37,15 +36,34 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e
<?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php //echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'email', [
'template' => '<div class="row"><div class="col-sm-12">{input}</div></div>',
'errorOptions' => []
])->textInput([
'placeholder' => 'E-mail*',
]); ?>
<?php echo Html::button(\Yii::t('form', 'Subscribe'), ['class' => 'save-button']); ?>
<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', [
'template' => '<div class="row"><div class="col-sm-12">{input}</div></div>',
'errorOptions' => []
])->textInput([
'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' => 'case-subscribe-button']); ?>
</div>
......
......@@ -444,6 +444,18 @@ html {overflow-x: hidden;}
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 {
background: url(../images/taskon_1/footer_bg.png) no-repeat center center;
-webkit-background-size: cover;
......
......@@ -93,6 +93,7 @@ $(document).ready(function () {
} else {
$('.case-subscribe-name').addClass('case-subscribe-hide');
$('.case-subscribe-button').hide();
$('.blog-subscribe-button').hide();
$('.case-subscribe-success').removeClass('case-subscribe-hide');
}
} 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