Commit c4d9fc54 authored by Шакарим Сапа's avatar Шакарим Сапа

Merge remote-tracking branch 'origin/master'

parents 4ad92ff2 1c5848e3
......@@ -22,6 +22,7 @@ class BlockAdminController extends AdminController
'Manage' => 'Управление блоками',
'Create' => 'Добавление блока',
'Update' => 'Редактирование блока',
'Copy' => 'Копирование блока',
'Delete' => 'Удаление блока',
'View' => 'Просмотр блока',
];
......@@ -156,6 +157,47 @@ class BlockAdminController extends AdminController
]);
}
public function actionCopy($id)
{
$model = $this->findModel($id);
$model->name = $model->title = null;
Yii::$app->controller->page_title = 'Копировать блок';
Yii::$app->controller->breadcrumbs = [
['Управление блоками' => \yii\helpers\Url::toRoute('manage')],
'Копировать блок',
];
if (Yii::$app->request->isPost)
{
$transaction = Yii::$app->db->beginTransaction();
try
{
$model = new CoBlocks;
$model->attributes = Yii::$app->request->post('CoBlocks');
if($model->save())
{
$transaction->commit();
return $this->redirect(['manage']);
}
}
catch (\Exception $e)
{
$transaction->rollBack();
throw $e;
}
}
return $this->render('update', [
'model' => $model,
]);
}
/**
* Deletes an existing CoBlocks model.
* If deletion is successful, the browser will be redirected to the 'index' page.
......
......@@ -178,56 +178,41 @@ class ContentAdminController extends AdminController
{
$model = $this->findModel($id);
$transaction = Yii::$app->db->beginTransaction();
$model->url = null;
try
{
$copy = new CoContent();
Yii::$app->controller->page_title = 'Копирование страницы';
$data = $model->attributes;
unset($data['id']);
$copy->setAttributes($data);
$copy->save(false);
Yii::$app->controller->breadcrumbs = [
['Управление контентом' => \yii\helpers\Url::toRoute('manage')],
$model->url,
];
if($model->metaTags)
{
foreach ($model->metaTags as $mt)
if (Yii::$app->request->isPost)
{
$mtn = new \common\models\MetaTags;
$data = $mt->attributes;
unset($data['id']);
$mtn->setAttributes($data);
$mtn->object_id = $copy->id;
$mtn->save(false);
}
}
$transaction = Yii::$app->db->beginTransaction();
if($model->langs)
{
foreach ($model->langs as $lang)
try
{
$lng = new CoContentLang;
$model = new CoContent;
$data = $lang->attributes;
unset($data['id']);
$lng->setAttributes($data);
$lng->name .= ' (Копия)';
$lng->content_id = $copy->id;
$lng->save(false);
}
}
$model->attributes = Yii::$app->request->post('CoContent');
if($model->save())
{
$transaction->commit();
return $this->redirect(['manage']);
}
catch (Exception $e)
}
catch (\Exception $e)
{
$transaction->rollBack();
throw $e;
}
}
$this->redirect(['manage']);
return $this->render('update', [
'model' => $model,
]);
}
/**
......
......@@ -43,7 +43,7 @@ class CoBlocks extends \common\components\ActiveRecordModel
'class' => 'common\modules\languages\components\LanguageHelperBehavior',
'field' => 'block_id',
'langClass' => 'common\modules\content\models\CoBlocksLang',
'actions' => ['create', 'update']
'actions' => ['create', 'update', 'copy']
],
];
}
......@@ -55,6 +55,7 @@ class CoBlocks extends \common\components\ActiveRecordModel
{
return [
[['title', 'name'], 'required'],
[['title'], 'unique'],
[['category_id'], 'safe'],
[['title'], 'string', 'max' => 250],
[['name'], 'string', 'max' => 50],
......
......@@ -32,6 +32,8 @@ class CoContent extends \common\components\ActiveRecordModel
const CUSTOM_DARK = 'dark';
const CUSTOM_WHITE = 'white';
public $copyLangs;
public static $cutom_list = [
self::CUSTOM_DARK => 'Темный',
self::CUSTOM_WHITE => 'Светлый',
......@@ -53,13 +55,13 @@ class CoContent extends \common\components\ActiveRecordModel
return [
'meta' => [
'class' => 'common\components\activeRecordBehaviors\MetaTagBehavior',
'actions' => ['create', 'update']
'actions' => ['create', 'update', 'copy']
],
'langs' => [
'class' => 'common\modules\languages\components\LanguageHelperBehavior',
'field' => 'content_id',
'langClass' => 'common\modules\content\models\CoContentLang',
'actions' => ['create', 'update']
'actions' => ['create', 'update', 'copy']
],
'file' => [
'class' => 'common\components\activeRecordBehaviors\FileUploadBehavior',
......
<?php
use yii\helpers\Html;
use yii\helpers\Url;
use \yii\helpers\ArrayHelper;
use \common\modules\content\models\CoCategory;
/* @var $this yii\web\View */
......@@ -44,9 +45,17 @@ use \common\modules\content\models\CoCategory;
[
'class' => 'common\components\ColorActionColumn',
'template' => '{update} {delete}',
]
,
'template' => '{copy} {update} {delete}',
'buttons' => [
'copy' => function ($url, $model, $key) {
return '<a href="'.Url::toRoute(['copy', 'id' => $model->id]).'">'.Html::beginTag('i', [
'title' => "Копировать блок",
'data-toggle' => 'tooltip',
'class' => 'fa fa-copy fa-lg'
]) . Html::endTag('i') . '</a>';
},
],
],
],
]); ?>
......
......@@ -133,7 +133,7 @@ class LanguageHelperBehavior extends Behavior
public function Delete($event)
{
if($this->owner->langs)
if(isset($this->owner->langs))
{
foreach ($this->owner->langs as $lang)
{
......
......@@ -42,14 +42,6 @@ class DefaultController extends Controller
];
}
public static function actionsTitles()
{
return [
'Login' => 'Авторизация',
'Logout' => 'Выход',
];
}
public function actionLogin()
{
$this->page_title = 'Техническая поддержка';
......
......@@ -5,11 +5,14 @@ namespace common\modules\support\controllers;
use Yii;
use yii\filters\AccessControl;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\web\Controller;
use yii\web\Response;
use yii\web\NotFoundHttpException;
use common\models\Settings;
use common\modules\support\models\redmine\Issue;
use common\modules\support\models\redmine\RedmineHelper;
/**
* Default controller for the `support` module
......@@ -26,11 +29,11 @@ class SupportController extends Controller
'access' => [
'class' => AccessControl::className(),
'user' => 'support',
'only' => ['index'],
'only' => ['index', 'create', 'view', 'file'],
'rules' => [
[
'allow' => true,
'actions' => ['index'],
'actions' => ['index', 'create', 'view', 'file'],
'roles' => ['@'],
],
],
......@@ -38,13 +41,6 @@ class SupportController extends Controller
];
}
public static function actionsTitles()
{
return [
'Index' => 'Техническая поддержка',
];
}
public function actionIndex()
{
$client = $this->getClient();
......@@ -73,7 +69,10 @@ class SupportController extends Controller
public function actionCreate()
{
$this->view->registerJsFile('/js/support.js', ['position' => yii\web\View::POS_END ]);
$model = new Issue();
$model->setScenario(Issue::SCENARIO_CREATE);
$client = $this->getClient();
......@@ -81,7 +80,7 @@ class SupportController extends Controller
if ($model->load(Yii::$app->request->post()) && $model->validate())
{
$client->issue->create([
$params = [
'subject' => $model->subject,
'description' => $model->description,
'project_id' => $model->project_id,
......@@ -89,21 +88,41 @@ class SupportController extends Controller
'status_id' => $model->status_id,
'tracker_id' => $model->tracker_id,
'author_id' => $user['user']['id']
];
if($model->files)
{
$uploads = [];
foreach ($model->files as $file)
{
$uploads[] = [
'token' => $file['token'],
'filename' => $file['filename'],
'content_type' => $file['type'],
];
}
$params = ArrayHelper::merge($params, [
'uploads' => $uploads
]);
}
$client->issue->create($params);
return $this->redirect(['/support']);
}
else
{
return $this->render('create', [
'model' => $model,
'user' => $user
]);
}
}
public function actionView($id)
{
$this->view->registerJsFile('/js/support.js', ['position' => yii\web\View::POS_END ]);
$client = $this->getClient();
$user = $client->user->getCurrentUser();
......@@ -120,10 +139,94 @@ class SupportController extends Controller
throw new NotFoundHttpException('Доступ запрещен!');
}
$issue = new Issue();
$issue->setScenario(Issue::SCENARIO_UPDATE);
if ($issue->load(Yii::$app->request->post()) && $issue->validate())
{
$params = [
'notes' => $issue->notes,
];
if($issue->files)
{
$uploads = [];
foreach ($issue->files as $file)
{
$uploads[] = [
'token' => $file['token'],
'filename' => $file['filename'],
'content_type' => $file['type'],
];
}
$params = ArrayHelper::merge($params, [
'uploads' => $uploads
]);
}
$client->issue->update($id, $params);
return $this->refresh();
}
return $this->render('view', [
'model' => $model['issue'],
'issue' => $issue
]);
}
public function actionFile()
{
if(Yii::$app->request->isAjax)
{
Yii::$app->response->format = Response::FORMAT_JSON;
try
{
if($_FILES['files'])
{
$client = $this->getClient();
$html = '';
foreach ($_FILES['files']['name'] as $i => $name)
{
if($_FILES['files']['size'][$i] <= RedmineHelper::MAX_FILE_SIZE)
{
$response = json_decode($client->attachment->upload(@file_get_contents($_FILES['files']['tmp_name'][$i])));
$html .= $this->renderPartial('_file', [
'name' => $name,
'size' => RedmineHelper::formatSize($_FILES['files']['size'][$i]),
'token' => $response->upload->token,
'type' => $_FILES['files']['type'][$i]
]);
}
else
{
$html .= Html::tag('div', 'Превышен максимально допустимый размер файла&nbsp;&nbsp;<a class="delete-file" href="#"><span class="glyphicon glyphicon-remove color_gray"></span></a>', ['class'=>'file_box_wr']);
}
}
return [
'html' => $html,
'success' => true
];
}
}
catch (Exception $e)
{
return ['success' => false];
}
return ['success' => false];
}
else
{
throw new NotFoundHttpException('Доступ запрещен!');
}
}
protected function getClient()
{
......
......@@ -13,6 +13,9 @@ class Issue extends yii\base\Model
public $author_id;
public $tracker_id = self::TRACKER_NONE;
public $status_id = self::STATUS_NEW;
public $notes;
public $files = null;
const PRIORITY_SIMPLE = 2;
const PRIORITY_FIRE = 3;
......@@ -21,16 +24,26 @@ class Issue extends yii\base\Model
const STATUS_NEW = 7;
const SCENARIO_CREATE = 'create';
const SCENARIO_UPDATE = 'update';
/**
* @inheritdoc
*/
public function rules()
{
return [
[['tracker_id', 'project_id', 'status_id', 'priority_id', 'description'], 'required'],
[['tracker_id', 'project_id', 'status_id', 'priority_id'], 'integer'],
[['description'], 'string'],
[['subject'], 'string', 'max' => 255],
[['notes'], 'required', 'on' => self::SCENARIO_UPDATE],
[['tracker_id', 'status_id', 'priority_id'], 'required', 'on' => self::SCENARIO_CREATE],
[['project_id'], 'required', 'message' => 'Выберите проект, к которому относится новая задача', 'on' => self::SCENARIO_CREATE],
[['subject'], 'required', 'message' => 'Введите наименование задачи', 'on' => self::SCENARIO_CREATE],
[['description'], 'required', 'message' => 'Укажите описание задачи', 'on' => self::SCENARIO_CREATE],
[['tracker_id', 'project_id', 'status_id', 'priority_id'], 'integer', 'on' => self::SCENARIO_CREATE],
[['description'], 'string', 'on' => self::SCENARIO_CREATE],
[['subject'], 'string', 'max' => 255, 'on' => self::SCENARIO_CREATE],
[['files', 'notes'], 'safe'],
];
}
......@@ -47,6 +60,7 @@ class Issue extends yii\base\Model
'description' => 'Текст задачи',
'priority_id' => 'Важность',
'status_id' => 'Статус',
'notes' => 'Комментарий',
];
}
......
......@@ -6,6 +6,85 @@ use common\models\Settings;
class RedmineHelper
{
const MAX_FILE_SIZE = 5242880; //5mb
public static $markupSet = [
[
'name' => 'Жирный',
'className' => 'fa fa-bold',
'openWith' => '*',
'closeWith' => '*'
],
[
'name' => 'Курсив',
'className' => 'fa fa-italic',
'openWith' => '_',
'closeWith' => '_'
],
[
'name' => 'Подчеркнутый',
'className' => 'fa fa-underline',
'openWith' => '+',
'closeWith' => '+'
],
[
'name' => 'Зачеркнутый',
'className' => 'fa fa-strikethrough',
'openWith' => '-',
'closeWith' => '-'
],
['separator' => '---------------'],
[
'name' => 'Заголовок 1',
'className' => 'fa fa-header header-1',
'openWith' => 'h1. ',
'closeWith' => ''
],
[
'name' => 'Заголовок 2',
'className' => 'fa fa-header header-2',
'openWith' => 'h2. ',
'closeWith' => ''
],
[
'name' => 'Заголовок 3',
'className' => 'fa fa-header header-3',
'openWith' => 'h3. ',
'closeWith' => ''
],
['separator' => '---------------'],
[
'name' => 'Маркированный список',
'className' => 'fa fa-list-ul',
'openWith' => '* ',
'multiline' => true,
'openBlockWith' => "",
'closeBlockWith' => ""
],
[
'name' => 'Нумерованный список',
'className' => 'fa fa-list-ol',
'openWith' => '# ',
'multiline' => true,
'openBlockWith' => "",
'closeBlockWith' => ""
],
['separator' => '---------------'],
[
'name' => 'Заранее форматированный тест',
'className' => 'fa fa-newspaper-o',
'openWith' => '<pre>',
'closeWith' => '</pre>'
],
['separator' => '---------------'],
[
'name' => 'Вставка изображения',
'className' => 'fa fa-picture-o',
'openWith' => '!',
'closeWith' => '!'
],
];
public static function sortIsuues($issues = null)
{
if($issues)
......@@ -78,4 +157,17 @@ class RedmineHelper
return $memberships;
}
public static function formatSize($value)
{
$units=array('B','KB','MB','GB','TB');
$base = 1024;
for($i = 0; $base <= $value; $i++)
{
$value=$value/$base;
}
return round($value, 2) . ' ' . $units[$i];
}
}
\ No newline at end of file
<?php
$id = uniqid();
?>
<div class="file_box_wr">
<span class="glyphicon glyphicon-file"></span>
<span><?=$name?></span> &nbsp;
<span class="color_gray">&nbsp;<?=$size?>&nbsp;&nbsp;</span>
<a class="delete-file" href="#"><span class="glyphicon glyphicon-remove color_gray"></span></a>
<input type="hidden" name="Issue[files][<?=$id?>][token]" value="<?=$token?>">
<input type="hidden" name="Issue[files][<?=$id?>][filename]" value="<?=$name?>">
<input type="hidden" name="Issue[files][<?=$id?>][type]" value="<?=$type?>">
</div>
\ No newline at end of file
......@@ -8,7 +8,7 @@ use common\modules\support\models\redmine\RedmineHelper;
?>
<div class="container_white">
<div class="container_white support-block">
<div class="container">
<div class="right_box_top row">
......@@ -28,15 +28,15 @@ use common\modules\support\models\redmine\RedmineHelper;
<div class="row">
<div class="col-sm-12">
<?=$form->field($model, 'subject', ['template' => "<p class='label_p'><strong>{label}</strong></p>\n{input}\n{hint}\n{error}"])->textInput(['maxlength' => 255, 'placeholder' => 'Дизайн оформления витринных окон для ресторана Subway'])?>
</div>
<div class="col-md-3 col-xs-6 col-sm-12">
<?php $projects = RedmineHelper::sortMemberships($user['user']['memberships']) ?>
<?=$form->field($model, 'project_id', ['template' => "<p class='label_p'><strong>{label}</strong></p>\n{input}\n{hint}\n{error}"])->dropDownList($projects, (count($projects)>1?['prompt' => 'Выберите проект']:[]))?>
</div>
<div class="col-md-3 col-xs-6 col-sm-12">
<div class="col-sm-12">
<?=$form->field($model, 'subject', ['template' => "<p class='label_p'><strong>{label}</strong></p>\n{input}\n{hint}\n{error}"])->textInput(['maxlength' => 255, 'placeholder' => 'Дизайн оформления витринных окон для ресторана Subway'])?>
</div>
<div class="col-sm-12">
<?=$form->field($model, 'priority_id', ['template' => "<p class='label_p'><strong>{label}</strong></p>\n<div class='important_box important_button_text'>
{input}
<p class='important_button_text_1'>Важная</p>
......@@ -53,82 +53,7 @@ use common\modules\support\models\redmine\RedmineHelper;
<?=$form->field($model, 'description', ['template' => "<p class='label_p'><strong>{label}</strong></p>\n{input}<br>{hint}{error}"])->widget(\coderlex\markitup\MarkItUp::className(), [
'options' => ['class' => 'form-control', 'style' => 'overflow:auto;resize:none;width:100%;min-height:200px;'],
'clientOptions' => [
'markupSet' => [
[
'name' => 'Жирный',
'className' => 'fa fa-bold',
'openWith' => '*',
'closeWith' => '*'
],
[
'name' => 'Курсив',
'className' => 'fa fa-italic',
'openWith' => '_',
'closeWith' => '_'
],
[
'name' => 'Подчеркнутый',
'className' => 'fa fa-underline',
'openWith' => '+',
'closeWith' => '+'
],
[
'name' => 'Зачеркнутый',
'className' => 'fa fa-strikethrough',
'openWith' => '-',
'closeWith' => '-'
],
['separator' => '---------------'],
[
'name' => 'Заголовок 1',
'className' => 'fa fa-header header-1',
'openWith' => 'h1. ',
'closeWith' => ''
],
[
'name' => 'Заголовок 2',
'className' => 'fa fa-header header-2',
'openWith' => 'h2. ',
'closeWith' => ''
],
[
'name' => 'Заголовок 3',
'className' => 'fa fa-header header-3',
'openWith' => 'h3. ',
'closeWith' => ''
],
['separator' => '---------------'],
[
'name' => 'Маркированный список',
'className' => 'fa fa-list-ul',
'openWith' => '* ',
'multiline' => true,
'openBlockWith' => "",
'closeBlockWith' => ""
],
[
'name' => 'Нумерованный список',
'className' => 'fa fa-list-ol',
'openWith' => '# ',
'multiline' => true,
'openBlockWith' => "",
'closeBlockWith' => ""
],
['separator' => '---------------'],
[
'name' => 'Заранее форматированный тест',
'className' => 'fa fa-newspaper-o',
'openWith' => '<pre>',
'closeWith' => '</pre>'
],
['separator' => '---------------'],
[
'name' => 'Вставка изображения',
'className' => 'fa fa-picture-o',
'openWith' => '!',
'closeWith' => '!'
],
]
'markupSet' => RedmineHelper::$markupSet
],
])?>
......@@ -139,7 +64,13 @@ use common\modules\support\models\redmine\RedmineHelper;
<div class="col-sm-12">
<button class="gray_button">Прикрепить файл<i class="glyphicon glyphicon-paperclip"></i></button>
<div id="file-container">
</div>
<input type="file" id="file-attachment-input" style="display:none;" multiple="multiple">
<div class="gray_button attachment-button">Прикрепить файл<i class="glyphicon glyphicon-paperclip"></i></div>
<br>
<?= Html::submitButton('Создать задачу', ['class' => 'btn btn-success-2']) ?>
......@@ -157,33 +88,4 @@ use common\modules\support\models\redmine\RedmineHelper;
</div>
</div>
<style type="text/css">
.markItUpButton {
position: relative;
width: 23px;
height: 23px;
padding: 3px;
font-size: 13px;
text-align: center;
}
.markItUpButton a {
position: absolute;
top: 0;
left: 0;
z-index: 5;
}
.markItUp {
width: 100%;
margin: 5px 0 5px 0;
}
.header-2 {
font-size: 11px;
line-height: 16px;
}
.header-3 {
font-size: 9px;
line-height: 16px;
}
</style>
<?=$this->render('@app/views/layouts/footer');?>
\ No newline at end of file
<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use common\modules\support\models\redmine\Issue;
use common\modules\support\models\redmine\RedmineHelper;
$parser = new \Netcarver\Textile\Parser();
?>
<div class="container_white">
<div class="container_white support-block">
<div class="container">
<div class="right_box_top row">
......@@ -60,8 +66,7 @@ use common\modules\support\models\redmine\Issue;
<p><strong>Описание задачи</strong></p>
<p>
<?php $parser = new \Netcarver\Textile\Parser();
echo $parser->textileThis($model['description']); ?>
<?=$parser->textileThis($model['description']); ?>
</p>
</div>
......@@ -70,90 +75,85 @@ use common\modules\support\models\redmine\Issue;
<br>
<!-- <div class="row">
<div class="row">
<div class="col-sm-12">
<p class="label_p"><strong>Добавить комментарий к задаче</strong></p>
<div class="text_box_form text_box_form_bg">
<div class="text_box_form_top"><img src="/images/text_box_img.jpg" width="100%" alt=""></div>
<textarea>Высылаю нужный файл</textarea>
<?php $form = ActiveForm::begin(); ?>
<div class="row">
<div class="col-sm-12">
<?=$form->field($issue, 'notes', ['template' => "{input}<br>{hint}{error}"])->widget(\coderlex\markitup\MarkItUp::className(), [
'options' => ['class' => 'form-control', 'style' => 'overflow:auto;resize:none;width:100%;min-height:100px;'],
'clientOptions' => [
'markupSet' => RedmineHelper::$markupSet
],
])->label(false)?>
<div class="file_box_wr">
<span class="glyphicon glyphicon-file"></span>
<a href="">Error_window.jpg &nbsp;</a>
<span class="color_gray">&nbsp;50,6 кБ&nbsp;&nbsp;</span>
<a href=""><span class="glyphicon glyphicon-remove color_gray"></span></a>
</div>
<div class="file_box_wr">
<span class="glyphicon glyphicon-file"></span>
<a href="">Error_window.jpg &nbsp;</a>
<span class="color_gray">&nbsp;50,6 кБ&nbsp;&nbsp;</span>
<a href=""><span class="glyphicon glyphicon-remove color_gray"></span></a>
</div>
<div class="file_box_wr">
<span class="glyphicon glyphicon-file"></span>
<a href="">Error_window.jpg &nbsp;</a>
<span class="color_gray">&nbsp;50,6 кБ&nbsp;&nbsp;</span>
<a href=""><span class="glyphicon glyphicon-remove color_gray"></span></a>
<div id="file-container">
</div>
<input type="file" id="file-attachment-input" style="display:none;" multiple="multiple">
<?= Html::submitButton('Отправить', ['class' => 'btn btn-success-2 gray_button_poz']) ?>
<button class="btn btn-success-2 gray_button_poz">Отправить</button>
<div class="gray_button attachment-button">Прикрепить файл<i class="glyphicon glyphicon-paperclip"></i></div>
<?php ActiveForm::end(); ?>
<button class="gray_button">Прикрепить файл<i class="glyphicon glyphicon-paperclip"></i></button>
</div>
</div>
</div> -->
</div>
<!-- <div class="row">
<?php if(isset($model['journals'])) : ?>
<div class="row">
<div class="col-md-12">
<div class="commentary_col">
<strong>Комментарии (14) </strong>&nbsp;<span class="label label-success" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="4 задачи требуют проверки">4</span>
<strong>Комментарии (<?=count($model['journals'])?>) </strong><!-- &nbsp;<span class="label label-success" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="4 задачи требуют проверки">4</span> -->
</div>
<?php foreach ($model['journals'] as $i => $journal) : ?>
<div class="commentary_box">
<p><strong>Иван Иванов</strong> <span class="color_gray">16 января 2014, 12:13</span></p>
<p>Прошу направить файлы заказчику и составить для него письмо.</p>
<a href=""><span class="glyphicon glyphicon-file"></span>скан_паспорта.jpg</a>&nbsp;&nbsp;
<a href=""><span class="glyphicon glyphicon-file"></span>данные.xml</a>
<br>
<img src="/images/commentary_box_img_1.jpg" width="96" height="56" alt="commentary_box_img_1">
<img src="/images/commentary_box_img_2.jpg" width="96" height="56" alt="commentary_box_img_2">
<br>
<a href="" class="commentary_box_ok">Ответить</a> &nbsp;&nbsp;&nbsp; <a href="" class="commentary_box_dell">Удалить</a>
<div class="line_3"></div>
</div>
<p><strong><?=$journal['user']['name']?></strong> <span class="color_gray"><?=Yii::$app->formatter->asDate($journal['created_on'], 'php:d F Y, H:i');?></span></p>
<p>
<?=$parser->textileThis($journal['notes']);?>
</p>
<?php if(isset($journal['details'])) : ?>
<?php foreach ($journal['details'] as $detail) : ?>
<?php if($detail['property'] == 'attachment') : ?>
<span class="glyphicon glyphicon-file"></span><?=$detail['new_value']?>&nbsp;&nbsp;
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<div class="commentary_box marg_l_20">
<p><strong>Сидоров Петр</strong> <span class="color_gray">16 января 2014, 13:06</span></p>
<p>Почтовый сервер при отправке письма выдает вот такую ошибку. Что делать?</p>
<a href=""><span class="glyphicon glyphicon-file"></span>Error_window.jpg </a>&nbsp;&nbsp; <span class="color_gray">50,6 кБ</span>
<br>
<a href="" class="commentary_box_ok">Ответить</a> &nbsp;&nbsp;&nbsp; <a href="" class="commentary_box_dell">Удалить</a>
<?php if($i != count($model['journals']) - 1) : ?>
<div class="line_3"></div>
<?php endif; ?>
</div>
<div class="commentary_box marg_l_40">
<p><strong>Сидоров Петр</strong> <span class="color_gray">16 января 2014, 13:06</span></p>
<p>Почтовый сервер при отправке письма выдает вот такую ошибку. Что делать?</p>
<a href=""><span class="glyphicon glyphicon-file"></span>Error_window.jpg </a>&nbsp;&nbsp; <span class="color_gray">50,6 кБ</span>
<br>
<a href="" class="commentary_box_ok">Ответить</a> &nbsp;&nbsp;&nbsp; <a href="" class="commentary_box_dell">Удалить</a>
<?php endforeach; ?>
</div>
</div>
</div> -->
<br>
<br>
<?php endif; ?>
</div>
</div>
......
......@@ -37,7 +37,7 @@ class SiteController extends Controller
// TEMP
public function actionContacts()
{
Yii::$app->controller->meta_title = 'Контакты';
Yii::$app->controller->meta_title = 'Контакты ООО "Арт Проект"';
return $this->render('contacts');
}
......
......@@ -16,14 +16,14 @@ $models = CoContent::find()
<div class="row">
<?php foreach ($models as $model) : ?>
<div class="col-md-6 col-xs-6 col-sm-12">
<div class="keys_block_small">
<a href="<?=Url::to(['/'.$model->url])?>" class="keys_block_small">
<img src="<?=$model->preview?>" height="338" width="455">
<a href="<?=Url::to(['/'.$model->url])?>" class="keys_small_title" <?if($model->custom==CoContent::CUSTOM_WHITE){?>style="color:#fff;"<?}?>><?=$model->lang->title?></a>
<div class="keys_small_title" <?if($model->custom==CoContent::CUSTOM_WHITE){?>style="color:#fff;"<?}?>><?=$model->lang->title?></div>
<div class="keys_small_foot">
<?=Html::a('<span>Подробнее</span>', ['/'.$model->url], ['class' => 'keys_small_btn_more'])?>
<div class="keys_small_btn_more"><span>Подробнее</span></div>
<!-- <a href="#" class="keys_small_tags"># Big data</a> -->
</div>
</div>
</a>
</div>
<?php endforeach; ?>
<!-- <div class="col-md-6 col-xs-6 col-sm-12">
......
......@@ -1796,3 +1796,48 @@ a.keys_test_btn {
.error_not_foud ul {
list-style-type: inherit !important;
}
.keys_block_small {
display: block;
}
.attachment-button {
display: inline-block;
cursor: pointer;
}
.support-block .markItUpButton {
position: relative;
width: 23px;
height: 23px;
padding: 3px;
font-size: 13px;
text-align: center;
}
.support-block .markItUpButton a {
position: absolute;
top: 0;
left: 0;
z-index: 5;
}
.support-block .markItUp {
width: 100%;
margin: 5px 0 5px 0;
}
.support-block .header-2 {
font-size: 11px;
line-height: 16px;
}
.support-block .header-3 {
font-size: 9px;
line-height: 16px;
}
.support-block .help-block {
font-size: 12px;
line-height: 10px;
margin: -10px 0 25px;
}
.support-block .form-control {
float: none !important;
}
\ No newline at end of file
$(function(){
$('.attachment-button').click(function(){
$('#file-attachment-input').trigger('click');
});
$('#file-attachment-input').change(function(){
var xhr = new XMLHttpRequest, data = new FormData(), files = $('#file-attachment-input')[0].files;
xhr.open("POST", '/support/file', true);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
data.append("_csrf", $('meta[name="csrf-token"]').attr('content'));
$.each(files, function(i, file){
data.append("files[]", file);
});
xhr.send(data);
xhr.onreadystatechange = function()
{
if (xhr.readyState == 4)
{
try
{
var response = JSON.parse(xhr.responseText);
}
catch(e)
{
var response = xhr.responseText;
}
if(response.success)
{
$('#file-container').append(response.html);
}
}
}
$(this).val('');
});
$(document).delegate('.file_box_wr .delete-file', 'click', function(){
$(this).closest('.file_box_wr').remove();
return false;
});
});
\ No newline at end of file
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