#1003,#1042

parent 196a9c2d
......@@ -3,6 +3,7 @@
namespace common\modules\blog\models;
use Yii;
use yii\helpers\Url;
use common\modules\languages\models\Languages;
use common\modules\blog\models\PostLang;
......@@ -191,7 +192,12 @@ class Post extends \common\components\ActiveRecordModel
*/
public function getViews()
{
return SessionUrl::find()->where(['url' => '/blog/'.$this->url]);
return SessionUrl::find()->where(['url' => $this->getFullUrl()]);
}
public function getFullUrl()
{
return Url::to(['/blog/' . $this->url]);
}
public function getThumbnailUrl()
......
......@@ -87,11 +87,16 @@ class PostLang extends \common\components\ActiveRecordModel
{
$text = strip_tags($this->text, '<a>');
if(strlen($text) > $chars)
{
$text = $text . " ";
$text = substr($text, 0, $chars);
$text = substr($text, 0, strrpos($text, ' '));
$text = $text . "...";
$text = $text . '...';
return '<p>'.$text.'</p><p><a href="'.$this->post->getFullUrl().'">Читать...</a></p>';
}
return '<p>'.$text.'</p>';
return $this->text;
}
}
......@@ -27,6 +27,10 @@ use common\modules\bids\models\Bid;
],
]); ?>
<div class="message-box send_secce">Заявка на статью отправлена. Мы обязательно ее рассмотрим.</div>
<div class="content">
<?php echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
<div class="blog_form_left form_resp">
......@@ -69,6 +73,8 @@ use common\modules\bids\models\Bid;
<?php echo Html::submitButton('Предложить статью', ['class' => 'save-button btn-default button-lg']); ?>
</div>
<?php ActiveForm::end(); ?>
</div>
......@@ -95,6 +101,10 @@ use common\modules\bids\models\Bid;
],
]); ?>
<div class="message-box send_secce">Заявка на статью по предложенной теме отправлена. Мы обязательно ее рассмотрим.</div>
<div class="content">
<?php echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
<div class="blog_form_left50 form_resp">
......@@ -122,8 +132,8 @@ use common\modules\bids\models\Bid;
<?php echo $form->field($model, 'message')->textArea([
'placeholder' => 'Что хочу почитать?
Например: Хочу почитать про то, как настраивается контекстная реклама.
Про то как выставляются ставки.',
Например: Хочу почитать про то, как настраивается контекстная реклама.
Про то как выставляются ставки.',
'class' => 'sect_cont_form__textarea'
])->label(false); ?>
......@@ -132,6 +142,8 @@ use common\modules\bids\models\Bid;
<?php echo Html::submitButton('Предложить тему', ['class' => 'save-button btn-default button-lg']); ?>
</div>
<?php ActiveForm::end(); ?>
</div>
......
......@@ -25,6 +25,10 @@ use common\modules\bids\models\Bid;
],
]); ?>
<div class="message-box send_secce">Теперь вы подписаны на обновления блога.</div>
<div class="content">
<?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
......@@ -38,6 +42,8 @@ use common\modules\bids\models\Bid;
<?php echo Html::submitButton('Подписаться', ['class' => 'save-button']); ?>
</div>
<?php ActiveForm::end(); ?>
</div>
\ No newline at end of file
......@@ -27,6 +27,10 @@ use common\modules\bids\models\Bid;
],
]); ?>
<div class="message-box callback send_secce">Ваша заявка отправлена, мы вам перезвоним.</div>
<div class="content">
<?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
......@@ -49,6 +53,8 @@ use common\modules\bids\models\Bid;
<?php echo Html::submitButton('Заказать звонок', ['class' => 'save-button popup_bt_send']); ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
\ No newline at end of file
......@@ -58,6 +58,10 @@ $more = CoContent::find()
],
]); ?>
<div class="message-box send_secce">Теперь вы подписаны на обновления кейсов.</div>
<div class="content">
<?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
......@@ -71,6 +75,8 @@ $more = CoContent::find()
<?php echo Html::submitButton('Подписаться', ['class' => 'save-button']); ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
......
......@@ -25,6 +25,10 @@ use common\modules\bids\models\Bid;
],
]); ?>
<div class="message-box send_secce">Теперь вы подписаны на обновления кейсов.</div>
<div class="content">
<?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
......@@ -38,9 +42,9 @@ use common\modules\bids\models\Bid;
<?php echo Html::submitButton('Подписаться', ['class' => 'save-button']); ?>
<?php ActiveForm::end(); ?>
</div>
<div class="send_secce" style="display:none;">Вы успешно подписались на обновление раздела «Кейсы». Нам приятно, что вы следите за нашим развитием :-)</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
\ No newline at end of file
......@@ -38,6 +38,10 @@ FileUploadBundle::register($this);
],
]); ?>
<div class="message-box send_secce">Ваша заявка на проект успешно отправлена!</div>
<div class="content">
<?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
......@@ -87,6 +91,8 @@ FileUploadBundle::register($this);
</div>
<?php echo Html::submitButton('Рассчитать проект', ['class' => 'btn-default save-button']); ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
......
......@@ -100,6 +100,10 @@ FileUploadBundle::register($this);
],
]); ?>
<div class="message-box send_secce">Ваша заявка отправлена, мы вам перезвоним.</div>
<div class="content">
<?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>
......@@ -141,6 +145,8 @@ FileUploadBundle::register($this);
<?php echo Html::submitButton('Отправить', ['class' => 'btn-default save-button']); ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
......
......@@ -194,7 +194,31 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
margin: 0 auto;
display: none;
}
.article_short_txt img {
margin-top: 0;
}
.article_short_tags {
margin-bottom: 14px;
}
.bids-form .message-box {
position: absolute;
z-index: 110;
text-align: center;
width: 480px;
left: 50%;
top: 50%;
margin: -11px 0 0 -240px;
display: none;
line-height: 30px;
}
.bids-form .message-box.callback {
width: 300px;
margin-left: -150px;
margin-top: 20px;
}
.subsc_blog_form {
position: relative;
}
/* ------------ BLOG MODAL ------------------ */
......
......@@ -36,8 +36,18 @@ $('form.bids-form').on('beforeSubmit', function(e) {
if(response.success)
{
if(form.find('.message-box').length > 0)
{
form.find('.message-box').fadeIn('fast');
form.find('.content').css('visibility','hidden');
setTimeout(function(){
form.find('.message-box').fadeOut('fast');
form.find('.content').css('visibility','visible');
}, 2000);
}
form.find('input:not(.not_clear), textarea').val('');
$('.send_secce').show();
form.find('#files-zone').html('');
$('.dz-preview.dz-processing').remove();
......
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