Commit 65bb818949c040072928817cece4ccc614690002
Merge remote-tracking branch 'origin/master'
Showing
6 changed files
with
40 additions
and
15 deletions
Show diff stats
backend/assets/AppAsset.php
@@ -23,7 +23,8 @@ class AppAsset extends AssetBundle | @@ -23,7 +23,8 @@ class AppAsset extends AssetBundle | ||
23 | 'css/flags32.css' | 23 | 'css/flags32.css' |
24 | ]; | 24 | ]; |
25 | public $js = [ | 25 | public $js = [ |
26 | - 'js/option.js' | 26 | + 'js/option.js', |
27 | + 'js/fieldWidget.js' | ||
27 | ]; | 28 | ]; |
28 | public $depends = [ | 29 | public $depends = [ |
29 | 'yii\web\JqueryAsset', | 30 | 'yii\web\JqueryAsset', |
backend/web/js/fieldWidget.js
1 | -$('body').on('click', '.delete-field-item', function(){ | 1 | +$(document).ready(function(){ |
2 | + $('body').on('click', '.delete-field-item', function(){ | ||
2 | 3 | ||
3 | - $(this).parent('.form-group').remove(); | 4 | + $(this).parent('.form-group').remove(); |
4 | 5 | ||
5 | -}); | 6 | + }); |
6 | 7 | ||
7 | 8 | ||
8 | -$('.add_field').click(function(){ | ||
9 | - var block = $('.fields_video_result'); | ||
10 | - var sub_block = '<div class="form-group">'+ | ||
11 | - '<input type="text" class="form-control" value="" name="Fields[video]['+ start_i++ +'][value]">'+ | ||
12 | - '<span data-id="none" title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span>'+ | ||
13 | - '<div>'; | ||
14 | - block.append(sub_block); | ||
15 | 9 | ||
10 | + $('.add_field').click(function(){ | ||
11 | + var block = $('.fields_video_result'); | ||
12 | + var sub_block = '<div class="form-group">'+ | ||
13 | + '<input type="text" class="form-control" value="" name="Fields[video]['+ start_i++ +'][value]">'+ | ||
14 | + '<span data-id="none" title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span>'+ | ||
15 | + '<div>'; | ||
16 | + block.append(sub_block); | ||
17 | + | ||
18 | + }); | ||
16 | }); | 19 | }); |
17 | \ No newline at end of file | 20 | \ No newline at end of file |
common/config/main-local.php
@@ -3,9 +3,9 @@ return [ | @@ -3,9 +3,9 @@ return [ | ||
3 | 'components' => [ | 3 | 'components' => [ |
4 | 'db' => [ | 4 | 'db' => [ |
5 | 'class' => 'yii\db\Connection', | 5 | 'class' => 'yii\db\Connection', |
6 | - 'dsn' => 'pgsql:host=localhost;port=5432;dbname=mfp_local', | ||
7 | - 'username' => 'postgres', | ||
8 | - 'password' => '', | 6 | + 'dsn' => 'pgsql:host=195.248.225.149;port=5432;dbname=mfp', |
7 | + 'username' => 'test33', | ||
8 | + 'password' => 'E4q2N7i9', | ||
9 | 'schemaMap' => [ | 9 | 'schemaMap' => [ |
10 | 'pgsql'=> [ | 10 | 'pgsql'=> [ |
11 | 'class'=>'yii\db\pgsql\Schema', | 11 | 'class'=>'yii\db\pgsql\Schema', |
common/widgets/views/education_field.php
@@ -9,7 +9,9 @@ use yii\helpers\Html; | @@ -9,7 +9,9 @@ use yii\helpers\Html; | ||
9 | <p class="btn btn-success add_field">Добавить поле</p> | 9 | <p class="btn btn-success add_field">Добавить поле</p> |
10 | 10 | ||
11 | 11 | ||
12 | - <?php $t = 0; for($i=1; $i <= count($model); $i++): | 12 | + <?php |
13 | + $t = 0; | ||
14 | + for($i=1; $i <= count($model); $i++): | ||
13 | $row = $i; | 15 | $row = $i; |
14 | 16 | ||
15 | ?> | 17 | ?> |
frontend/assets/AppAsset.php
@@ -34,6 +34,7 @@ class AppAsset extends AssetBundle | @@ -34,6 +34,7 @@ class AppAsset extends AssetBundle | ||
34 | '/js/forms.js', | 34 | '/js/forms.js', |
35 | '/js/jquery.MultiFile.js', | 35 | '/js/jquery.MultiFile.js', |
36 | '/js/myGallery_min.js', | 36 | '/js/myGallery_min.js', |
37 | + 'js/fieldWidget.js' | ||
37 | ]; | 38 | ]; |
38 | public $depends = [ | 39 | public $depends = [ |
39 | 'yii\web\YiiAsset', | 40 | 'yii\web\YiiAsset', |
1 | +$(document).ready(function(){ | ||
2 | + $('body').on('click', '.delete-field-item', function(){ | ||
3 | + console.log('sfddf'); | ||
4 | + $(this).parent('.form-group').remove(); | ||
5 | + | ||
6 | + }); | ||
7 | + | ||
8 | + | ||
9 | + $('.add_field').click(function(){ | ||
10 | + var block = $('.fields_video_result'); | ||
11 | + var sub_block = '<div class="form-group">'+ | ||
12 | + '<input type="text" class="form-control" value="" name="Fields[video]['+ start_i++ +'][value]">'+ | ||
13 | + '<span data-id="none" title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span>'+ | ||
14 | + '<div>'; | ||
15 | + block.append(sub_block); | ||
16 | + | ||
17 | + }); | ||
18 | +}); |