Commit bffbccdc authored by Виталий Мурашко's avatar Виталий Мурашко

Merge branch 'master' of http://git.task-on.com/ktask/task-on.com

Conflicts:
	frontend/views/layouts/main.php
parents 9b93ac70 99b473a6
<?php
return [
'adminEmail' => 'admin@example.com',
'name' => 'Арт Проект',
'frontUrl' => 'http://task-on.com'
];
......@@ -90,18 +90,24 @@ class SettingsController extends AdminController
*/
public function actionCreate($module_id)
{
return $this->actionUpdate($module_id);
die('---');
$model = new Settings();
$model = new Settings;
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
Yii::$app->controller->page_title = 'Создание свойства для модуля <small>' .\Yii::$app->getModule($module_id)->name(). '</small>';
Yii::$app->controller->breadcrumbs = [
['Свойства модуля ' .\Yii::$app->getModule($module_id)->name() => \yii\helpers\Url::toRoute(['manage', 'module_id'=>$module_id])],
'Создание свойства для модуля ' .\Yii::$app->getModule($module_id)->name(),
];
if ($model->load(Yii::$app->request->post()) && $model->save())
{
return $this->redirect(['manage', 'module_id' => $module_id]);
}
$form = new \common\components\BaseForm('/backend/forms/SettingsForm', $model);
return $this->render('create', [
'model' => $model,
'form' => $form->out
]);
}
/**
......@@ -110,45 +116,27 @@ class SettingsController extends AdminController
* @param string $id
* @return mixed
*/
public function actionUpdate($module_id, $id = null)
{
//die(print_r(\common\components\AppManager::getSettingsParam('scoring_low')));
if(!empty($id)) {
$model = $this->findModel($id);
\yii::$app->controller->page_title = 'Редактирование свойства для модуля <small>' .\Yii::$app->getModule($module_id)->name(). '</small>';
\yii::$app->controller->breadcrumbs = [
['Свойства модуля ' .\Yii::$app->getModule($module_id)->name() => \yii\helpers\Url::toRoute(['manage', 'module_id'=>$module_id])],
'Редактирование свойства для модуля ' .\Yii::$app->getModule($module_id)->name(),
];
}
else {
$model = new Settings();
$model->module_id = $module_id;
\yii::$app->controller->page_title = 'Добавление свойства для модуля <small>' .\Yii::$app->getModule($module_id)->name(). '</small>';
\yii::$app->controller->breadcrumbs = [
['Свойства модуля ' .\Yii::$app->getModule($module_id)->name() => \yii\helpers\Url::toRoute(['manage', 'module_id'=>$module_id])],
'Добавление свойства для модуля ' .\Yii::$app->getModule($module_id)->name(),
];
}
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['manage', 'module_id' => $module_id]);
} else {
if($model->hasErrors())
\Yii::$app->getSession()->setFlash('error', $model->getErrors());
public function actionUpdate($id)
{
$model = $this->findModel($id);
Yii::$app->controller->page_title = 'Редактирование свойства для модуля <small>' .\Yii::$app->getModule($model->module_id)->name(). '</small>';
Yii::$app->controller->breadcrumbs = [
['Свойства модуля ' .\Yii::$app->getModule($model->module_id)->name() => \yii\helpers\Url::toRoute(['manage', 'module_id'=>$model->module_id])],
'Редактирование свойства для модуля ' .\Yii::$app->getModule($model->module_id)->name(),
];
if($id == 87)
$form = new \common\components\BaseForm('/backend/forms/SettingsForm1', $model);
else
$form = new \common\components\BaseForm('/backend/forms/SettingsForm', $model);
if ($model->load(Yii::$app->request->post()) && $model->save())
{
return $this->redirect(['manage', 'module_id' => $model->module_id]);
}
else
{
$form = new \common\components\BaseForm('/backend/forms/SettingsForm', $model);
return $this->render('update', [
//'model' => $model,
'model' => $model,
'form' => $form->out,
//'module_id' => $module_id
]);
}
}
......
......@@ -17,13 +17,11 @@ return [
'value' => ['type' => 'text', 'class' => 'form-control'],
'element' => [
'type' => 'dropdownlist',
'items' => ['editor','text','textarea'],
'items' => ['editor', 'text', 'textarea'],
'class' => 'form-control',
],
'description' => ['type' => 'text', 'class' => 'form-control'],
'hidden' => ['type' => 'checkbox'],
// 'created_at' => ['type' => 'text', 'class' => 'form-control'],
// 'updated_at' => ['type' => 'text', 'class' => 'form-control'],
],
'buttons' => [
'submit' => ['type' => 'submit', 'value' => 'Cохранить']
......
......@@ -14,15 +14,10 @@ return [
'name' => ['type' => 'text', 'class' => 'form-control'],
'value' => ['type' => 'text', 'class' => 'form-control'],
'element' => [
/*'type' => 'dropdownlist',
'items' => ['editor','text','textarea'],
'class' => 'form-control',*/
'type' => 'hidden',
],
'description' => ['type' => 'hidden', 'class' => 'form-control'],
'hidden' => ['type' => 'hidden'],
// 'created_at' => ['type' => 'text', 'class' => 'form-control'],
// 'updated_at' => ['type' => 'text', 'class' => 'form-control'],
],
'buttons' => [
'submit' => ['type' => 'submit', 'value' => 'Cохранить']
......
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Settings */
$this->title = Yii::t('app', 'Create Settings');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Settings'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="settings-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
echo $form;
\ No newline at end of file
<?php
use yii\helpers\Html;
echo $form
?>
echo $form;
......@@ -134,7 +134,7 @@ JS;
if (is_string($config))
{
$config = self::getFormConfig($config);
$config = self::getFormConfig($config, $model);
}
//$config['ActiveForm'] = $config['activeForm'];
//die(print_r($config['elements']));
......@@ -288,12 +288,12 @@ JS;
ob_start();
ob_implicit_flush(false);
$form = ActiveForm::begin(ArrayHelper::merge(
$config['activeForm'],
[
'enableAjaxValidation' => true,
'enableClientValidation' => false,
'validateOnType' => true,
]
],
$config['activeForm']
));
foreach($config['options'] as $item) {
echo $item;
......@@ -312,11 +312,9 @@ JS;
list($module, $form) = explode(".", $alias, 2);
return "application.modules.{$module}.forms.{$form}";
}
/*public function render*/
// Убран static
public function getFormConfig($alias)
public function getFormConfig($alias, $model)
{
if (is_string($alias))
{
......@@ -329,58 +327,6 @@ JS;
}
}
/*public function __toString()
{
try
{
$cs = Yii::app()->clientScript;
if (!($this->parent instanceof self))
{
//$id = $this->activeForm['id'];
if ($this->side == 'client')
{
// $cs
// ->registerScriptFile('/js/plugins/clientForm/inFieldLabel/jquery.infieldlabel.js')
// ->registerScriptFile('/js/plugins/clientForm/clientForm.js')
// ->registerCssFile('/js/plugins/clientForm/form.css')->registerScript(
// $id . '_baseForm', "$('#{$id}').clientForm()");
}
else
{
$cs->registerScriptFile('/js/admin/admin_form.js')
->registerScriptFile('/js/admin/admin_form.js')
->registerScriptFile('/js/plugins/adminForm/buttonSet.js')
->registerScriptFile('/js/plugins/adminForm/tooltips/jquery.atooltip.js')
->registerCssFile('/js/plugins/adminForm/tooltips/atooltip.css')
->registerScriptFile('/js/plugins/adminForm/chosen/chosen.jquery.js')
->registerCssFile('/js/plugins/adminForm/chosen/chosen.css');
;
}
}
if ($this->_clear)
{
$cs->registerScript('clearForm', '$(function()
{
$(":input","#' . $this->activeForm['id'] . '")
.not(":button, :submit, :reset, :hidden")
.val("")
.removeAttr("checked")
.removeAttr("selected");
})');
}
return parent::__toString();
} catch (Exception $e)
{
Yii::app()->handleException($e);
}
}*/
public function renderBody()
{
$output = parent::renderBody();
......
......@@ -54,13 +54,13 @@ class Settings extends \common\components\ActiveRecordModel
{
return [
'id' => Yii::t('app', 'ID'),
'module_id' => Yii::t('app', 'Module ID'),
'code' => Yii::t('app', 'Code'),
'name' => Yii::t('app', 'Name'),
'value' => Yii::t('app', 'Value'),
'element' => Yii::t('app', 'Element'),
'hidden' => Yii::t('app', 'Hidden'),
'description' => Yii::t('app', 'Description'),
'module_id' => 'Модуль',
'code' => 'Код',
'name' => 'Название',
'value' => 'Значение',
'element' => 'Элемент',
'hidden' => 'Скрытый',
'description' => 'Описание',
];
}
}
......@@ -110,13 +110,19 @@ class CoContent extends \common\components\ActiveRecordModel
$blocks = CoBlocks::find()->all();
$arrWhatReplace = [];
$arrReplace = [];
foreach($blocks as $block)
{
$arrWhatReplaceNext = [];
$arrReplaceNext = [];
foreach($blocks as $block) {
$arrWhatReplace[] = '{' . $block->name . '}';
$arrReplace[] = $block->text;
$arrWhatReplaceNext[] = '[' . $block->name . ']';
$arrReplaceNext[] = $block->text;
}
return str_replace($arrWhatReplace, $arrReplace, $content);
$arrWhatReplaceNext[] = '[about-reviews]';
$arrReplaceNext[] = \common\modules\content\models\CoBlocks::printStaticBlock( 'about-reviews', true);
return str_replace($arrWhatReplaceNext, $arrReplaceNext,str_replace($arrWhatReplace, $arrReplace, $content));
}
public function beforeSave($insert) {
......
<?php
namespace common\modules\main\controllers;
use Yii;
use common\modules\main\models\Counts;
use common\modules\main\models\CountsSearch;
use common\components\AdminController;
use yii\helpers\Url;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* CountsController implements the CRUD actions for Counts model.
*/
class CountsController extends AdminController
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
public static function actionsTitles() {
return [
'Index' => '',
'Create' => '',
'Update' => '',
'Delete' => '',
'View' => '',
];
}
/**
* Lists all Counts models.
* @return mixed
*/
public function actionIndex()
{
\yii::$app->controller->page_title = 'Счетчики';
\yii::$app->controller->breadcrumbs = [
'Счетчики'
];
$searchModel = new CountsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Counts model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
$model = $this->findModel($id);
\yii::$app->controller->page_title = 'Редактировать счетчик ' . $model->name;
\yii::$app->controller->breadcrumbs = [
['Счетчики' => Url::toRoute('/main/counts/index')],
'Редактировать счетчик ' . $model->name
];
return $this->render('view', [
'model' => $model,
]);
}
/**
* Creates a new Counts model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new Counts();
\yii::$app->controller->page_title = 'Добавить счетчик';
\yii::$app->controller->breadcrumbs = [
['Счетчики' => Url::toRoute('/main/counts/index')],
'Добавить счетчик'
];
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing Counts model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
\yii::$app->controller->page_title = 'Редактировать счетчик ' . $model->name;
\yii::$app->controller->breadcrumbs = [
['Счетчики' => Url::toRoute('/main/counts/index')],
'Редактировать счетчик ' . $model->name
];
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Counts model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Counts model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Counts the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Counts::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
<?php
namespace common\modules\main\controllers;
use yii\web\Controller;
class DefaultController extends Controller
{
public function actionIndex()
{
return $this->render('index');
}
public function actionTest() {
error_reporting(E_ALL);
ini_set('display_errors', 1);
$model = new \common\models\Enctest();
//$model->data = 'Druppov_A@mail.ru';
$model->data = 'YQE4W2rOGog=u0TcCx3Lpr1LBkBHEplEuPxJ8+Sq77oQ';
$model->save();
$model = \common\models\Enctest::find()->where(['id'=>19])->one();
print_r($model->attributes);
}
}
......@@ -2,9 +2,6 @@
namespace common\modules\main\controllers;
use common\modules\request\models\CronWork;
use common\models\Settings;
class MainAdminController extends \common\components\AdminController
{
//public $layout = '\main';
......@@ -13,12 +10,6 @@ class MainAdminController extends \common\components\AdminController
{
return array(
'Index' => 'Просмотр главной страницы',
'Modules' => 'Просмотр списка модулей',
'ChangeOrder' => 'Сортировка',
'SessionPerPage' => 'Установки кол-ва элементов на странице',
'SessionLanguage' => 'Установка языка',
'AdminLinkProcess' => 'Переход по ссылке в админ панель',
'Calculatepercent' => '',
);
}
......@@ -27,17 +18,4 @@ class MainAdminController extends \common\components\AdminController
return $this->render('index');
}
public function actionCalculatepercent()
{
\console\controllers\PercentController::actionCalculate();
return $this->redirect('index');
}
public function actionSessionPerPage($model, $per_page, $back_url)
{die($model.' -- '.$per_page.' -- '.$back_url);
\Yii::$app->session["{$model}PerPage"] = $per_page;
$this->redirect(base64_decode($back_url));
}
}
<?php
namespace common\modules\main\controllers;
use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use common\models\LoginForm;
use yii\filters\VerbFilter;
//class MainAdminController extends \common\components\AdminController
class MAINAdminController extends Controller
{
public function init() {
die($this->context->module->id);
}
public function actionIndex()
{
error_reporting(E_ALL);
ini_set('display_errors', 1);
return $this->render('\common\modules\main\mainAdmin\index');
}
}
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\modules\main\models\Counts */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="counts-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'count')->textarea(['rows' => 6]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Добавить' : 'Обновить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\modules\main\models\CountsSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="counts-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id') ?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'count') ?>
<?= $form->field($model, 'created_at') ?>
<?= $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\modules\main\models\Counts */
?>
<div class="counts-create">
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\modules\main\models\CountsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<div class="counts-index">
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Добавить счетчик', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= \common\components\zii\AdminGrid::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
//['class' => 'yii\grid\SerialColumn'],
//'id',
'name',
'count:ntext',
/*'created_at',
'updated_at',*/
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\modules\main\models\Counts */
$this->title = 'Update Counts: ' . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Counts', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="counts-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\modules\main\models\Counts */
?>
<div class="counts-view">
<p>
<?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Вы уверены?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
//'id',
'name',
'count:ntext',
/*'created_at',
'updated_at',*/
],
]) ?>
</div>
<div class="mainModule-default-index">
<h1><?= $this->context->action->uniqueId ?></h1>
<p>
This is the view content for action "<?= $this->context->action->id ?>".
The action belongs to the controller "<?= get_class($this->context) ?>"
in the "<?= $this->context->module->id ?>" module.
</p>
<p>
You may customize this page by editing the following file:<br>
<code><?= __FILE__ ?></code>
</p>
</div>
......@@ -110,15 +110,17 @@ class ReviewAdminController extends AdminController
'Добавить отзыв'
];
if ($model->load(Yii::$app->request->post()) && $model->validate())
$model->load(Yii::$app->request->post());
$model->image = UploadedFile::getInstance($model, 'image');
if (Yii::$app->request->isPost && $model->validate())
{
if($model->file)
if($model->image)
{
$model->file = UploadedFile::getInstance($model, 'file');
$model->upload();
$model->image = null;
}
$model->save();
return $this->redirect(['manage']);
......@@ -150,20 +152,22 @@ class ReviewAdminController extends AdminController
'Редактировать отзыв'
];
if ($model->load(Yii::$app->request->post()) && $model->validate())
$model->load(Yii::$app->request->post());
$model->image = UploadedFile::getInstance($model, 'image');
if (Yii::$app->request->isPost && $model->validate())
{
if($model->file)
if($model->image)
{
if($model->photo)
{
$model->deletePhoto();
}
$model->file = UploadedFile::getInstance($model, 'file');
$model->upload();
$model->image = null;
}
$model->save();
return $this->redirect(['manage']);
......
......@@ -9,7 +9,6 @@ return [
'options' => [
'enctype' => 'multipart/form-data'
],
'enableAjaxValidation' => false,
],
'elements' => [
'title' => [
......@@ -19,7 +18,9 @@ return [
'type' => 'dropdownlist',
'items' => ArrayHelper::map(\common\modules\languages\models\Languages::find()->all(),'code','name')
],
'file' => ['type' => 'file', 'class' => 'form-control',],
($model->photo?Html::img(\Yii::$app->params['frontUrl'] . Reviews::PHOTO_FOLDER . $model->photo):''),
'image' => ['type' => 'file', 'class' => 'form-control',],
'video' => ['type' => 'text', 'class' => 'form-control',],
'date' => ['type' => 'date', 'class' => 'form-control',],
'text' => ['type' => 'textarea', 'class' => 'form-control'],
// '<a id="doAnswer" style="cursor: pointer;" onclick="$(this).next().next().slideToggle(); return false;">Ответить</a>' .
......@@ -34,7 +35,7 @@ return [
// '</div>',
'state' => [
'type' => 'dropdownlist',
'items' => ['active','hidden'],
'items' => ['active' => 'Активен', 'hidden' => 'Скрыт'],
'class' => 'form-control'
],
'rate_usability' => [
......
......@@ -34,9 +34,9 @@ use Yii;
*/
class Reviews extends \common\components\ActiveRecordModel
{
public $file;
public $image;
const TEMP_FOLDER = '/uploads/reviews/';
const PHOTO_FOLDER = '/uploads/reviews/';
private static $rate = [
'rate_usability' => [
......@@ -95,16 +95,15 @@ class Reviews extends \common\components\ActiveRecordModel
public function rules()
{
return [
[['text', 'state', 'date', 'notification_send', 'show_in_module'], 'required'],
[['text', 'date', 'notification_send', 'show_in_module'], 'required'],
[['admin_id', 'priority', 'notification_send', 'order', 'cat_id', 'show_in_module', 'rate_usability', 'rate_loyality', 'rate_profit'], 'integer'],
[['file'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'],
[['image'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'],
[['text', 'state', 'attendant_products'], 'string'],
[['admin_id'], 'adminIdValidate'],
[['date', 'answer', 'good', 'bad', 'date_create', 'notification_date', 'rate_usability', 'rate_loyality', 'rate_profit', 'title', 'order'], 'safe'],
[['date', 'answer', 'good', 'bad', 'date_create', 'notification_date', 'rate_usability', 'rate_loyality', 'rate_profit', 'title', 'order', 'photo', 'state', 'video'], 'safe'],
[['lang'], 'string', 'max' => 2],
[['title'], 'string', 'max' => 250],
[['photo'], 'string', 'max' => 50],
[['email'], 'string', 'max' => 255]
[['email', 'video'], 'string', 'max' => 255]
];
}
......@@ -131,7 +130,8 @@ class Reviews extends \common\components\ActiveRecordModel
'good' => Yii::t('reviews', 'Понравилось'),
'bad' => Yii::t('reviews', 'Не понравилось'),
'photo' => Yii::t('reviews', 'Фото'),
'file' => Yii::t('reviews', 'Фото'),
'video' => Yii::t('reviews', 'Ссылка на видео'),
'image' => Yii::t('reviews', 'Фото'),
'state' => Yii::t('reviews', 'Состояние'),
'date' => Yii::t('reviews', 'Дата'),
'date_create' => Yii::t('reviews', 'Создана'),
......@@ -206,20 +206,20 @@ class Reviews extends \common\components\ActiveRecordModel
private function getPath()
{
return Yii::getAlias('@webroot') . self::TEMP_FOLDER;
return Yii::getAlias('@frontend/web') . self::PHOTO_FOLDER;
}
public function upload()
{
if($this->validate())
if ($this->validate())
{
if(!file_exists($this->getPath()))
{
mkdir($this->getPath(), 0777, true);
}
$this->photo = $this->getPath() . date('dmYHis-') . uniqid() . '.' . $this->file->extension;
$this->file->saveAs($this->photo);
$this->photo = date('dmYHis-') . uniqid() . '.' . $this->image->extension;
$this->image->saveAs($this->getPath() . $this->photo);
return true;
}
else
......
......@@ -40,7 +40,7 @@ use yii\helpers\Html;
</ol>
<span style="color: red;">Важно!</span> Не используйте клавишу ENTER для перевода строки при заполнении шаблона. Если это необходимо, пользуйтесь вместо этого тегом <strong><span style="color: red">&lt;br&gt;</span></strong>.
<div class="message info">Внимание! Для правильной работы модуля CSV-импорта необходимо корректно заполнять шаблон. Любое отхождение от шаблона (пустая строка, добавленный столбец) может нарушить работу данной системы.</div>
<div class="message info">Внимание! Для правильной работы модуля XLS-импорта необходимо корректно заполнять шаблон. Любое отхождение от шаблона (пустая строка, добавленный столбец) может нарушить работу данной системы.</div>
<hr>
......
......@@ -13,11 +13,11 @@ class m160126_110636_fix_review_table extends Migration
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
}
$this->addColumn('reviews', 'title', Schema::TYPE_STRING . '(255) AFTER `user_id`');
$this->addColumn('reviews', 'video', Schema::TYPE_STRING . '(255) AFTER `photo`');
}
public function safeDown()
{
$this->dropColumn('reviews', 'title');
$this->dropColumn('reviews', 'video');
}
}
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160126_143450_fix_co_blocks_table extends Migration
{
public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql')
{
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
}
$this->alterColumn('co_blocks', 'category_id', Schema::TYPE_INTEGER . '(11) NULL');
}
public function safeDown()
{
$this->alterColumn('co_blocks', 'category_id', Schema::TYPE_INTEGER . '(11) NOT NULL');
}
}
<?php
use yii\db\Migration;
class m160126_164000_add_languages extends Migration
{
public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql')
{
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
}
$this->insert('languages', [
'code' => 'ru',
'codeFull' => 'rus',
'name' => 'Русский',
]);
$this->insert('languages', [
'code' => 'en',
'codeFull' => 'eng',
'name' => 'English',
]);
}
public function safeDown()
{
$this->delete('languages', ['code' => 'ru']);
$this->delete('languages', ['code' => 'en']);
}
}
......@@ -145,7 +145,11 @@ return [
'showScriptName' => false,
'enableStrictParsing' => true,
'rules' => [
//TEMP
'keys' => 'site/keys',
'contacts' => 'site/contacts',
['pattern' => 'sitemap', 'route' => 'sitemap/default/index', 'suffix' => '.xml'],
'source/<_u>/<_f>/<file>' => '@backend/web/<_u>/<_f>/<file>',
'' => 'content/page/view',
......
......@@ -32,13 +32,31 @@ class SiteController extends BaseController
public static function actionsTitles(){
return [
'Index' => 'Главная страница',
'Index' => 'Главная страница',
'Contacts' => 'Контакты',
'Keys' => 'Кейсы',
'Error' => 'Error',
'Login' => '',
'Logout' => '',
];
}
// TEMP
public function actionContacts()
{
return $this->render('contacts');
}
// TEMP
public function actionKeys()
{
return $this->render('keys');
}
/**
* @inheritdoc
*/
......@@ -91,7 +109,7 @@ class SiteController extends BaseController
$model = \common\modules\content\models\CoContent::findOne(['url' => 'site/error']);
$content = $model->getContent();
$this->meta_title = $model->metaTags->title;
$this->meta_title = $model->metaTags->title . ' - ' . \Yii::$app->params['name'];
$this->meta_description = $model->metaTags->description;
$this->meta_keywords = $model->metaTags->keywords;
......
<?php
use \common\modules\reviews\models\Reviews;
use yii\helpers\Html;
$reviews = Reviews::find()
->where(['state' => 'active'])
->orderBy('created_at DESC')
->limit(2)
->all();
?>
<?php if($reviews) : ?>
<section class="rev_sec">
<div class="container">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<span class="rev_title">Отзывы о нас</span>
</div>
</div>
<?php foreach ($reviews as $review) : ?>
<?php if(!$review->video) : ?>
<div class="row">
<?php if($review->photo) : ?>
<div class="col-md-3 col-xs-4 col-sm-12">
<div class="rev_img">
<?=Html::img(Reviews::PHOTO_FOLDER . $review->photo);?>
</div>
</div>
<?php endif; ?>
<div class="col-md-8 col-xs-8 col-sm-12">
<div class="rev_name"><?=$review->title?></div>
<div class="rev_txt"><?=$review->text?></div>
<!-- <div class="rev_txt">Мы работаем с компанией ООО «Арт Проект» с 2010 года. Компания оказывает нам услуги по созданию информационного портала и его дальнейшей поддержке в сети Интернет. В процессе разработки было составлено подробное техническое задание, которое позволило учесть все нюансы и разработать необходимый функционал для полноценной работы сайта. Компанией ООО «Арт Проект» были предложены рациональные и удобные функциональные решения, которые позволили нам самостоятельно создавать,
<div class="line_hide_rev"></div>
</div>
<div class="rev_txt_hide">редактировать и управлять информацией на сайте в режиме он-лайн. Для нашего проекта было разработано и внедрено несколько </div>
<div class="rev__hide__btn">Подробнее</div> -->
</div>
</div>
<?php else : ?>
<div class="rev_video_block">
<div class="row">
<div class="col-md-6 col-xs-12 col-sm-12">
<div class="rev_video">
<iframe width="417" height="199" src="<?=$review->video?>" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="col-md-6 col-xs-12 col-sm-12">
<div class="rev_video_name"><?=$review->title?></div>
<div class="rev_video_desc">
<?=$review->text?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<a href="/otzyvy-art-proekt" class="all_rev__btn">Смотреть все отзывы</a>
</div>
</section>
<?php endif; ?>
\ No newline at end of file
......@@ -27,12 +27,13 @@ AppAsset::register($this);
<nav class="menu">
<div class="toggle_block"><a href="#" class="toggle-mnu"><span></span></a></div>
<div class="phone_menu">8-495-961-42-29</div>
<div class="phone_menu">8-495-749-29-69</div>
<ul>
<li><a href="/about" class="link">О компании</a></li>
<li><a href="#" class="link">Кейсы</a></li>
<li><a href="/keys" class="link">Кейсы</a></li>
<li><a href="#" class="link">Блог</a></li>
<li><a href="/school" class="link">Школа аналитики</a></li>
<li><a href="#" class="link">Контакты</a></li>
<li><a href="/contacts" class="link">Контакты</a></li>
</ul>
</nav>
......@@ -48,9 +49,10 @@ AppAsset::register($this);
<nav class="top_nav clearfix">
<ul>
<li><a href="/about">О компании</a></li>
<li><a href="#">Кейсы</a></li>
<li><a href="/keys">Кейсы</a></li>
<li><a href="#">Блог</a></li>
<li><a href="/school">Школа аналитики</a></li>
<li><a href="#">Контакты</a></li>
<li><a href="/contacts">Контакты</a></li>
</ul>
</nav>
<div class="lang_check">
......@@ -59,7 +61,7 @@ AppAsset::register($this);
</div>
</div>
<div class="col-md-3 col-xs-3 col-sm-12">
<span class="top_phone">8-495-961-42-29</span>
<span class="top_phone">8-495-749-29-69</span>
<div class="phone_hover_head">Стоимость звонка 0 руб,<br/> в том числе с мобильного</div>
</div>
</div>
......
<section class="section1_cont">
<div class="container">
<div class="row">
<duv class="col-md-5 col-xs-12 col-sm-12">
<h1>Контакная информация</h1>
</duv>
</div>
<div class="row">
<div class="col-md-7 col-xs-6 col-sm 12">
<div class="cont_block">
<div class="cont_block__city">Москва</div>
<div class="cont_block__phone"><strong>Телефон:</strong> +7 (495) 749 29 69</div>
<div class="cont_block__link_pp"><a href="#zvonok_form" class="popup-form">Заказать обратный звонок</a></div>
<div class="cont_block__email"><strong>E-mail:</strong> info@task-on.com</div>
<div class="cont_block__adr"><strong>Адрес:</strong> 119270, РФ, г. Москва, Лужнецкая<br/> набережная, д. 10 а, стр. 2</div>
</div>
<a href="#tabmap" class="view_sheme_link scrollto">Смотреть схему</a>
</div>
<div class="col-md-5 col-xs-6 col-sm 12">
<div class="cont_block">
<div class="cont_block__city">Казань</div>
<div class="cont_block__phone"><strong>Телефон:</strong> +7 (123) 456 78 90</div>
<div class="cont_block__link_pp"><a href="#zvonok_form" class="popup-form">Заказать обратный звонок</a></div>
<div class="cont_block__email"><strong>E-mail:</strong> info@task-on.com</div>
<div class="cont_block__adr"><strong>Адрес:</strong> 000000, РФ, г. Иннополис,<br/> ул. Спортивная, д. 114 офис 1001</div>
</div>
<a href="#tabmap" class="view_sheme_link scrollto">Смотреть схему</a>
</div>
</div>
</div>
</section>
<section class="sect_support_cont">
<div class="container">
<div class="row">
<duv class="col-md-5 col-xs-12 col-sm-12">
<h1>Техническая поддержка</h1>
</duv>
</div>
<div class="row">
<div class="col-md-7 col-xs-6 col-sm 12">
<div class="support_block">
<div class="support_block__phones">Телефоны:</div>
<div class="support_block__phones_itm">+7 (495) 749 29 69</div>
<div class="support_block__phones_itm">+7 (495) 961 42 29</div>
<div class="support_block__link_pp"><a href="#zvonok_form" class="popup-form">Заказать обратный звонок</a></div>
</div>
</div>
<div class="col-md-5 col-xs-6 col-sm 12">
<div class="support_block">
<div class="support_block__txt">Для вашего удобства мы подготовили видео в котором рассказывается как правильно ставить задачу в отдел технической поддержки.</div>
<div class="support_block__link_pv"><a href="#" class="">Смотреть видео</a></div>
</div>
</div>
</div>
</div>
</section>
<section class="sect_cont_forma">
<div class="container">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<h1>Отправить сообщение с сайта</h1>
</div>
</div>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="sect_cont_block">
<form class="sect_cont_form" id="form_foot">
<input type="text" placeholder="Ваше имя*" name="name" class="sect_cont_form__input field-input required alphanumeric">
<input type="tel" placeholder="Телефон*" name="phone" class="sect_cont_form__input field-input required alphanumeric">
<textarea placeholder="Текст сообщения" class="sect_cont_form__textarea"></textarea>
<div class="file-upload_block_cs">
<div class="file_upload_bt_cs">
<div class="file-upload_cs">
<label>
<input type="file" name="file">
<span>Выбрать файл</span>
</label>
</div>
<input type="text" id="filename" class="filename_cs" disabled>
<div class="file_drop_cs">Перетащите файл в данную область<br/> или выберите файл с компьютера</div>
</div>
</div>
<button class="btn-default save-button">Отправить</button>
</form>
</div>
</div>
</div>
</div>
</section>
<section class="sect_map">
<div class="container">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<h1>Как добраться</h1>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="tabs">
<span class="tab_map" id="tabmap">Офис в Москве</span>
<span class="tab_map tab_kaz" id="tabmap">Офис в Казани</span>
</div>
</div>
</div>
</div>
<div class="tab_content">
<div class="tab_item">
<img src="images/map.jpg" height="748" width="1920" alt="">
</div>
<div class="tab_item">
<img src="images/map.jpg" height="748" width="1920" alt="">
</div>
</div>
</section>
<footer style="padding-top:70px">
<div class="container">
<div class="row">
<div class="col-md-4 col-xs-4 col-sm-12">
<a href="mailto:info@task-on.com" class="foot_mail">info@task-on.com</a>
</div>
<div class="col-md-4 col-xs-4 col-sm-12"><a href="#zvonok_form" class="zvonok_bt popup-form"><span>Заказать звонок</span></a></div>
<div class="col-md-4 col-xs-4 col-sm-12">
<div class="phone_hover_foot">Стоимость звонка 0 руб,<br/> в том числе с мобильного</div>
<span class="foot_phone">8-800-2000-600</span>
</div>
</div>
<div class="footbottom_line">
<div class="row">
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="foot_logo">
<img src="images/foot_logo.png" height="51" width="192" alt="">
</div>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
<ul class="social_link">
<li><a href="#" class="soc_item"><i class="fa fa-vk"></i></a></li>
<li><a href="#" class="soc_item"><i class="fbicon"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-youtube"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-instagram"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" class="soc_item"><i class="gplusicon"></i></a></li>
</ul>
</div>
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="taskon"><img src="images/taskon.png" height="31" width="100" alt=""></div>
<div class="copyring">Powered by Taskon <br /> Собственная разработка Арт Проект</div>
</div>
</div>
</div>
</div>
</footer>
<div class="hidden">
<div id="zvonok_form" class="popup">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<span class="popup__title">Заказать звонок</span>
<span class="popup__subtittle">Чтобы мы могли вам перезвонить укажите свой номер телефона:</span>
<form class="valid_form">
<input type="text" class="input_st field-input required alphanumeric" placeholder="Ваше имя">
<input type="tel" class="input_st field-input required email" placeholder="Ваш телефон">
<button class="save-button popup_bt_send">Заказать звонок</button>
</form>
</div>
<div id="reg_form" class="popup">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<span class="popup__title">Регистрация</span>
<form class="validreg_form">
<input type="text" class="input_st field-input required alphanumeric" placeholder="Имя Фамилия">
<input type="tel" class="input_st field-input required alphanumeric" placeholder="Телефон">
<input type="email" class="input_st field-input required email" placeholder="E-mail">
<input type="password" class="input_st field-input required alphanumeric" placeholder="Придумайте пароль">
<input type="password" class="input_st field-input required alphanumeric" placeholder="Повторите пароль">
<button class="save-button popup_bt_send">Зарегистрироваться</button>
</form>
</div>
</div>
\ No newline at end of file
<section class="keys_list_bl">
<div class="container">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<h1>Кейсы нашей компании</h1>
<p>Здесь представлены проекты, которые нам запомнились или стали историей не только для наших заказчиков, но и для нашей команды в целом.</p>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6 col-sm-12">
<div class="keys_block_small">
<img src="images/keys_small1.jpg" height="338" width="455" alt="">
<div class="keys_small_title">Он-лайн сервис по подбору аналогов оборудования</div>
<div class="keys_small_foot">
<a href="http://mikulin.cz/project/artproject/keys_kns.html" class="keys_small_btn_more"><span>Подробнее</span></a>
<a href="#" class="keys_small_tags"># Big data</a>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
<div class="keys_block_small">
<img src="images/keys_small2.jpg" height="338" width="455" alt="">
<div class="keys_small_title">Автоматизация освещения на АЗС</div>
<div class="keys_small_foot">
<a href="#" class="keys_small_btn_more"><span>Подробнее</span></a>
<a href="#" class="keys_small_tags"># Big data</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="keys_block_big">
<picture>
<source srcset="images/keys_big338.jpg" media="(max-width: 768px)">
<img src="images/keys_big1.jpg" height="338" width="940" alt="">
</picture>
<div class="keys_small_title">Он-лайн сервис по подбору аналогов оборудования</div>
<div class="keys_small_foot">
<a href="#" class="keys_small_btn_more"><span>Подробнее</span></a>
<a href="#" class="keys_small_tags"># Big data</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="keys_send_mail">
<p>Процесс создания кейса очень трудоемкий.Поэтому мы занимаемся созданием кейсов свободное от работы время. Подпишитесь, чтобы следить за обновлениями.</p>
<form class="keys_mail_form">
<input type="email" placeholder="E-mail*" class="field-input required email"></input>
<button class="save-button">Подписаться</button>
</form>
<div class="send_secce">Вы успешно подписались на обновление раздела «Кейсы». Нам приятно, что вы следите за нашим развитием :-)</div>
</div>
</div>
</div>
</div>
</section>
<footer style="padding-top:70px">
<div class="container">
<div class="row">
<div class="col-md-4 col-xs-4 col-sm-12">
<a href="mailto:info@task-on.com" class="foot_mail">info@task-on.com</a>
</div>
<div class="col-md-4 col-xs-4 col-sm-12"><a href="#zvonok_form" class="zvonok_bt popup-form"><span>Заказать звонок</span></a></div>
<div class="col-md-4 col-xs-4 col-sm-12">
<div class="phone_hover_foot">Стоимость звонка 0 руб,<br/> в том числе с мобильного</div>
<span class="foot_phone">8-800-2000-600</span>
</div>
</div>
<div class="footbottom_line">
<div class="row">
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="foot_logo">
<img src="images/foot_logo.png" height="51" width="192" alt="">
</div>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
<ul class="social_link">
<li><a href="#" class="soc_item"><i class="fa fa-vk"></i></a></li>
<li><a href="#" class="soc_item"><i class="fbicon"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-youtube"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-instagram"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" class="soc_item"><i class="gplusicon"></i></a></li>
</ul>
</div>
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="taskon"><img src="images/taskon.png" height="31" width="100" alt=""></div>
<div class="copyring">Powered by Taskon <br /> Собственная разработка Арт Проект</div>
</div>
</div>
</div>
</div>
</footer>
<div class="hidden">
<div id="zvonok_form" class="popup">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<span class="popup__title">Заказать звонок</span>
<span class="popup__subtittle">Чтобы мы могли вам перезвонить укажите свой номер телефона:</span>
<form class="valid_form">
<input type="text" class="input_st field-input required alphanumeric" placeholder="Ваше имя">
<input type="tel" class="input_st field-input required email" placeholder="Ваш телефон">
<button class="save-button popup_bt_send">Заказать звонок</button>
</form>
</div>
<div id="reg_form" class="popup">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<span class="popup__title">Регистрация</span>
<form class="validreg_form">
<input type="text" class="input_st field-input required alphanumeric" placeholder="Имя Фамилия">
<input type="tel" class="input_st field-input required alphanumeric" placeholder="Телефон">
<input type="email" class="input_st field-input required email" placeholder="E-mail">
<input type="password" class="input_st field-input required alphanumeric" placeholder="Придумайте пароль">
<input type="password" class="input_st field-input required alphanumeric" placeholder="Повторите пароль">
<button class="save-button popup_bt_send">Зарегистрироваться</button>
</form>
</div>
</div>
\ No newline at end of file
/index.php
/index-test.php
/assets
\ No newline at end of file
/assets
/uploads/reviews/*
\ No newline at end of file
This diff is collapsed.
......@@ -358,6 +358,11 @@ $(document).ready(function() {
container: '.sh_reg_form',
});
});
$(function () {
window.validation.init({
container: '.keys_mail_form',
});
});
$(".toggle-mnu").click(function () {
$(".menu").toggleClass("menu_active");
});
......@@ -378,13 +383,29 @@ $(window).scroll(function() {
var st = $(this).scrollTop();
$(".p5").css({
"transform" : "translate(0%, -" + st *1 + "%"
"transform" : "translate(0%, -" + st /1 + "%"
});
$(".p6").css({
"transform" : "translate(0%, -" + st + "%"
"transform" : "translate(0%, -" + st /3 + "%"
});
$(".p7").css({
"transform" : "translate(0%, -" + st /0.8 + "%"
"transform" : "translate(0%, -" + st /6 + "%"
});
});
$(window).scroll(function() {
var st = $(this).scrollTop();
$(".kns_box4").css({
"transform" : "translate(0%, -" + st /1 + "%"
});
$(".kns_box2").css({
"transform" : "translate(0%, -" + st /1 + "%"
});
$(".kns_box1").css({
"transform" : "translate(0%, -" + st /10 + "%"
});
$(".kns_box3").css({
"transform" : "translate(0%, -" + st /13 + "%"
});
});
jQuery(function($){
......
This diff is collapsed.
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