diff --git a/frontend/views/accounts/_projects_form.php b/frontend/views/accounts/_projects_form.php index d70f21a..46cacaf 100644 --- a/frontend/views/accounts/_projects_form.php +++ b/frontend/views/accounts/_projects_form.php @@ -1,46 +1,46 @@ title = 'Проекты'; - $this->params[ 'breadcrumbs' ][] = $this->title; +/** + * @var Project $project + * @var Specialization[] $specialization + * @var Payment[] $payment + * @var string[] $projects + */ +use common\components\Request; +use common\models\Currency; +use common\models\File; +use common\models\Payment; +use common\models\Project; +use common\models\Specialization; +use common\modules\file\widgets\ImageUploader; +use common\modules\fileloader\widgets\FileloaderWidget; +use kartik\select2\Select2; +use mihaildev\ckeditor\CKEditor; +use yii\helpers\Html; +use yii\jui\DatePicker; +use yii\web\JsExpression; +use yii\widgets\ActiveForm; + +$this->title = 'Проекты'; +$this->params[ 'breadcrumbs' ][] = $this->title; ?>
title ?>
[ 'enctype' => 'multipart/form-data' ] ]); +$form = ActiveForm::begin([ 'options' => [ 'enctype' => 'multipart/form-data' ] ]); ?>
field($project, 'name') - ->textInput([ 'class' => 'custom-input-2' ]) ?> + ->textInput([ 'class' => 'custom-input-2' ]) ?>
field($project, 'project_pid') - ->dropDownList($projects, [ 'prompt' => 'Родительский проект' ]) ?> + ->dropDownList($projects, [ 'prompt' => 'Родительский проект' ]) ?>
@@ -68,13 +68,13 @@ field($project, "specializationInput[{$child_second->specialization_id}]", [ 'template' => '{input}{label}{hint}{error}', ]) - ->label('' . $child_second->specialization_name) - ->checkbox([ - 'value' => $child_second->specialization_id, - 'label' => NULL, - 'uncheck' => NULL, - 'class' => 'custom-check', - ], false) ?> + ->label('' . $child_second->specialization_name) + ->checkbox([ + 'value' => $child_second->specialization_id, + 'label' => NULL, + 'uncheck' => NULL, + 'class' => 'custom-check', + ], false) ?> @@ -104,33 +104,33 @@
field($project, 'city') - ->widget(Select2::classname(), [ - 'options' => [ 'placeholder' => 'Выбор города ...' ], - 'pluginOptions' => [ - 'allowClear' => true, - 'minimumInputLength' => 3, - 'ajax' => [ - 'url' => \yii\helpers\Url::to([ 'site/city' ]), - 'dataType' => 'json', - 'data' => new JsExpression('function(params) { return {q:params.term}; }'), - ], - 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), - 'templateResult' => new JsExpression('function(city) { return city.text; }'), - 'templateSelection' => new JsExpression('function (city) { return city.text; }'), - ], - ]); ?> + ->widget(Select2::classname(), [ + 'options' => [ 'placeholder' => 'Выбор города ...' ], + 'pluginOptions' => [ + 'allowClear' => true, + 'minimumInputLength' => 3, + 'ajax' => [ + 'url' => \yii\helpers\Url::to([ 'site/city' ]), + 'dataType' => 'json', + 'data' => new JsExpression('function(params) { return {q:params.term}; }'), + ], + 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), + 'templateResult' => new JsExpression('function(city) { return city.text; }'), + 'templateSelection' => new JsExpression('function (city) { return city.text; }'), + ], + ]); ?>
field($project, 'street', [ 'template' => "{label}{input}{hint}{error}" ]) - ->textInput([ 'class' => 'custom-input-2' ]) ?> + ->textInput([ 'class' => 'custom-input-2' ]) ?>
field($project, 'house', [ 'template' => "{label}{input}{hint}{error}" ]) - ->textInput([ 'class' => 'custom-input-2' ]) ?> + ->textInput([ 'class' => 'custom-input-2' ]) ?>
@@ -140,20 +140,20 @@ field($project, 'budget', [ 'template' => "{label}
{input}\n{hint}\n{error}", ]) - ->textInput([ - 'class' => 'custom-input-2 custom-input-2-date', - 'type' => 'number', - ]) ?> + ->textInput([ + 'class' => 'custom-input-2 custom-input-2-date', + 'type' => 'number', + ]) ?>
field($project, 'budget_currency') - ->label(false) - ->dropDownList(Currency::getCurrencyDropdown(), [ 'class' => 'custom-input-2' ]); ?> + ->label(false) + ->dropDownList(Currency::getCurrencyDropdown(), [ 'class' => 'custom-input-2' ]); ?>
field($project, 'contractual', [ 'template' => "{input}{label}\n{hint}\n{error}" ]) - ->checkbox([ 'class' => 'custom-check' ], false) - ->label('Договорной') ?> + ->checkbox([ 'class' => 'custom-check' ], false) + ->label('Договорной') ?>
@@ -161,37 +161,37 @@
field($project, 'payment_variant') - ->radioList([ - 1 => 'Без предоплаты', - 2 => 'Предоплата возможна', - ], [ - 'item' => function($index, $label, $name, $checked, $value) { - $return = '
'; - $return .= ''; - $return .= ''; - $return .= '
'; - return $return; - }, - ]) ?> + ->radioList([ + 1 => 'Без предоплаты', + 2 => 'Предоплата возможна', + ], [ + 'item' => function($index, $label, $name, $checked, $value) { + $return = '
'; + $return .= ''; + $return .= ''; + $return .= '
'; + return $return; + }, + ]) ?>
field($project, 'paymentInput') - ->checkboxList($payment, [ - 'item' => function($index, $label, $name, $checked, $value) { - $return = '
'; - $return .= ''; - $return .= ''; - $return .= '
'; - return $return; - }, - ]) ?> + ->checkboxList($payment, [ + 'item' => function($index, $label, $name, $checked, $value) { + $return = '
'; + $return .= ''; + $return .= ''; + $return .= '
'; + return $return; + }, + ]) ?>
@@ -199,70 +199,71 @@
field($project, 'deadline', [ 'template' => "{label}
{input}дней\n{hint}\n{error}" ]) - ->textInput([ - 'class' => 'custom-input-2 custom-input-2-date', - 'type' => 'number', - ]) ?> + ->textInput([ + 'class' => 'custom-input-2 custom-input-2-date', + 'type' => 'number', + ]) ?>
field($project, 'description') - ->widget(CKEditor::className()) ?> + ->widget(CKEditor::className()) ?>
-
-
-
-
Присоединить файл
-
Загрузить
-
До 3 Мб файл
-
-
- field($project, 'files[]') - ->fileInput([ 'multiple' => 'multiple' ]) ?> -
+/* == Old file upload == +?> +
+
+
+
Присоединить файл
+
Загрузить
+
До 3 Мб файл
+
+
+ field($project, 'files[]') + ->fileInput([ 'multiple' => 'multiple' ]) ?>
- +
field($project, 'fileloader') - ->label(false) - ->widget(FileloaderWidget::className(), [ - 'labelOptions' => [ 'label' => '
Присоединить файлы
Загрузить
До 3 Мб файл
' ], - 'inputOptions' => [ - 'multiple' => 'multiple', - 'class' => 'hidden', - ], - 'options' => [ 'class' => 'fileloader-file' ], - ]); + echo $form->field($project, 'fileloader') + ->label(false) + ->widget(FileloaderWidget::className(), [ + 'labelOptions' => [ 'label' => '
Присоединить файлы
Загрузить
До 3 Мб файл
' ], + 'inputOptions' => [ + 'multiple' => 'multiple', + 'class' => 'hidden', + ], + 'options' => [ 'class' => 'fileloader-file' ], + ]); ?>
field($project, 'date_end') - ->widget(DatePicker::className(), [ - 'dateFormat' => 'yyyy-MM-dd', - 'clientOptions' => [ 'minDate' => 1 ], - ]) ?> + ->widget(DatePicker::className(), [ + 'dateFormat' => 'yyyy-MM-dd', + 'clientOptions' => [ 'minDate' => 1 ], + ]) ?>
-
+ @@ -271,18 +272,18 @@ isNewRecord ? Yii::t('app', 'add') : 'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?>
isNewRecord) { - echo Html::a(Yii::t('app', 'delete'), [ - 'accounts/projects-delete', - 'id' => $project->project_id, - ], [ - 'title' => Yii::t('app', 'delete'), - 'aria-label' => Yii::t('app', 'delete'), - 'data-confirm' => Yii::t('app', 'delete_confirm'), - 'data-method' => 'post', - 'data-pjax' => 0, - ]); - } + if(!$project->isNewRecord) { + echo Html::a(Yii::t('app', 'delete'), [ + 'accounts/projects-delete', + 'id' => $project->project_id, + ], [ + 'title' => Yii::t('app', 'delete'), + 'aria-label' => Yii::t('app', 'delete'), + 'data-confirm' => Yii::t('app', 'delete_confirm'), + 'data-method' => 'post', + 'data-pjax' => 0, + ]); + } ?>
@@ -292,7 +293,7 @@
end(); +$form->end(); ?> + diff --git a/frontend/web/css/style.css b/frontend/web/css/style.css index 42e0968..83bd8e9 100755 --- a/frontend/web/css/style.css +++ b/frontend/web/css/style.css @@ -3365,7 +3365,7 @@ ul.proektant-comments {margin-top: 15px} width: 104px; height: 41px; float: right; - margin-right: 20px; + margin-right: 38px; position: relative; } .main-menu-icons-wr a{ @@ -4651,7 +4651,7 @@ ul.download-list-files li:hover .download-link {transition: 0.2s; opacity: 1; -m float: left; } -.custom-input-2 { +.custom-input-2, input.hasDatepicker { width: 300px; height: 29px; border: 1px solid #dcdcdc; @@ -4666,7 +4666,7 @@ ul.download-list-files li:hover .download-link {transition: 0.2s; opacity: 1; -m outline: none; } .custom-input-2.fix-input-2 {width: 100%} -.custom-input-2:focus, .selectize-input input:focus, .search-work-form select:focus {border: 1px solid #dcdcdc;box-shadow: 1px 2px 2px 0px rgba(215, 215, 215, 0.75) inset; transition: 0.1s; outline: none} +.custom-input-2:focus, .selectize-input input:focus, .search-work-form select:focus, input.hasDatepicker:focus {border: 1px solid #dcdcdc;box-shadow: 1px 2px 2px 0px rgba(215, 215, 215, 0.75) inset; transition: 0.1s; outline: none} .input-blocks select {margin-top: 5px} .input-blocks label, .skills-title { font-size: 13px; @@ -6458,6 +6458,7 @@ input[disabled], select[disabled] { padding-left: 8px; width: 85px; float: left; + margin-top: 0; } .admin-table-portfolio .input-group.input-group-xs input:focus{ box-shadow: 1px 2px 2px 0px rgba(215, 215, 215, 0.75) inset; transition: 0.1s; outline: none @@ -6801,4 +6802,11 @@ li.active-menu-admin:hover a .ico_num { font-size: 13px; color: #D40000; margin-top: 12px; -} \ No newline at end of file +} +.hint-link.hint-link-check .hint-block { + top:0; + margin-top: -3px; + left: 133px; +} +.hint-link-check {margin-top: 23px} +.fix-color-datepicker .ui-datepicker-title {color: #fff} \ No newline at end of file -- libgit2 0.21.4