Beispiel #1
0
    ?>
                <?php 
}
?>
            </div>
        </div>

        <div class="clear"></div>

    <?php 
ActiveForm::end();
?>
    
    <!-- Advert upload files form -->
    <?php 
$form = ActiveForm::begin(['id' => 'advert-file-upload-form', 'action' => '/file/upload', 'options' => ['enctype' => 'multipart/form-data'], 'enableClientValidation' => false, 'fieldConfig' => ['template' => "{input}"]]);
?>

        <?php 
echo Html::hiddenInput('owner', 'Advert');
?>
        <?php 
echo Html::hiddenInput('ownerId', $model->id);
?>
        
        <label>
            <?php 
echo $form->field(new File(), 'file', ['options' => ['tag' => false]])->fileInput();
?>
            
            <span class="button" style="">
Beispiel #2
0
<?php

use roman444uk\yii\widgets\ActiveForm;
use yii\helpers\Html;
$searchModel = $this->params['searchModel'];
?>

<div id="search-container">
    <?php 
$form = ActiveForm::begin(['id' => 'search-form', 'method' => 'get', 'action' => '/']);
echo $form->field($this->params['searchModel'], 'content', ['template' => '{input}', 'options' => ['tag' => false]])->textInput(['name' => !$this->params['directPopulating'] ? 'content' : null]);
echo Html::submitInput('', ['class' => 'icon sm zoom']);
ActiveForm::end();
?>
</div>

<?php 
$js = <<<JS
jQuery('#search-form').on('submit.yiiActiveForm', function(event) {
    \$.pjax.submit(event, '#advert-list-pjax');
});
JS;
$this->registerJs($js);
<?php

use roman444uk\yii\widgets\ActiveForm;
use yii\captcha\Captcha;
use yii\helpers\Html;
use roman444uk\users\UsersModule;
$this->title = UsersModule::t('front', 'Registration');
$this->params['breadcrumbs'][] = $this->title;
?>
    
<?php 
$form = ActiveForm::begin(['id' => 'form-registration', 'validateOnBlur' => false, 'options' => ['autocomplete' => 'off', 'class' => 'auth-form'], 'fieldConfig' => ['template' => "{input}\n{error}"]]);
?>

    <?php 
echo $form->field($model, 'username')->textInput(['placeholder' => $model->getAttributeLabel('username'), 'maxlength' => 50, 'autocomplete' => 'off', 'autofocus' => true]);
?>

    <?php 
echo $form->field($model, 'password')->passwordInput(['placeholder' => $model->getAttributeLabel('password'), 'maxlength' => 255, 'autocomplete' => 'off']);
?>

    <?php 
echo $form->field($model, 'repeat_password')->passwordInput(['placeholder' => $model->getAttributeLabel('repeat_password'), 'maxlength' => 255, 'autocomplete' => 'off']);
?>

    <?php 
echo $form->field($model, 'captcha', ['options' => ['class' => 'form-group captcha']])->widget(Captcha::className(), ['captchaAction' => ['/users/auth/captcha'], 'options' => ['class' => 'form-control', 'placeholder' => 'Код с картинки']]);
?>
    
    <div class="form-group button-container">
?>

<?php 
if (Yii::$app->session->hasFlash('error')) {
    ?>
    <div class="alert-alert-warning text-center">
        <?php 
    echo Yii::$app->session->getFlash('error');
    ?>
    </div>
<?php 
}
?>

<?php 
$form = ActiveForm::begin(['id' => 'user', 'validateOnBlur' => false, 'fieldConfig' => ['template' => "{input}\n{error}"], 'options' => ['class' => 'auth-form']]);
?>

    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => 255, 'placeholder' => $model->getAttributeLabel('email'), 'autofocus' => true]);
?>

    <?php 
echo $form->field($model, 'captcha', ['options' => ['class' => 'form-group captcha']])->widget(Captcha::className(), ['captchaAction' => ['/users/auth/captcha'], 'options' => ['class' => 'form-control', 'placeholder' => 'Код с картинки']]);
?>
    
    <div class="form-group button-container">
        <?php 
echo Html::submitButton(UsersModule::t('front', 'Recover'));
?>
    </div>
Beispiel #5
0
switch ($model->type) {
    case File::TYPE_IMAGE:
        echo Html::img($model->absoluteUrl, ['data-dz-thumbnail' => $model->id]);
        break;
    case File::TYPE_VIDEO:
        echo Html::tag('video', '<source src="' . $model->getAbsoluteThumbUrl() . '">');
        break;
}
?>
    
    <?php 
echo Html::a('', '', ['id' => "advert-file-{$model->id}", 'class' => 'anchor']);
?>
    
    <?php 
$form = ActiveForm::begin(['id' => 'advert-file-form', 'action' => Url::to(['/file/update', 'id' => $model->id]), 'enableClientValidation' => false, 'fieldConfig' => ['template' => "{input}"]]);
?>
    
        <div class="panel">
            <?php 
echo Html::submitButton(Yii::t('app', 'Save'));
?>
            
            <?php 
echo Html::a(Yii::t('app', 'Delete'), Url::to(['/file/delete', 'id' => $model->id]), ['class' => 'button', 'data-delete-file' => $model->id]);
?>
        </div>
    
        <?php 
echo $form->field($model, 'description', ['options' => ['tag' => false]])->textarea();
?>
use roman444uk\yii\widgets\WidgetPageSize;
use yii\helpers\Html;
use yii\web\JsExpression;
use yii\widgets\MaskedInput;
use yii\widgets\Spaceless;
$searchModel = $this->params['searchModel'];
$directPopulating = $this->params['directPopulating'];
?>

<div id="detaile-search-panel" class="detaile-search-panel">
    <h3>Критерии поиска:</h3>
    <?php 
if ($safeAttributes = $searchModel->safeAttributes()) {
    ?>
        <?php 
    $form = ActiveForm::begin(['id' => 'detaile-search-form', 'method' => 'get', 'action' => '/', 'fieldConfig' => ['template' => '{label}{input}']]);
    ?>

            <?php 
    echo Yii::t('app', 'Show only active');
    ?>
            
            <?php 
    echo $form->field($searchModel, 'city_id')->dropDownList(City::getList(), ['name' => $directPopulating ? 'city_id' : null, 'emptyItem' => Yii::t('app', 'Empty city option')]);
    ?>
            
            <?php 
    echo $form->field($searchModel, 'type')->dropDownList(Advert::getTypesDropDownList(), ['name' => $directPopulating ? 'type' : null, 'emptyItem' => Yii::t('app', 'Empty type option')]);
    ?>
            
            <?php 
Beispiel #7
0
use common\models\City;
use common\models\Currency;
use roman444uk\files\models\File;
use roman444uk\yii\widgets\ActiveForm;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\web\View;
use yii\widgets\MaskedInput;
use yii\widgets\Spaceless;
?>

<div id="create-advert">

    <!-- Advert form -->
    <?php 
$form = ActiveForm::begin(['id' => 'advert-form', 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'validateOnBlur' => true, 'validationUrl' => Url::to(['validate', 'id' => $model->id]), 'fieldConfig' => ['template' => "{label}{input}"], 'clientEvents' => ['ajaxSubmitSuccess' => "function(data) {\n    \$('a[data-update], a[data-view]').magnificPopup('close');\n    return false;\n}"]]);
?>

        <div class="left">
            <?php 
echo $form->field($model, 'city_id')->dropDownList(City::getList(), ['name' => $directPopulating ? 'city_id' : null, 'label' => 'City', 'class' => 'form-control input-sm', 'emptyItem' => Yii::t('app', 'Empty city option')]);
?>

            <?php 
echo $form->field($model, 'type', [])->dropDownList(Advert::getTypesDropDownList(), ['name' => $directPopulating ? 'type' : null, 'class' => 'form-control input-sm', 'emptyItem' => Yii::t('app', 'Empty type option')]);
?>

            <?php 
echo $form->field($model, 'category')->dropDownList(Category::getDropdownList(), ['name' => $directPopulating ? 'category' : null, 'class' => 'form-control input-sm', 'emptyItem' => Yii::t('app', 'Empty category option')]);
?>
Beispiel #8
0
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use roman444uk\yii\widgets\ActiveForm;
use common\models\City;
use common\models\Advert;
use common\models\Category;
use dosamigos\fileupload\FileUpload;
?>
    
<?php 
$form = ActiveForm::begin(['id' => 'create-advert-form', 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'validateOnBlur' => true, 'ajaxSubmit' => true, 'validationUrl' => Url::to(['validate', 'id' => $model->id]), 'fieldConfig' => ['template' => "{label}{input}"], 'clientEvents' => ['ajaxSubmitSuccess' => "function(data) {\n        \$('#advert-grid-create-button').magnificPopup('close');\n        \$.pjax.reload({container: '#advert-grid-pjax'});\n        return false;\n    }"]]);
?>
    
    <div class="row">
        
        <div class="col-sm-9">
            <?php 
$form->field($model, 'content')->textarea([]);
?>
            <?php 
echo $form->field($model, 'content')->textarea(['name' => $directPopulating ? 'content' : null, 'rows' => 25]);
?>
        </div>
    
        <div class="col-sm-3">
            <?php 
echo $form->field($model, 'city_id')->dropDownList(City::getList(), ['name' => $directPopulating ? 'city_id' : null, 'class' => 'form-control input-sm']);
?>
Beispiel #9
0
<?php

use roman444uk\magnificPopup\MagnificPopupAsset;
use roman444uk\users\UsersModule;
use roman444uk\yii\widgets\ActiveForm;
use yii\helpers\Html;
$this->title = UsersModule::t('front', 'Authorization');
?>

<?php 
$form = ActiveForm::begin(['id' => 'form-login', 'options' => ['autocomplete' => 'off', 'class' => 'auth-form'], 'enableAjaxValidation' => true, 'validateOnChange' => true, 'validateOnBlur' => true, 'validateOnSubmit' => true, 'validationDelay' => 500, 'fieldConfig' => ['template' => "{input}\n{error}"]]);
?>

    <?php 
echo $form->field($model, 'username')->textInput(['placeholder' => $model->getAttributeLabel('username'), 'autocomplete' => 'off']);
?>

    <?php 
echo $form->field($model, 'password')->passwordInput(['placeholder' => $model->getAttributeLabel('password'), 'autocomplete' => 'off']);
?>

    <?php 
echo $form->field($model, 'rememberMe')->checkbox(['value' => true]);
?>
    
    <div class="form-group button-container">
        <?php 
echo Html::submitButton(UsersModule::t('front', 'Login'), []);
?>
    </div>