From 5dfa349e16b8a477b395aeaa43b4ed90add9c5ac Mon Sep 17 00:00:00 2001 From: Yarik Date: Wed, 30 Dec 2015 11:25:40 +0200 Subject: [PATCH] Коммит последний день 2015 --- backend/controllers/AdminMenuController.php | 3 +++ backend/controllers/SettingsController.php | 38 ++++++++++++++++++++++++++++++++++++++ backend/models/AdminMenu.php | 31 +++++++++++++++++++++++-------- backend/models/AdminMenuSearch.php | 28 +++++++++++++++++++++++++--- backend/views/admin-menu/_form.php | 46 +++++++++++++++++++++++++++++----------------- backend/views/admin-menu/create.php | 13 +++++++------ backend/views/admin-menu/index.php | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------- backend/views/admin-menu/update.php | 6 +----- backend/views/admin-menu/view.php | 31 ++++++++++++++++--------------- backend/views/layouts/left.php | 99 ++++++--------------------------------------------------------------------------------------------- backend/views/layouts/settings.php | 40 ++++++++++++++++++++++++++++++++++++++++ backend/views/settings/index.php | 11 +++++++++++ backend/web/css/site.css | 11 ++++++++++- backend/web/js/option.js | 83 +++++++++++++++++++++++++++++++++++++++++++++++------------------------------------ common/config/main.php | 3 +++ common/translation/ru/app.php | 16 +++++++++++++++- db-migration/yarik/public.backup | Bin 29051 -> 0 bytes frontend/config/main.php | 4 +--- frontend/web/js/option.js | 5 +++++ 19 files changed, 348 insertions(+), 205 deletions(-) create mode 100644 backend/controllers/SettingsController.php create mode 100644 backend/views/layouts/settings.php create mode 100644 backend/views/settings/index.php diff --git a/backend/controllers/AdminMenuController.php b/backend/controllers/AdminMenuController.php index 28fbba4..c8b6466 100644 --- a/backend/controllers/AdminMenuController.php +++ b/backend/controllers/AdminMenuController.php @@ -14,6 +14,8 @@ use yii\filters\VerbFilter; */ class AdminMenuController extends Controller { + public $layout = 'settings'; + public function behaviors() { return [ @@ -117,4 +119,5 @@ class AdminMenuController extends Controller throw new NotFoundHttpException('The requested page does not exist.'); } } + } diff --git a/backend/controllers/SettingsController.php b/backend/controllers/SettingsController.php new file mode 100644 index 0000000..31de354 --- /dev/null +++ b/backend/controllers/SettingsController.php @@ -0,0 +1,38 @@ + [ + 'class' => 'yii\web\ErrorAction', + ], + ]; + } + + public function actionIndex() + { + return $this->render('index'); + } + +} diff --git a/backend/models/AdminMenu.php b/backend/models/AdminMenu.php index 9755591..316afd3 100644 --- a/backend/models/AdminMenu.php +++ b/backend/models/AdminMenu.php @@ -23,6 +23,8 @@ use Yii; */ class AdminMenu extends \yii\db\ActiveRecord { + + public $parentt; /** * @inheritdoc */ @@ -39,7 +41,7 @@ class AdminMenu extends \yii\db\ActiveRecord return [ [['parent_id', 'active', 'hide_min', 'sort'], 'integer'], [['name'], 'required'], - [['name', 'path', 'params'], 'string'] + [['name', 'path', 'params','parentt'], 'string'] ]; } @@ -57,6 +59,7 @@ class AdminMenu extends \yii\db\ActiveRecord 'name' => Yii::t('app', 'Name'), 'path' => Yii::t('app', 'Path'), 'params' => Yii::t('app', 'Params'), + 'parentt' => Yii::t('app', 'Parent item') ]; } @@ -98,17 +101,17 @@ class AdminMenu extends \yii\db\ActiveRecord $roots = self::find()->where(['parent_id' => NULL])->with(['adminMenus'])->all(); foreach($roots as $root) { if($root->adminMenus) { - $result[] = ['label' => $root->name, 'id' => $root->id, 'options' => ['class' => 'header']]; + $result[] = ['label' => Yii::t('app', $root->name), 'id' => $root->id, 'options' => ['class' => 'header']]; foreach($root->adminMenus as $submenu) { if($submenu->adminMenus) { $items = []; foreach($submenu->adminMenus as $item) { - $items[] = ['label' => $item->name, 'id' => $item->id, 'icon' => 'fa fa-circle-o', 'url' => array_merge([$item->path], \common\models\Tools::parseUrlParams($item->params))]; + $items[] = ['label' => Yii::t('app', $item->name), 'id' => $item->id, 'icon' => 'fa fa-circle-o', 'url' => array_merge([$item->path], \common\models\Tools::parseUrlParams($item->params))]; } - $result[] = ['label' => $submenu->name, 'id' => $submenu->id, 'icon' => 'fa fa-circle-o', 'url' => '#', 'items' => $items]; + $result[] = ['label' => Yii::t('app', $submenu->name), 'id' => $submenu->id, 'icon' => 'fa fa-circle-o', 'url' => '#', 'items' => $items]; unset($items); } else { - $result[] = ['label' => $submenu->name, 'id' => $submenu->id, 'icon' => 'fa fa-circle-o', 'url' => array_merge([$submenu->path], \common\models\Tools::parseUrlParams($submenu->params))]; + $result[] = ['label' => Yii::t('app', $submenu->name), 'id' => $submenu->id, 'icon' => 'fa fa-circle-o', 'url' => array_merge([$submenu->path], \common\models\Tools::parseUrlParams($submenu->params))]; } } } @@ -124,14 +127,26 @@ class AdminMenu extends \yii\db\ActiveRecord if($root->adminMenus) { $items = []; foreach($root->adminMenus as $submenu) { - $items[] = ['label' => $submenu->name, 'id' => $submenu->id]; + $items[] = ['label' => Yii::t('app', $submenu->name), 'id' => $submenu->id]; } - $result[] = ['label' => $root->name, 'id' => $root->id, 'items' => $items]; + $result[] = ['label' => Yii::t('app', $root->name), 'id' => $root->id, 'items' => $items]; unset($items); } else { - $result[] = ['label' => $root->name, 'id' => $root->id]; + $result[] = ['label' => Yii::t('app', $root->name), 'id' => $root->id]; } } return $result; } + + public function beforeSave($insert) + { + if (parent::beforeSave($insert)) { + if(!$this->parent_id) { + $this->parent_id = NULL; + } + return true; + } else { + return false; + } + } } diff --git a/backend/models/AdminMenuSearch.php b/backend/models/AdminMenuSearch.php index 5df3b63..534efda 100644 --- a/backend/models/AdminMenuSearch.php +++ b/backend/models/AdminMenuSearch.php @@ -12,6 +12,8 @@ use backend\models\AdminMenu; */ class AdminMenuSearch extends AdminMenu { + + /** * @inheritdoc */ @@ -19,7 +21,7 @@ class AdminMenuSearch extends AdminMenu { return [ [['id', 'parent_id', 'active', 'hide_min', 'sort'], 'integer'], - [['name', 'path', 'params'], 'safe'], + [['name', 'path', 'params','parentt'], 'safe'], ]; } @@ -45,6 +47,24 @@ class AdminMenuSearch extends AdminMenu $dataProvider = new ActiveDataProvider([ 'query' => $query, + 'pagination' => [ + 'pageSize' => 5 + ], + 'sort' => [ + 'attributes' => [ + 'id', + 'name', + 'path', + 'params', + 'active', + 'hide_min', + 'parentt' => [ + 'asc' => ['name' => SORT_ASC], + 'desc' => ['name' => SORT_DESC], + 'default' => SORT_DESC + ] + ] + ] ]); $this->load($params); @@ -60,12 +80,14 @@ class AdminMenuSearch extends AdminMenu 'parent_id' => $this->parent_id, 'active' => $this->active, 'hide_min' => $this->hide_min, - 'sort' => $this->sort, + 'sort' => $this->sort ]); + $query->andFilterWhere(['like', 'name', $this->name]) ->andFilterWhere(['like', 'path', $this->path]) - ->andFilterWhere(['like', 'params', $this->params]); + ->andFilterWhere(['like', 'params', $this->params]) + ->andFilterWhere(['in', 'parent_id', $this->find()->select(['id'])->andFilterWhere(['like', 'name', $this->parentt])->column()]); return $dataProvider; } diff --git a/backend/views/admin-menu/_form.php b/backend/views/admin-menu/_form.php index 1d96cd5..8bfa3fa 100644 --- a/backend/views/admin-menu/_form.php +++ b/backend/views/admin-menu/_form.php @@ -16,22 +16,6 @@ use yii\widgets\ActiveForm; field($model, 'name')->textInput() ?> -

- - field($model, 'active')->checkbox() ?> field($model, 'hide_min')->checkbox() ?> @@ -40,8 +24,36 @@ use yii\widgets\ActiveForm; field($model, 'params')->textInput() ?> +
+
+ +
+
    + field($model, 'parent_id', ['options' => ['class' => 'form-group list-group-item level0 checkboxer_container', 'tag' => 'li']])->error(false)->radio(['value' => 0, 'uncheck' => null, 'label' => Yii::t('app', 'root'), 'labelOptions' => ['class' => 'checkboxer_label']]); + foreach($roots as $root) { + echo $form->field($model, 'parent_id', ['options' => ['class' => 'form-group list-group-item level1 checkboxer_container', 'tag' => 'li']])->error(false)->radio(['value' => $root['id'], 'uncheck' => null, 'label' => Yii::t('app', $root['label']), 'labelOptions' => ['class' => 'checkboxer_label']]); + if($root['items']) { + foreach($root['items'] as $submenu) { + echo $form->field($model, 'parent_id', ['options' => ['class' => 'form-group list-group-item level2 checkboxer_container', 'tag' => 'li']])->error(false)->radio(['value' => $submenu['id'], 'uncheck' => null, 'label' => Yii::t('app', $submenu['label']), 'labelOptions' => ['class' => 'checkboxer_label']]); + } + } + } + ?> +
+
+
+
+
- isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => ($model->isNewRecord ? 'btn btn-success' : 'btn btn-primary') . ' btn-flat']) ?>
diff --git a/backend/views/admin-menu/create.php b/backend/views/admin-menu/create.php index 47ff30c..fe076d8 100644 --- a/backend/views/admin-menu/create.php +++ b/backend/views/admin-menu/create.php @@ -11,11 +11,12 @@ $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Admin Menus'), 'url' $this->params['breadcrumbs'][] = $this->title; ?>
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> +
+
+ render('_form', [ + 'model' => $model, + ]) ?> +
+
diff --git a/backend/views/admin-menu/index.php b/backend/views/admin-menu/index.php index a099ff0..cac4d54 100644 --- a/backend/views/admin-menu/index.php +++ b/backend/views/admin-menu/index.php @@ -10,31 +10,82 @@ use yii\grid\GridView; $this->title = Yii::t('app', 'Admin Menus'); $this->params['breadcrumbs'][] = $this->title; ?> -
+
-

title) ?>

render('_search', ['model' => $searchModel]); ?> -

- 'btn btn-success']) ?> -

- $dataProvider, 'filterModel' => $searchModel, + 'showFooter' => true, + 'layout' => "
+ +
+ {pager} +
+
+
+ {items} +
+ ", 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - - 'id', - 'parent_id', - 'active', - 'hide_min', - 'sort', - // 'name', - // 'path', - // 'params', - ['class' => 'yii\grid\ActionColumn'], + 'id', + 'name', + 'path', + 'params', + [ + 'format' => 'raw', + 'filter' => [ + '1'=>'Отображаются', + '0'=>'Скрытые', + ], + 'value' => function($data){ + if($data->active){ + $status_img = ''; + } else { + $status_img = ''; + } + return $status_img; + }, + 'attribute'=>'active', + ], + [ + 'attribute' => 'parentt', + 'content' => + function($model, $key, $index, $column) { + if($model->parent->id) { + return $model->parent->name; + } else { + return ''.Yii::t('app', 'Корневой элемент').''; + } + } + ], + [ + 'format' => 'raw', + 'filter' => [ + '1'=>'Отображаются', + '0'=>'Скрытые', + ], + 'value' => function($data){ + if($data->hide_min){ + $status_img = ''; + } else { + $status_img = ''; + } + return $status_img; + }, + 'attribute'=>'hide_min', + ], ], ]); ?> diff --git a/backend/views/admin-menu/update.php b/backend/views/admin-menu/update.php index d025a3a..bf18d47 100644 --- a/backend/views/admin-menu/update.php +++ b/backend/views/admin-menu/update.php @@ -5,17 +5,13 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model backend\models\AdminMenu */ -$this->title = Yii::t('app', 'Update {modelClass}: ', [ - 'modelClass' => 'Admin Menu', -]) . ' ' . $model->name; +$this->title = Yii::t('app', 'Update') . ': ' . $model->name; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Admin Menus'), 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; $this->params['breadcrumbs'][] = Yii::t('app', 'Update'); ?>
-

title) ?>

- render('_form', [ 'model' => $model, ]) ?> diff --git a/backend/views/admin-menu/view.php b/backend/views/admin-menu/view.php index 0801490..80c6e94 100644 --- a/backend/views/admin-menu/view.php +++ b/backend/views/admin-menu/view.php @@ -6,24 +6,11 @@ use yii\widgets\DetailView; /* @var $this yii\web\View */ /* @var $model backend\models\AdminMenu */ -$this->title = $model->name; +$this->title = Yii::t('app', 'Admin Menus').': '.$model->name; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Admin Menus'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> -
- -

title) ?>

- -

- $model->id], ['class' => 'btn btn-primary']) ?> - $model->id], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), - 'method' => 'post', - ], - ]) ?> -

+
$model, @@ -39,4 +26,18 @@ $this->params['breadcrumbs'][] = $this->title; ], ]) ?> + +
diff --git a/backend/views/layouts/left.php b/backend/views/layouts/left.php index 28236a8..0660ccd 100644 --- a/backend/views/layouts/left.php +++ b/backend/views/layouts/left.php @@ -13,103 +13,16 @@ Online
- - where(['parent_id' => NULL])->all(); - foreach($roots as $root) { - if($root->adminMenus) { - echo "
  • {$root->name}
  • "; - echo "
  • "; - foreach($root->adminMenus as $submenu) { - if($submenu->adminMenus) { - echo \yii\helpers\Html::a("".\yii\helpers\Html::encode($submenu->name).""); - echo ""; - } else { - echo \yii\helpers\Html::a("".\yii\helpers\Html::encode($submenu->name)."", array_merge([$submenu->path], \common\models\Tools::parseUrlParams($submenu->params))); - } - } - echo "
  • "; - } - } - ?> - - */ ?> ['class' => 'sidebar-menu'], - 'items' => \backend\models\AdminMenu::buildMenu(), + 'items' => array_merge( + \backend\models\AdminMenu::buildMenu(), + [ + ['label' => Yii::t('app', 'Settings'), 'url' => ['/settings/index'], 'icon' => 'fa fa-gear'] + ] + ), ]) ?> - ['class' => 'sidebar-menu'], - 'items' => [ - ['label' => 'Термины', 'icon' => 'fa fa-file-code-o', 'url' => ['/termin/']], - //['label' => Yii::t('app', 'Pages'), 'icon' => 'fa fa-file-code-o', 'url' => ['/page/']], - //['label' => 'Каталог', 'icon' => 'fa fa-file-code-o', 'url' => ['/catalog/']], - ['label' => 'Меню', 'icon' => 'fa fa-file-code-o', 'url' => ['/menu/']], - ['label' => 'Заявки', 'icon' => 'fa fa-file-code-o', 'url' => ['/site/requests/']], - ['label' => 'Gii', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii']], - ['label' => 'Debug', 'icon' => 'fa fa-dashboard', 'url' => ['/debug']], - ['label' => 'Login', 'url' => ['site/login'], 'visible' => Yii::$app->user->isGuest], - ['label' => 'Пользователи', 'icon' => 'fa fa-file-code-o', 'url' => ['/user/']], - [ - 'label' => Yii::t('app', 'Blog'), - 'icon' => 'fa fa-share', - 'url' => '#', - 'items' => [ - ['label' => Yii::t('app', 'Static pages'), 'icon' => 'fa fa-file-code-o', 'url' => ['blog/articles', 'category_id' => '63'],], - ['label' => Yii::t('app', 'Categories'), 'icon' => 'fa fa-dashboard', 'url' => ['blog/categories'],], - ['label' => Yii::t('app', 'Articles'), 'icon' => 'fa fa-dashboard', 'url' => ['blog/articles'],], - ], - ], - [ - 'label' => 'Роли', - 'icon' => 'fa fa-share', - 'url' => '#', - 'items' => [ - ['label' => 'Управление ролями', 'icon' => 'fa fa-file-code-o', 'url' => ['/permit/access/role'],], - ['label' => 'Управление правами доступа', 'icon' => 'fa fa-dashboard', 'url' => ['/permit/access/permission'],], - ], - ], - [ - 'label' => 'Same tools', - 'icon' => 'fa fa-share', - 'url' => '#', - 'items' => [ - ['label' => 'Gii', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii'],], - ['label' => 'Debug', 'icon' => 'fa fa-dashboard', 'url' => ['/debug'],], - [ - 'label' => 'Level One', - 'icon' => 'fa fa-circle-o', - 'url' => '#', - 'items' => [ - ['label' => 'Level Two', 'icon' => 'fa fa-circle-o', 'url' => '#',], - [ - 'label' => 'Level Two', - 'icon' => 'fa fa-circle-o', - 'url' => '#', - 'items' => [ - ['label' => 'Level Three', 'icon' => 'fa fa-circle-o', 'url' => '#',], - ['label' => 'Level Three', 'icon' => 'fa fa-circle-o', 'url' => '#',], - ], - ], - ], - ], - ], - ], - ], - ] - ) ?> - */ - ?> diff --git a/backend/views/layouts/settings.php b/backend/views/layouts/settings.php new file mode 100644 index 0000000..6862d3a --- /dev/null +++ b/backend/views/layouts/settings.php @@ -0,0 +1,40 @@ +beginContent('@app/views/layouts/main.php'); +?> +
    +
    +
    +
    +

    +
    + +
    +
    +
    + [ + 'class' => 'nav nav-pills nav-stacked' + ], + 'items' => [ + ['label' => Yii::t('app', 'Admin Menus'), 'url' => ['/admin-menu/index'], 'icon' => 'fa fa-navicon'], + ['label' => Yii::t('app', 'Next menu item'), 'url' => ['#'], 'icon' => 'fa fa-arrow-circle-o-right'], + ], + ]); + ?> +
    +
    +
    +
    + +
    +
    +endContent() ?> \ No newline at end of file diff --git a/backend/views/settings/index.php b/backend/views/settings/index.php new file mode 100644 index 0000000..8850caa --- /dev/null +++ b/backend/views/settings/index.php @@ -0,0 +1,11 @@ +title = Yii::t('app', 'Settings'); +$this->params['breadcrumbs'][] = $this->title; +?> diff --git a/backend/web/css/site.css b/backend/web/css/site.css index 18332a2..7a12080 100644 --- a/backend/web/css/site.css +++ b/backend/web/css/site.css @@ -123,4 +123,13 @@ a.desc:after { .checkboxer .checkboxer_label input[type=radio] { position: absolute; clip: rect(0,0,0,0); -} \ No newline at end of file +} +.action_link { + float: left; +} +.admin_grid_action { + padding: 0 20px; +} +.admin_grid_action .pagination { + margin: 0; +} diff --git a/backend/web/js/option.js b/backend/web/js/option.js index 8086cd7..a585b51 100644 --- a/backend/web/js/option.js +++ b/backend/web/js/option.js @@ -12,6 +12,12 @@ function readURL(input) { } return urls; } +function checkboxerInit() { + $.each($('.checkboxer input[type=radio]:checked'), function(index, value) { + console.log(value); + $(value).trigger('change'); + }); +} $(function() { var counter = 0; $(document).on('click', '.add_row', function() { @@ -36,42 +42,6 @@ $(function() { $(document).on('click', '.remove_lang', function() { $(this).parents('.form-wrapper').remove(); }); - if($('#lang-tabs li').length > 1) { - $('#lang-tabs li').append('') - } - $(document).on('click', '#lang-dropdown li a[data-lang]', function() { - var lang = $(this).data('lang'); - var flag = $(this).find('span').first().clone(); - var el = $(this); - $.get('/blog/ajax/category-form', { lang_id: lang }, function(data) { - $('#lang-tabs li').removeClass('active'); - $('#lang-tabs').append('
  • '+$('

    ').append($(flag)).html()+'

  • '); - $('.lang-tab-content .tab-pane.active').removeClass('active'); - $('.lang-tab-content').append($(data).find('.ajax-loaded').first()); - $('body').append($(data).filter('script')); - $(el).parent().remove(); - if(!$('#lang-dropdown li').length) { - $('#dropdownLang').addClass('disabled'); - } - if($('#lang-tabs li').length > 1) { - $('#lang-tabs li').append('') - } - }); - }); - $(document).on('click', '.remove-lang', function() { - var lang = $(this).parent().data('lang'); - var flag = $(this).parent().find('span.flag').first().clone(); - $('#lang-'+lang).remove(); - $('#lang-dropdown').append('
  • '+$('

    ').append($(flag)).html()+'

  • '); - $('#dropdownLang').removeClass('disabled'); - $(this).parent().remove(); - if($('#lang-tabs li').length <= 1) { - $('#lang-tabs li').find('.remove-lang').remove(); - } - if(!$('#lang-tabs>li.active').length) { - $('#lang-tabs>li').first().find('a').tab('show'); - } - }); $(document).on('change', '.image_inputs_field', function() { readURL(this); }); @@ -89,9 +59,50 @@ $(function() { } return false; }); + $.each($('.nav-tabs.f32'), function(key, value) { + if($(value).find('li').length > 1) { + $(value).find('li').append(''); + } + }); + $(document).on('click', '.dropdown-menu.f32 li a[data-lang]', function() { + var lang = $(this).data('lang'); + var flag = $(this).find('span').first().clone(); + var el = $(this); + var id = $(this).attr('href').substr(1); + $.get(form[id], { lang_id: lang, widget_id: id }, function(data) { + $('#'+id+'-tabs li').removeClass('active'); + $('#'+id+'-tabs').append('
  • '+$('

    ').append($(flag)).html()+'

  • '); + $('#tab-content-'+id+' .tab-pane.active').removeClass('active'); + $('#tab-content-'+id).append($(data).find('.ajax-loaded').first()); + $('body').append($(data).filter('script')); + $(el).parent().remove(); + if(!$('#lang-'+id+' li').length) { + $('#'+id+'Lang').addClass('disabled'); + } + if($('#'+id+'-tabs li').length > 1) { + $('#'+id+'-tabs li').append('') + } + }); + }); + $(document).on('click', '.remove-lang', function() { + var lang = $(this).parent().data('lang'); + var flag = $(this).parent().find('span.flag').first().clone(); + var id = $(this).parent().find('a[aria-controls]').first().attr('aria-controls').substr(0,8); + $('#'+id+'-'+lang).remove(); + $('#lang-'+id).append('
  • '+$('

    ').append($(flag)).html()+'

  • '); + $('#'+id+'Lang').removeClass('disabled'); + $(this).parent().remove(); + if($('#'+id+'-tabs li').length <= 1) { + $('#'+id+'-tabs li').find('.remove-lang').remove(); + } + if(!$('#'+id+'-tabs>li.active').length) { + $('#'+id+'-tabs>li').first().find('a').tab('show'); + } + }); $(document).on('change', '.checkboxer .checkboxer_label input[type=radio]', function() { console.log($(this).val()); $(this).parents('.checkboxer').find('.checkboxer_container').removeClass('active'); $(this).parents('.checkboxer_container').addClass('active'); }); + checkboxerInit(); }); \ No newline at end of file diff --git a/common/config/main.php b/common/config/main.php index 21154a7..01d0899 100644 --- a/common/config/main.php +++ b/common/config/main.php @@ -8,6 +8,9 @@ return [ 'userClass' => 'common\models\User' ] ], + 'blog' => [ + 'class' => 'common\modules\blog\Module', + ], ], 'components' => [ 'cache' => [ diff --git a/common/translation/ru/app.php b/common/translation/ru/app.php index f15fdf2..ff22385 100644 --- a/common/translation/ru/app.php +++ b/common/translation/ru/app.php @@ -58,9 +58,23 @@ return [ 'Category update' => 'Редактирование категории', 'Article create' => 'Создание статьи', 'Update category' => 'Редактирование категории', - 'Select parent' => 'Выберать родителя', + 'Select parent' => 'Выбрать родителя', 'Blog' => 'Блог', 'Static pages' => 'Статические страницы', + 'Create Admin Menu' => 'Создать элемент меню', + 'Admin Menus' => 'Административное меню', + 'Hide Min' => 'Спрятать в свернутом', + 'Path' => 'Путь', + 'Params' => 'Параметры', + 'Parent item' => 'Родительский элемент', + 'Active Menu' => 'Активный', + 'Not Active Menu' => 'Неактивный', + 'Show Menu Min' => 'Отобразить', + 'Hide Menu Min' => 'Спрятать', + 'Update' => 'Редактировать', + 'Delete' => 'Удалить', + 'Settings categories' => 'Разделы настроек', + 'Back' => 'Назад', // Вова 'page' => 'Страница', diff --git a/db-migration/yarik/public.backup b/db-migration/yarik/public.backup index a65e399..3ae90e6 100644 Binary files a/db-migration/yarik/public.backup and b/db-migration/yarik/public.backup differ diff --git a/frontend/config/main.php b/frontend/config/main.php index 82c7344..2a71fb5 100644 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -16,9 +16,7 @@ return [ 'bootstrap' => ['log'], 'controllerNamespace' => 'frontend\controllers', 'modules' => [ - 'blog' => [ - 'class' => 'common\modules\blog\Module', - ], + ], 'components' => [ //'PageController'=>[ diff --git a/frontend/web/js/option.js b/frontend/web/js/option.js index 60ac1c3..7351b7e 100644 --- a/frontend/web/js/option.js +++ b/frontend/web/js/option.js @@ -93,4 +93,9 @@ $(function() { $('#'+id+'-tabs>li').first().find('a').tab('show'); } }); + $(document).on('change', '.checkboxer .checkboxer_label input[type=radio]', function() { + console.log($(this).val()); + $(this).parents('.checkboxer').find('.checkboxer_container').removeClass('active'); + $(this).parents('.checkboxer_container').addClass('active'); + }); }); \ No newline at end of file -- libgit2 0.21.4