Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 873 | Rev 875 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 873 Rev 874
Línea 45... Línea 45...
45
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
45
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
46
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
46
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
Línea 47... Línea 47...
47
 
47
 
Línea -... Línea 48...
-
 
48
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
-
 
49
 
Línea 48... Línea 50...
48
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
50
// JsRender //
Línea 49... Línea 51...
49
 
51
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
50
 
52
 
-
 
53
 
-
 
54
$status_active = \LeadersLinked\Model\Competency::STATUS_ACTIVE;
51
 
55
 
52
$status_active = \LeadersLinked\Model\Competency::STATUS_ACTIVE;
56
$this->inlineScript()->captureStart();
53
 
57
echo <<<JS
54
$this->inlineScript()->captureStart();
58
 
55
echo <<<JS
59
    let behaviors = [];
Línea 478... Línea 482...
478
    $('button.btn-edit-cancel').click(function(e) {
482
    $('button.btn-edit-cancel').click(function(e) {
479
        e.preventDefault();
483
        e.preventDefault();
480
        $('#row-form').hide();
484
        $('#row-form').hide();
481
        $('#row-list').show();
485
        $('#row-list').show();
482
    });
486
    });
-
 
487
 
-
 
488
    /**
-
 
489
     * Add Behavior to array
-
 
490
     */
-
 
491
    const addBehavior = (description, level) =>{
-
 
492
        behaviors.push(
-
 
493
            'id' : new Date().d.getTime()
-
 
494
            'description' : description,
-
 
495
            'level': level
-
 
496
        );
-
 
497
        renderData(behaviors);
-
 
498
    }
-
 
499
    
-
 
500
    /**
-
 
501
     * Edit item behavior
-
 
502
     */
-
 
503
    const editBehavior = (id, description, level ) =>{
-
 
504
 
-
 
505
        behaviors.map((item)=>{
-
 
506
 
-
 
507
            if(item.id == id){
-
 
508
 
-
 
509
                item.description = description;
-
 
510
                item.level = level
-
 
511
            }
-
 
512
 
-
 
513
        });
-
 
514
 
-
 
515
        renderData(behaviors);
-
 
516
 
-
 
517
        
-
 
518
    }
-
 
519
    /**
-
 
520
     * Remove behavior
-
 
521
     */
-
 
522
    const removeBehavior = (id) =>{
-
 
523
        behaviors = behaviors.filter((item)=>item.id != id);
-
 
524
        renderData(behaviors);
-
 
525
    }
-
 
526
 
-
 
527
     /**
-
 
528
     * Render Sections data
-
 
529
     */
-
 
530
    const renderData = (data) => $("#rows").html($("#behaviorTemplate").render(data));
-
 
531
 
-
 
532
 
483
});
533
});
484
JS;
534
JS;
485
$this->inlineScript()->captureEnd();
535
$this->inlineScript()->captureEnd();
486
?>
536
?>
Línea 669... Línea 719...
669
         </div>
719
         </div>
670
      </form>
720
      </form>
671
   </div>
721
   </div>
672
</div>
722
</div>
Línea -... Línea 723...
-
 
723
 
-
 
724
<script id="behaviorTemplate" type="text/x-jsrender">
-
 
725
 <div class="table-responsive">
-
 
726
                    <table class="table table-bordered">
-
 
727
                        <thead>
673
 
728
                            <tr>
-
 
729
 
-
 
730
                                <th style="width: 60%;">LABEL_DESCRIPTION</th>
-
 
731
                                <th style="width: 20%;">LABEL_LEVEL</th>
-
 
732
                                <th style="width: 20%;">LABEL_ACTIONS</th>
-
 
733
                            </tr>
-
 
734
                        </thead>
-
 
735
                        <tbody>
-
 
736
                            <tr >
-
 
737
                                <td class="text-left">{{:description}}</td>
-
 
738
                                <td>{{:level}}</td>
-
 
739
 
-
 
740
                                <td>
-
 
741
                                    <button class="btn btn-default btn-edit-conduct" data-conduct="{{:id}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_CONDUCT"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_CONDUCT </button>
-
 
742
                                    <button class="btn btn-default btn-delete-conduct" data-conduct="{{:id}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_CONDUCT"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_CONDUCT </button> 
-
 
743
                                    
-
 
744
                                </td>
-
 
745
                            </tr>
-
 
746
                          
-
 
747
                        </tbody>
-
 
748
                    </table>
-
 
749
                </div>