Commit 9d004ac0 authored by Ruslan Karimov's avatar Ruslan Karimov

#3460. Важно (срочно) - внести правки в верстку сайта

parent bfed083d
......@@ -86,6 +86,6 @@ class BidFile extends \common\components\ActiveRecordModel
public static function path()
{
return Yii::getAlias('@backend') . self::FILE_FOLDER;
return Yii::getAlias('@backend' . self::FILE_FOLDER);
}
}
......@@ -2,16 +2,13 @@
namespace common\modules\content\models;
use common\models\MetaTags;
use common\modules\languages\models\Languages;
use common\modules\messageTemplate\models\MessageTemplate;
use frontend\modules\sitemap\behaviors\SitemapBehavior;
use Yii;
use yii\behaviors\TimestampBehavior;
use frontend\modules\sitemap\behaviors\SitemapBehavior;
use \yii\helpers\Url;
use common\modules\content\models\CoBlocks;
use common\modules\content\models\CoContentLang;
use common\modules\languages\models\Languages;
use common\models\MetaTags;
use yii\helpers\Url;
/**
* This is the model class for table "co_content".
......@@ -115,7 +112,8 @@ class CoContent extends \common\components\ActiveRecordModel
/**
* @inheritdoc
*/
public function name() {
public function name()
{
return 'Контент';
}
......@@ -167,8 +165,7 @@ class CoContent extends \common\components\ActiveRecordModel
{
$query = $this->hasMany(MetaTags::className(), ['object_id' => 'id'])->where(['model_id' => get_class($this)]);
if($lang_id)
{
if ($lang_id) {
$query->andWhere(['lang_id' => $lang_id]);
}
......@@ -180,7 +177,7 @@ class CoContent extends \common\components\ActiveRecordModel
*/
public function getMetaTag($lang_id = null)
{
$lang_id = ($lang_id === null)? Languages::getCurrent()->id: $lang_id;
$lang_id = ($lang_id === null) ? Languages::getCurrent()->id : $lang_id;
return $this->hasOne(MetaTags::className(), ['object_id' => 'id'])->where([
'model_id' => get_class($this),
......@@ -199,13 +196,14 @@ class CoContent extends \common\components\ActiveRecordModel
/**
* @return \yii\db\ActiveQuery
*/
public function getTemplate() {
public function getTemplate()
{
return $this->hasOne(MessageTemplate::className(), ['id' => 'template_id']);
}
public function getLang($lang_id = null)
{
$lang_id = ($lang_id === null)? Languages::getCurrent()->id: $lang_id;
$lang_id = ($lang_id === null) ? Languages::getCurrent()->id : $lang_id;
return $this->hasOne(CoContentLang::className(), ['content_id' => 'id'])->where('lang_id = :lang_id', [':lang_id' => $lang_id]);
}
......@@ -218,7 +216,7 @@ class CoContent extends \common\components\ActiveRecordModel
public function afterSave($insert, $changedAttributes)
{
parent::afterSave($insert, $changedAttributes);
if ($this->category_id==4) { // <<< С этим надо что то делать, очень много привязок динамичных данных
if ($this->category_id == 4) { // <<< С этим надо что то делать, очень много привязок динамичных данных
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, Yii::$app->urlManager->createAbsoluteUrl('/triggers/default/recheckcases'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
......@@ -230,13 +228,10 @@ class CoContent extends \common\components\ActiveRecordModel
public function beforeSave($insert)
{
if (parent::beforeSave($insert))
{
if (parent::beforeSave($insert)) {
$this->priority = str_replace(',', '.', $this->priority);
return true;
}
else
{
} else {
return false;
}
}
......
......@@ -19,7 +19,9 @@ return [
'Write here summary of your article or send a short offer.' => 'Напишите краткие тезисы статьи или опишите интересующий вопрос.',
'You have successfully subscribed to the update notification.' => 'Вы успешно подписались на уведомление об обновлениях.',
'I agree to' => 'Я согласен с',
'the terms of usung personal data' => 'условиями обработки персональных данных',
'the terms of using personal data' => 'условиями обработки персональных данных',
'Please enter your name.' => 'Пожалуйста, укажите своё имя:',
'Thank you very much for showing interest!' => 'Нам очень приятно, что вы проявили интерес!'
'Thank you very much for showing interest!' => 'Нам очень приятно, что вы проявили интерес!',
'Accept the terms' => 'Примите условие обработки персональных данных',
'Please wait, file is loading...' => 'Подождите, осуществляется загрузка файла...'
];
\ No newline at end of file
......@@ -59,9 +59,10 @@ use common\modules\bids\models\Bid;
'checked' => false,
'required' => true,
'class' => 'footer_form__check',
'oninvalid' => "this.setCustomValidity('" . Yii::t('form', 'Accept the terms') . "')"
],
false
)->label(Yii::t('form', 'I agree to') . ' <a>' . \Yii::t('form', 'the terms of usung personal data') . '</a>.');
)->label(Yii::t('form', 'I agree to') . " ". Html::a(\Yii::t('form', 'the terms of using personal data'), '/uploads/personal_data_processing_art_project.pdf', ['target' => '_blank']));
?>
<?php echo Html::submitButton(Yii::t('footer', 'Submit'), ['class' => 'save-button popup_bt_send']); ?>
......
......@@ -59,9 +59,10 @@ use common\modules\bids\models\Bid;
'checked' => false,
'required' => true,
'class' => 'footer_form__check',
'oninvalid' => "this.setCustomValidity('" . Yii::t('form', 'Accept the terms') . "')"
],
false
)->label(Yii::t('form', 'I agree to') . ' <a>' . \Yii::t('form', 'the terms of usung personal data') . '</a>.');
)->label(Yii::t('form', 'I agree to') . ' ' . Html::a(\Yii::t('form', 'the terms of using personal data'), '/uploads/personal_data_processing_art_project.pdf', ['target' => '_blank']));
?>
<?php echo Html::submitButton(Yii::t('footer', 'Submit'), ['class' => 'save-button popup_bt_send']); ?>
......
......@@ -82,9 +82,10 @@ FileUploadBundle::register($this);
'checked' => false,
'required' => true,
'class' => 'footer_form__check',
'oninvalid' => "this.setCustomValidity('" . Yii::t('form', 'Accept the terms') . "')"
],
false
)->label(Yii::t('form', 'I agree to') . ' <a>' . \Yii::t('form', 'the terms of usung personal data') . '</a>.');
)->label(Yii::t('form', 'I agree to') . " ". Html::a(\Yii::t('form', 'the terms of using personal data'), '/uploads/personal_data_processing_art_project.pdf', ['target' => '_blank']));
?>
<div class="file-upload_block dropzone" id="block_upload">
......@@ -101,6 +102,7 @@ FileUploadBundle::register($this);
</div>
<?php echo Html::submitButton(\Yii::t('index', 'Submit'), ['class' => 'btn-default save-button']); ?>
<div class="file-processing"><?= Yii::t('form', 'Please wait, file is loading...') ?></div>
</div>
......@@ -180,8 +182,8 @@ FileUploadBundle::register($this);
и сертифицировано по информационной безопасности ISO 27001:2013.
</p>
<div class="footer_bottom_links">
<a href="javascript:;">Политика обработки персональных данных</a>
<a href="javascript:;">Пользовательское соглашение</a>
<a href="/uploads/personal_data_processing_art_project.pdf">Политика обработки персональных данных</a>
<a href="/uploads/coockies_art_project.pdf">Политика в отношении cookie</a>
</div>
</div>
<div class="footer_bottom_right">
......
......@@ -68,8 +68,8 @@
и сертифицировано по информационной безопасности ISO 27001:2013.
</p>
<div class="footer_bottom_links">
<a href="javascript:;">Политика обработки персональных данных</a>
<a href="javascript:;">Пользовательское соглашение</a>
<a href="/uploads/personal_data_processing_art_project.pdf">Политика обработки персональных данных</a>
<a href="/uploads/coockies_art_project.pdf">Политика в отношении cookie</a>
</div>
</div>
<div class="footer_bottom_right">
......
......@@ -111,7 +111,7 @@ $lang = Languages::getCurrent();
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="calk_form calk_form_custom">
<div class="calk_form calk_form_custom smt-margin">
<?php
$model = new Bid;
......@@ -171,13 +171,9 @@ $lang = Languages::getCurrent();
])->label(false); ?>
<div class="form-group field-bid-check">
<input class="footer_form__check" type="checkbox" id="check">
<input class="footer_form__check" type="checkbox" id="check" required oninvalid="this.setCustomValidity(' <?= Yii::t('form', 'Accept the terms') ?>')">
<label for="check">
Я согласен с условиями обработки
<a href="javascript:;">
персональных данных
</a>
.
<?= Yii::t('form', 'I agree to') . " ". Html::a(\Yii::t('form', 'the terms of using personal data'), '/uploads/personal_data_processing_art_project.pdf', ['target' => '_blank']) ?>
</label>
</div>
......@@ -194,6 +190,7 @@ $lang = Languages::getCurrent();
<div id="files-zone"></div>
<?php echo Html::submitButton(\Yii::t('index', 'Submit'), ['class' => 'btn-default save-button']); ?>
<div class="file-processing"><?= Yii::t('form', 'Please wait, file is loading...') ?></div>
</div>
......
......@@ -100,6 +100,10 @@
transition: 0.3s;
}
.calk_form_custom .save-button:disabled {
cursor: not-allowed;
}
.business-case-btn,
.btn-custom {
width: 276px !important;
......@@ -327,6 +331,7 @@ body{
.footer{
background: white;
padding-top: 0;
padding-bottom: 0;
}
.footer_index{
background: #344555;
......@@ -558,7 +563,24 @@ body{
margin-bottom: 50px;
}
.file-processing {
display: none;
float: right;
margin-left: 10px;
color: #0a0a0a;
padding: 10px 0;
}
.calk_form_custom.smt-margin {
margin-top: 30px;
}
@media only screen and (max-width: 992px){
.file-processing {
float: none;
margin-left: 0;
}
.calk_form_custom .footer_form__input{
width: 100%;
}
......
$('.bids-form input[name="Bid[phone]"]').mask("+7(999)999-99-99");
$('form.bids-form').on('beforeSubmit', function(e) {
var form = $(this), xhr = new XMLHttpRequest, filebool = false, file, data = new FormData();
form.find('input, textarea').each(function(){
data.append($(this).attr('name'), $(this).val());
});
if(form.find('input[type=file]').length) {
file = form.find('input[type=file]')[0].files[0];
filebool = !filebool;
data.append("Bid[file]", file);
}
xhr.open("POST", form.attr('action'), true);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.send(data);
xhr.onreadystatechange = function()
{
if (xhr.readyState == 4){
try
{
var response = JSON.parse(xhr.responseText);
}
catch(e)
{
var response = xhr.responseText;
}
form.find('.has-error').removeClass('has-error');
e.preventDefault();
var $form = $(this), data = new FormData(this);
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: data
}).done(function(response) {
if(response.success)
{
if(form.find('.message-box').length > 0)
if($form.find('.message-box').length > 0)
{
form.find('.content').css('opacity','0');
form.find('.content').css('visibility','hidden');
form.find('.message-box').fadeIn('fast');
$form.find('.content').css('opacity','0');
$form.find('.content').css('visibility','hidden');
$form.find('.message-box').fadeIn('fast');
setTimeout(function(){
form.find('.message-box').fadeOut('fast');
form.find('.content').css('visibility','visible');
form.find('.content').css('opacity','1');
form.closest(".mfp-content").find(".mfp-close").click()
$form.find('.message-box').fadeOut('fast');
$form.find('.content').css('visibility','visible');
$form.find('.content').css('opacity','1');
$form.closest(".mfp-content").find(".mfp-close").click()
}, 2000);
}
form.find('input:not(.not_clear), textarea').val('');
//$form.find('input:not(.not_clear), textarea').val('');
$form.trigger('reset');
form.find('#files-zone').html('');
$form.find('#files-zone').html('');
$('.dz-preview.dz-processing').remove();
$('.file_drop').show();
$('.file_drop_cs').show();
......@@ -58,28 +36,112 @@ $('form.bids-form').on('beforeSubmit', function(e) {
dataLayer.push({
'event': 'UA_event',
'Catagory': form.data('tag'),
'Action': form.data('title'),
'Catagory': $form.data('tag'),
'Action': $form.data('title'),
'Label': 'Успешно'
});
}
else
{
errors = [];
var errors = [];
$.each(response, function(key, value) {
form.find('.field-'+key).addClass('has-error');
$form.find('.field-'+key).addClass('has-error');
errors = errors.concat(value);
});
dataLayer.push({
'event': 'UA_event',
'Catagory': 'Ошибки',
'Action': form.data('form'),
'Action': $form.data('form'),
'Label': errors
});
}
}
}
}).fail(function(jqXHR, textStatus, errorThrown) {
dataLayer.push({
'event': 'UA_event',
'Catagory': 'Ошибки',
'Action': $form.data('form'),
'Label': textStatus
});
});
//
// $form.find('input, textarea').each(function(){
// data.append($(this).attr('name'), $(this).val());
// });
//
// if($form.find('input[type=file]').length) {
// file = form.find('input[type=file]')[0].files[0];
// filebool = !filebool;
// data.append("Bid[file]", file);
// }
//
// xhr.open("POST", form.attr('action'), true);
// xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
//
// xhr.send(data);
// xhr.onreadystatechange = function()
// {
// if (xhr.readyState == 4){
// try
// {
// var response = JSON.parse(xhr.responseText);
// }
// catch(e)
// {
// var response = xhr.responseText;
// }
//
// $form.find('.has-error').removeClass('has-error');
//
// if(response.success)
// {
// if($form.find('.message-box').length > 0)
// {
// $form.find('.content').css('opacity','0');
// $form.find('.content').css('visibility','hidden');
// $form.find('.message-box').fadeIn('fast');
//
// setTimeout(function(){
// $form.find('.message-box').fadeOut('fast');
// $form.find('.content').css('visibility','visible');
// $form.find('.content').css('opacity','1');
// $form.closest(".mfp-content").find(".mfp-close").click()
// }, 2000);
// }
// $form.find('input:not(.not_clear), textarea').val('');
//
// $form.find('#files-zone').html('');
// $('.dz-preview.dz-processing').remove();
// $('.file_drop').show();
// $('.file_drop_cs').show();
// $('.file_upload_bt_cs').show();
// $('.file_upload_bt').show();
//
// dataLayer.push({
// 'event': 'UA_event',
// 'Catagory': form.data('tag'),
// 'Action': form.data('title'),
// 'Label': 'Успешно'
// });
// }
// else
// {
// var errors = [];
// $.each(response, function(key, value) {
// $form.find('.field-'+key).addClass('has-error');
// errors = errors.concat(value);
// });
//
// dataLayer.push({
// 'event': 'UA_event',
// 'Catagory': 'Ошибки',
// 'Action': $form.data('form'),
// 'Label': errors
// });
// }
// }
// }
}).on('submit', function(e){
return false;
});
\ No newline at end of file
......@@ -22,11 +22,23 @@ $(document).ready(function() {
maxFiles: 4,
maxFilesize: 15,
addRemoveLinks: true,
acceptedFiles: '.xls,.doc,.docx,.xlsx,.png,.jpeg,.gif,.bmp,.jpg,.zip,.rar,.tar,.pptx,.ppt,.csv',
acceptedFiles: '.xls,.doc,.docx,.xlsx,.png,.jpeg,.gif,.bmp,.jpg,.zip,.rar,.tar,.pptx,.ppt,.csv,.pdf',
dictRemoveFile: 'Удалить',
dictInvalidFileType: 'Приложенный файл не может быть загружен в целях безопасности. Пожалуйста, приложите файл в другом формате (Word, Pdf, PowerPoint, Excel).',
dictFileTooBig: 'Максимальный размер файла составляет 15мб.',
dictCancelUpload: 'Отменить загрузку',
init: function() {
this.on("queuecomplete", function(file) {
var $form = $(this.element).closest('form');
$form.find('[type="submit"]').attr('disabled', false);
$form.find('.file-processing').fadeOut();
});
this.on("addedfile", function(file) {
var $form = $(this.element).closest('form');
$form.find('[type="submit"]').attr('disabled', true);
$form.find('.file-processing').fadeIn();
});
},
success: function(file, response) {
file.filename = response.filename;
$('#files-zone').append('<input type="hidden" name="Bid[file][]" value="'+response.filename+'" />');
......
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