Exemplo n.º 1
0
Pjax::begin(['id' => 'style_forms', 'enablePushState' => true]);
$js = <<<JS
    /*\$("#style_forms").on("pjax:complete", function() {
        \$("#style_form").attr("tabindex",-1).focus();
    });*/
JS;
$this->registerJS($js);
echo AdWidget::widget(['template' => true, 'id' => $modelAdMain->id, 'author' => Yii::$app->user->can('Автор', ['model' => $modelAdMain]), 'main_container_class' => $modelAdMain->adStyle->main_container_class . ' col-md-3 col-md-offset-3', 'favorite' => $modelAdMain->getFavorite($modelAdMain->id), 'favorite_icon' => $modelAdMain->adStyle->favorite_icon, 'complain' => $modelAdMain->getComplain($modelAdMain->id), 'complain_icon' => $modelAdMain->adStyle->complain_icon, 'header' => $modelAdMain->getHeader(), 'address' => $modelAdMain->getAddress(), 'address_map' => $modelAdMain->getAddressMap(), 'phone_temp_ad' => $modelAdMain->phone_temp_ad, 'images' => $modelAdMain->getImagesOfObjects(), 'content' => $modelAdMain->getContentList(), 'quick_view_class' => $modelAdMain->adStyle->quick_view_class]);
?>
        <?php 
Pjax::end();
?>
    </div>

    <?php 
$form = ActiveForm::begin(['action' => Url::to(['/ad/view/publish', 'id' => $modelAdMain->id]), 'method' => 'post', 'fieldClass' => ActiveField::className(), 'id' => 'style_form', 'options' => ['style' => 'outline: none;']]);
?>
    <div class="col-md-3" style="">
        <?php 
//dd($modelAdMain->adCategory->adMain->adStyle->id);
echo $form->field($modelAdMain->adCategory->adMain, 'ad_style_id')->radioList($modelAdMain->adStyle->styleList, ['onchange' => '
                $.pjax({
                    type: "POST",
                    url: "' . Url::to(['/ad/view/select-style', 'id' => $modelAdMain->id]) . '",
                    data: jQuery("#style_form").serialize(),
                    container: "#style_forms",
                    push: false
                })', 'item' => function ($index, $label, $name, $checked, $value) {
    $radioClass = '';
    $bgClass = '';
    switch ($value) {
Exemplo n.º 2
0
AssetBundle::register($this);
ChosenAsset::register($this);
CropperAsset::register($this);
/* @var $this yii\web\View */
/* @var $modelAdTransport common\models\AdTransport */
/* @var $user common\models\User */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $key int */
/* @var $pjaxUrl string */
$user = Yii::$app->user->identity;
?>
<div class="col-md-6 col-md-offset-3">
    <div class="ad-real-estate-form">
        <div class="row">
            <?php 
$form = ActiveForm::begin(['action' => $modelAdTransport->isNewRecord ? 'create' : Url::to(['update', 'id' => $modelAdTransport->id]), 'method' => 'post', 'fieldClass' => justinvoelker\awesomebootstrapcheckbox\ActiveField::className(), 'id' => 'ad_form']);
?>

            <?php 
//d($modelAdTransport->scenario);
?>

            <?php 
echo $form->field($modelAdTransport, 'transport')->hiddenInput()->label(false);
?>

            <?php 
if (Yii::$app->controller->action->id != 'update') {
    ?>
                <div class="col-md-12">
                    <?php