Commit 6f63eee1e4a8d4694f779dc0529553fba512f0aa

Authored by Yarik
1 parent 43abf64e

test

frontend/views/layouts/admin.php
1 <?php 1 <?php
2 2
3 -use yii\widgets\Breadcrumbs; 3 + use yii\base\View;
  4 + use yii\widgets\Breadcrumbs;
4 use yii\widgets\Menu; 5 use yii\widgets\Menu;
5 6
6 \frontend\assets\AdminAsset::register($this); 7 \frontend\assets\AdminAsset::register($this);
7 -/* @var $content string */ 8 + /**
  9 + * @var string $content
  10 + * @var View $this
  11 + */
8 $this->beginContent('@app/views/layouts/main.php'); 12 $this->beginContent('@app/views/layouts/main.php');
9 ?> 13 ?>
10 -  
11 <div class="section-box admin-page"> 14 <div class="section-box admin-page">
12 <div class="box-wr"> 15 <div class="box-wr">
13 <div class="box-all"> 16 <div class="box-all">
@@ -48,28 +51,34 @@ $this-&gt;beginContent(&#39;@app/views/layouts/main.php&#39;); @@ -48,28 +51,34 @@ $this-&gt;beginContent(&#39;@app/views/layouts/main.php&#39;);
48 [ 51 [
49 'label' => 'Команда', 52 'label' => 'Команда',
50 'url' => ['accounts/team'], 53 'url' => ['accounts/team'],
  54 + 'active' => preg_match('/^team.*$/', $this->context->action->id)?true:false,
51 ], 55 ],
52 56
53 [ 57 [
54 'label' => 'Вакансии', 58 'label' => 'Вакансии',
55 'url' => ['accounts/vacancy'], 59 'url' => ['accounts/vacancy'],
  60 + 'active' => preg_match('/^vacancy.*$/', $this->context->action->id)?true:false,
56 ], 61 ],
57 [ 62 [
58 'label' => 'Ваши проекты', 63 'label' => 'Ваши проекты',
59 'url' => ['accounts/projects'], 64 'url' => ['accounts/projects'],
  65 + 'active' => preg_match('/^projects.*$/', $this->context->action->id)?true:false,
60 ], 66 ],
61 [ 67 [
62 'label' => 'Портфолио', 68 'label' => 'Портфолио',
63 'url' => ['accounts/portfolio'], 69 'url' => ['accounts/portfolio'],
  70 + 'active' => preg_match('/^portfolio.*$/', $this->context->action->id)?true:false,
64 ], 71 ],
65 72
66 [ 73 [
67 'label' => 'Блог', 74 'label' => 'Блог',
68 'url' => ['accounts/blog'], 75 'url' => ['accounts/blog'],
  76 + 'active' => preg_match('/^blog.*$/', $this->context->action->id)?true:false,
69 ], 77 ],
70 [ 78 [
71 'label' => 'Галерея Изображения', 79 'label' => 'Галерея Изображения',
72 'url' => ['accounts/gallery'], 80 'url' => ['accounts/gallery'],
  81 + 'active' => preg_match('/^gallery(?!-video).*$/', $this->context->action->id)?true:false,
73 ], 82 ],
74 [ 83 [
75 'label' => 'Галерея Видео', 84 'label' => 'Галерея Видео',
frontend/web/js/fieldWidget.js
1 $(function(){ 1 $(function(){
2 - 2 + $.each($('.delete-field-item'), function(index, value) {
  3 + var container = $(value).parents('.field_list').first();
  4 + var count = $(container).find('.form-group').length;
  5 + if(count <= 1) {
  6 + $(container).find('.delete-field-item').addClass('hidden');
  7 + }
  8 + });
3 $(document).on('click', '.delete-field-item', function(){ 9 $(document).on('click', '.delete-field-item', function(){
4 var container = $(this).parents('.field_list').first(); 10 var container = $(this).parents('.field_list').first();
5 $(this).parent('.form-group').remove(); 11 $(this).parent('.form-group').remove();