123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
- use kartik\datetime\DateTimePicker;
- $form = ActiveForm::begin([
- 'id' => 'story-form',
- 'options' => ['class' => 'form-horizontal', 'enctype' => 'multipart/form-data']]);
- ?>
- <input type="hidden" name="Story[id]" value="<?=$model->id?>">
- <input type="hidden" name="Story[ext]" value="<?=$model->ext?>">
- <?
- if($model->id){
- $imageSrc = "/story-images/".$model->id."_sizehd.jpg";
- }
- echo @app\components\admin\uploadcrop\UploadCrop::widget(
- [
- 'form' => $form,
- 'model' => $model,
- 'attribute' => 'photo',
- 'maxSize' => 3000,
- 'imageSrc' => (isset($imageSrc)) ? $imageSrc : '',
- 'title' => 'Фото',
- 'changePhotoTitle' => 'Фото',
- 'jcropOptions' => [
- 'center' => true,
- 'rotatable' => true,
- 'autoCrop' => true,
- 'autoCropArea' => false,
- 'checkOrientation' => true,
- 'aspectRatio' => 16 / 9,
- 'dragMode' => 'move',
- 'viewMode' => 1,
- 'autoCropArea' => '0.1',
- 'restore' => true,
- 'guides' => true,
- 'center' => true,
- 'movable' => false,
- 'highlight' => true,
- 'cropBoxMovable' => true,
- 'cropBoxResizable' => true,
- 'background' => false,
- 'minContainerHeight' => 500,
- 'minCanvasHeight' => 400,
- 'minCropBoxWidth' => 600,
- 'minCropBoxHeight' => 200,
- 'responsive' => true,
- 'toggleDragModeOnDblclick' => false,
- 'crop' => 'crq'
- ]
- ]
- );
- echo $form->field($model, 'url')->textInput([
- 'maxlength' => true,
- 'class' => 'form-control js-word-count-input',
- 'placeholder' => 'URL'
- ])->label('URL часть адреса рездела');
- echo $form->field($model, 'title')->textInput([
- 'maxlength' => true,
- 'class' => 'form-control js-word-count-input',
- 'placeholder' => 'Заголовок',
- // 'id' => 'js-news-content'
- ])->label('Заголовок сюжета');
- echo $form->field($model, 'meta_title')->textInput([
- 'maxlength' => true,
- 'class' => 'form-control js-word-count-input',
- 'placeholder' => 'Заголовок SEO'
- ])->label('Заголовок SEO');
- echo $form->field($model, 'description')->textarea([
- 'maxlength' => true,
- 'class' => 'form-control js-word-count-input',
- 'placeholder' => 'description'
- ])->label('Описание раздела кратко');
- echo $form->field($model, 'keywords')->textarea([
- 'maxlength' => true,
- 'class' => 'form-control js-word-count-input',
- 'placeholder' => 'ключевые слова'
- ])->label('ключевые слова через запятую');
- ?>
- <div class="form-group form-check">
- <?
- echo $form->field($model, 'active')->checkbox([
- 'class' => 'form-check-input',
- 'label' => 'Активный'
- ]);
- //($model->show == 'Y')?true:false,
- echo $form->field($model, 'show')->checkbox([
- 'class' => 'form-check-input',
- 'label' => 'Показывать везде',
- 'uncheck' => 'N',
- 'checked' => ($model->show == 'Y')?true:false
- ]);
- ?></div><div class="form-group"><?
- echo Html::submitButton('Send', ['class' => 'btn btn-success']);
- ?>
- </div>
- <?
- ActiveForm::end();
|