Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 1015 Rev 1016
Línea 252... Línea 252...
252
    /**
252
    /**
253
     * Clicked add new section
253
     * Clicked add new section
254
     */
254
     */
255
    $('#btn-add-section').click(function(e) {
255
    $('#btn-add-section').click(function(e) {
256
        $('#form-section #id_section').val('');
256
        $('#form-section #id_section').val('');
257
        $('#form-section #name-section').val('');
257
        $('#form-section #title-section').val('');
258
        $('#form-section #text-section').val('');
258
        $('#form-section #text-section').val('');
259
        $('#form-section #type-section').val($('#form-section #type-section option:first').val());
259
        $('#form-section #type-section').val($('#form-section #type-section option:first').val());
260
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
260
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
261
        $('#modal-section').modal('show');
261
        $('#modal-section').modal('show');
262
    });
262
    });
263
    /**
263
    /**
264
     * Clicked edit section
264
     * Clicked edit section
265
     */
265
     */
266
    $('#btn-edit-section').click(function(e) {
266
    $('#btn-edit-section').click(function(e) {
-
 
267
        var id = $(this).data('conduct');
-
 
268
        sections.map((item) => {
-
 
269
            if (section.id == id) {
-
 
270
 
-
 
271
                $('#form-section #id_section').val(item.section_id);
-
 
272
        $('#form-section #title-section').val(item.title);
-
 
273
        $('#form-section #text-text').val(item.text);
-
 
274
        $('#form-section #type-section').val(item.section);
-
 
275
        $('#modal-section').modal('show');
-
 
276
 
-
 
277
                return;
-
 
278
            }
-
 
279
        });
-
 
280
    });
-
 
281
 
-
 
282
    /**
-
 
283
     * Clicked edit section
-
 
284
     */
-
 
285
    $('#btn-remove-section').click(function(e) {
267
        $('#modal-section').modal('show');
286
        $('#modal-section').modal('show');
268
    });
287
    });
Línea 269... Línea 288...
269
 
288
 
270
 
289
 
271
    /**
290
    /**
272
     * Clicked save section
291
     * Clicked save section
Línea 273... Línea 292...
273
     */
292
     */
Línea 274... Línea 293...
274
    $('#btn-save-section').click(function(e) {
293
    $('#btn-save-section').click(function(e) {
275
        
294
        
Línea 276... Línea 295...
276
        if($('#name-section').val()==''){
295
        if($('#title-section').val()==''){
277
 
296
 
278
            $.fn.showError('Ingrese un nombre');
297
            $.fn.showError('Ingrese un nombre');
279
            return;
298
            return;
280
 
299
 
281
        }else{
300
        }else{
282
            if($('#id_section').val()==""){
301
            if($('#id_section').val()==""){
283
                addSection(
302
                addSection(
284
                    $('#name-section').val(),
303
                    $('#title-section').val(),
285
                    $('#text-section').val(),
304
                    $('#text-section').val(),
286
                    $('#type-section').val(),
305
                    $('#type-section').val(),
287
                    ) 
306
                    ) 
288
            }else{
307
            }else{
289
                editSection(
308
                editSection(
290
                    $('#id_section').val(),
309
                    $('#id_section').val(),
291
                    $('#name-section').val(),
310
                    $('#title-section').val(),
Línea 561... Línea 580...
561
                            <span aria-hidden="true">&times;</span>
580
                            <span aria-hidden="true">&times;</span>
562
                        </button>
581
                        </button>
563
                    </div>
582
                    </div>
564
                    <div class="modal-body">
583
                    <div class="modal-body">
565
                    <div class="form-group">
584
                    <div class="form-group">
566
                            <label for="name-section">LABEL_FIRST_NAME</label>
585
                            <label for="title-section">LABEL_FIRST_NAME</label>
567
                            <input type="text" name="name-section" id="name-section" class="form-control" maxlength="50" value="" />
586
                            <input type="text" name="title-section" id="title-section" class="form-control" maxlength="50" value="" />
568
                        </div>
587
                        </div>
569
                        <div class="form-group">
588
                        <div class="form-group">
570
                            <label for="text-section">LABEL_TEXT</label>
589
                            <label for="text-section">LABEL_TEXT</label>
571
                            <textarea  name="text-section" id="text-section" rows="5" class="form-control"></textarea>
590
                            <textarea  name="text-section" id="text-section" rows="5" class="form-control"></textarea>
572
                        </div>
591
                        </div>
Línea 670... Línea 689...
670
                            </tr>
689
                            </tr>
671
                            {{for options}}
690
                            {{for options}}
672
                            <tr >
691
                            <tr >
673
                                <td class="text-left">--LABEL_OPTION</td>
692
                                <td class="text-left">--LABEL_OPTION</td>
674
                                <td class="text-left">
693
                                <td class="text-left">
675
                                    {{:text}}
694
                                    {{:title}}
676
                                </td>
695
                                </td>
677
                                <td></td>
696
                                <td></td>
678
                                <td></td>
697
                                <td></td>
679
                                <td>
698
                                <td>
680
                                    <button type="button" class="btn btn-default btn-edit-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_OPTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_OPTION</button> 
699
                                    <button type="button" class="btn btn-default btn-edit-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_OPTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_OPTION</button>