Commit 01836820a29c11d996d28eb21e70c88ed97b2f3f

Authored by Administrator
1 parent d6922c7c

add Vitaliy's widgets

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',
frontend/web/js/fieldWidget.js
1 -$('body').on('click', '.delete-field-item', function(){ 1 +$(document).ready(function(){
  2 + $('body').on('click', '.delete-field-item', function(){
  3 + console.log('sfddf');
  4 + $(this).parent('.form-group').remove();
2 5
3 - $(this).parent('.form-group').remove();  
4 -  
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); 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);
15 16
16 -});  
17 \ No newline at end of file 17 \ No newline at end of file
  18 + });
  19 +});