Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 1026 Rev 1027
Línea 57... Línea 57...
57
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
57
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
Línea 58... Línea 58...
58
 
58
 
59
$this->inlineScript()->captureStart();
59
$this->inlineScript()->captureStart();
Línea 60... Línea 60...
60
echo <<<JS
60
echo <<<JS
61
   
-
 
62
jQuery(document).ready(function($) {
61
   
63
 
62
   jQuery(document).ready(function($) {
64
    var allowEdit = $allowEdit;
63
    var allowEdit = $allowEdit;
65
    var allowDelete = $allowDelete;
64
    var allowDelete = $allowDelete;
66
    var sections = [];
65
    var sections = [];
Línea 217... Línea 216...
217
            'accept': 'application/json',
216
            'accept': 'application/json',
218
            'method': 'get',
217
            'method': 'get',
219
            'url': action,
218
            'url': action,
220
        }).done(function(response) {
219
        }).done(function(response) {
221
            if (response['success']) {
220
            if (response['success']) {
222
 
-
 
223
                $('#form-main').attr('action', action);
221
                $('#form-main').attr('action', action);
224
                $('#form-main #form-id').val(response['data']['id']),
222
                $('#form-main #form-id').val(response['data']['id']),
225
                $('#form-main #form-continue').val('0');
223
                    $('#form-main #form-continue').val('0');
226
                $('#form-main #form-name').val(response['data']['name']),
224
                $('#form-main #form-name').val(response['data']['name']),
227
 
-
 
228
                /*----------Set Ckeditor ------------*/
225
                    /*----------Set Ckeditor ------------*/
229
                CKEDITOR.instances['form-description'].setData(response['data']['description']);
226
                    CKEDITOR.instances['form-description'].setData(response['data']['description']);
230
                CKEDITOR.instances['form-text'].setData(response['data']['text']);
227
                CKEDITOR.instances['form-text'].setData(response['data']['text']);
231
 
-
 
232
                $('#form-main #form-language').val(response['data']['language']),
228
                $('#form-main #form-language').val(response['data']['language']),
233
                $('#form-main #form-status').val(response['data']['status']);
229
                    $('#form-main #form-status').val(response['data']['status']);
234
 
-
 
235
                /*-------------Render Sections -------*/
230
                /*-------------Render Sections -------*/
236
                
-
 
237
                renderSectionData();
231
                renderSectionData();
238
                
-
 
239
                $('#row-lists').hide();
232
                $('#row-lists').hide();
240
                $('#row-form').show();
233
                $('#row-form').show();
241
                $('#form-main #form-name').focus();
234
                $('#form-main #form-name').focus();
242
 
-
 
243
            } else {
235
            } else {
244
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
236
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
245
            }
237
            }
246
        }).fail(function(jqXHR, textStatus, errorThrown) {
238
        }).fail(function(jqXHR, textStatus, errorThrown) {
247
            $.fn.showError(textStatus);
239
            $.fn.showError(textStatus);
248
        });
240
        });
249
    });
241
    });
250
   
-
 
251
 
-
 
252
    /**
242
    /**
253
     * Clicked add new section
243
     * Clicked add new section
254
     */
244
     */
255
    $('#btn-add-section').click(function(e) {
245
    $('#btn-add-section').click(function(e) {
256
        $('#form-section #id_section').val('');
246
        $('#form-section #id-section').val('');
257
        $('#form-section #title-section').val('');
247
        $('#form-section #title-section').val('');
258
        $('#form-section #text-section').val('');
248
        $('#form-section #text-section').val('');
259
        $('#form-section #type-section').val($('#form-section #type-section option:first').val());
249
        $('#form-section #type-section').val($('#form-section #type-section option:first').val());
260
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
250
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
261
        $('#modal-section').modal('show');
251
        $('#modal-section').modal('show');
262
    });
252
    });
263
    /**
253
    /**
264
     * Clicked edit section
254
     * Clicked edit section
265
     */
255
     */
266
 
-
 
267
   
-
 
268
 
-
 
269
   
-
 
270
 
-
 
271
 
-
 
272
    /**
256
    /**
273
     * Clicked save section
257
     * Clicked save section
274
     */
258
     */
275
    $('#btn-save-section').click(function(e) {
259
    $('#btn-save-section').click(function(e) {
276
        
-
 
277
        if($('#title-section').val()==''){
260
        if ($('#title-section').val() == '') {
278
 
-
 
279
            $.fn.showError('Ingrese un nombre');
261
            $.fn.showError('Ingrese un nombre');
280
            return;
262
            return;
281
 
-
 
282
        }else{
263
        } else {
283
            if($('#id_section').val()==""){
264
            if ($('#id-section').val() == "") {
284
                addSection(
265
                addSection(
285
                    $('#title-section').val(),
266
                    $('#title-section').val(),
286
                    $('#text-section').val(),
267
                    $('#text-section').val(),
287
                    $('#type-section').val(),
268
                    $('#type-section').val(),
288
                    ) 
269
                )
289
            }else{
270
            } else {
290
                editSection(
271
                editSection(
291
                    $('#id_section').val(),
272
                    $('#id-section').val(),
292
                    $('#title-section').val(),
273
                    $('#title-section').val(),
293
                    $('#text-section').val(),
274
                    $('#text-section').val(),
294
                    $('#type-section').val()
275
                    $('#type-section').val()
295
                ) 
276
                )
296
            }
277
            }
297
            $('#modal-section').modal('hide');
278
            $('#modal-section').modal('hide');
298
            return;
279
            return;
299
        
-
 
300
        }
280
        }
301
 
-
 
302
        
-
 
303
    });
281
    });
304
 
-
 
305
    /**
282
    /**
306
     * Clicked remove section
283
     * Clicked remove section
307
     */
284
     */
308
    $('body').on('click', 'button.btn-delete-section', function(e) {
285
    $('body').on('click', 'button.btn-delete-section', function(e) {
309
        e.preventDefault();
286
        e.preventDefault();
310
        var id = $(this).data('section');
287
        var id_section = $(this).data('section');
311
        bootbox.confirm({
288
        bootbox.confirm({
312
            title: "LABEL_DELETE LABEL_SECTION",
289
            title: "LABEL_DELETE LABEL_SECTION",
313
            message: "LABEL_SECTION_DELETE",
290
            message: "LABEL_SECTION_DELETE",
314
            buttons: {
291
            buttons: {
315
                cancel: {
292
                cancel: {
Línea 319... Línea 296...
319
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
296
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
320
                }
297
                }
321
            },
298
            },
322
            callback: function(result) {
299
            callback: function(result) {
323
                if (result) {
300
                if (result) {
324
              
-
 
-
 
301
                    removeSection(id_section);
325
                }
302
                }
326
            }
303
            }
327
        });
304
        });
328
    });
305
    });
329
 
-
 
330
    $('body').on('click', 'button.btn-edit-section', function(e) {
306
    $('body').on('click', 'button.btn-edit-section', function(e) {
331
        e.preventDefault();
307
        e.preventDefault();
-
 
308
        var id = $(this).data('section');
-
 
309
        sections.map((item) => {
-
 
310
            if (section.id == id) {
-
 
311
                $('#form-section #id-section').val(item.section_id);
-
 
312
                $('#form-section #title-section').val(item.title);
-
 
313
                $('#form-section #text-text').val(item.text);
-
 
314
                $('#form-section #type-section').val(item.section);
-
 
315
                $('#modal-section').modal('show');
-
 
316
                return;
-
 
317
            }
-
 
318
        });
-
 
319
    });
-
 
320
    /**
-
 
321
     * Clicked add new Option
-
 
322
     */
-
 
323
    $('body').on('click', 'button.btn-add-option', function(e) {
-
 
324
        e.preventDefault();
-
 
325
        var id = $(this).data('section');
-
 
326
        $('#section-option').val(id);
-
 
327
        $('#modal-option h4[class="modal-title"]').html('LABEL_EDIT LABEL_SECTION');
-
 
328
        $('#modal-option').modal('show');
-
 
329
        return;
-
 
330
    });
-
 
331
    /**
-
 
332
     * Clicked add new Option
-
 
333
     */
-
 
334
    $('body').on('click', 'button.btn-save-option', function(e) {
-
 
335
        e.preventDefault();
-
 
336
        var id = $(this).data('section');
-
 
337
        if ($('#id-option').val() == "") {
-
 
338
            addOption(
-
 
339
                $('#section-option').val(),
-
 
340
                $('#title-option').val(),
-
 
341
            )
-
 
342
        } else {
-
 
343
            editOption(
-
 
344
                $('#section-option').val(),
-
 
345
                $('#id-option').val(),
-
 
346
                $('#title-option').val(),
-
 
347
            )
-
 
348
        }
-
 
349
    });
-
 
350
    /**
-
 
351
     * Clicked edit Option
332
        
352
     */
-
 
353
    $('body').on('click', 'button.btn-edit-option', function(e) {
-
 
354
        e.preventDefault();
-
 
355
        var id_section = $(this).data('section');
-
 
356
        var id_option = $(this).data('option');
-
 
357
        sections.map((item) => {
-
 
358
            if (item.id_section == id_section) {
-
 
359
                item.options.map((opt) => {
-
 
360
                    if (opt.id_option == id_option) {
-
 
361
                        $('#id-option').val(opt.id_option);
-
 
362
                        $('#section-option').val(id_section);
-
 
363
                        $("#title-option").val(opt.title);
-
 
364
                        $('#modal-option h4[class="modal-title"]').html('LABEL_EDIT LABEL_SECTION');
-
 
365
                        $('#modal-option').modal('show');
-
 
366
                        return;
-
 
367
                    }
333
    console.log(1);
368
                });
-
 
369
            }
-
 
370
        });
334
});
371
    });
-
 
372
    /**
-
 
373
     * Clicked remove Option
335
 
374
     */
-
 
375
    $('body').on('click', 'button.btn-add-option', function(e) {
-
 
376
        e.preventDefault();
-
 
377
        var id_section = $(this).data('section');
-
 
378
        var id_option = $(this).data('option');
-
 
379
        bootbox.confirm({
-
 
380
            title: "LABEL_DELETE LABEL_OPTION",
-
 
381
            message: "LABEL_SECTION_DELETE",
-
 
382
            buttons: {
-
 
383
                cancel: {
-
 
384
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
-
 
385
                },
-
 
386
                confirm: {
-
 
387
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
-
 
388
                }
-
 
389
            },
-
 
390
            callback: function(result) {
-
 
391
                if (result) {
-
 
392
                    removeOption(id_section, id_option);
-
 
393
                }
-
 
394
            }
-
 
395
        });
336
    
396
    });
337
    /**
397
    /**
338
     * Clicked new Form
398
     * Clicked new Form
339
     */
399
     */
340
    $('button.btn-add-form').click(function(e) {
400
    $('button.btn-add-form').click(function(e) {
341
        $('#form-main').attr('action', '$routeAdd');
401
        $('#form-main').attr('action', '$routeAdd');
Línea 368... Línea 428...
368
    $('button.btn-form-save-close').click(function(e) {
428
    $('button.btn-form-save-close').click(function(e) {
369
        e.preventDefault();
429
        e.preventDefault();
370
        $('#form-main #form-continue').val('0')
430
        $('#form-main #form-continue').val('0')
371
        $('#form-main').submit();
431
        $('#form-main').submit();
372
    });
432
    });
373
 
-
 
374
 
-
 
375
    /**
433
    /**
376
     * Remove Html Tags
434
     * Remove Html Tags
377
     */
435
     */
378
    const removeTags = (str) => str.toString().replace( /(<([^>]+)>)/ig, '')
436
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
379
    /**
437
    /**
380
     * Render Sections data
438
     * Render Sections data
381
     */
439
     */
382
    const renderData= (data) => {
440
    const renderData = (data) => {
383
        console.log(data);
441
        console.log(data);
384
 
-
 
385
        $("#rows").html($("#sectionTemplate").render(data));
442
        $("#rows").html($("#sectionTemplate").render(data));
386
    }
443
    }
387
 
-
 
388
    /**
444
    /**
389
     * Add Section to array
445
     * Add Section to array
390
     */
446
     */
391
    const addSection = (title, text, type) => {
447
    const addSection = (title, text, type) => {
392
        sections.push({
448
        sections.push({
Línea 416... Línea 472...
416
     */
472
     */
417
    const removeSection = (id) => {
473
    const removeSection = (id) => {
418
        sections = sections.filter((item) => item.id_section != id);
474
        sections = sections.filter((item) => item.id_section != id);
419
        renderData(sections);
475
        renderData(sections);
420
    }
476
    }
421
 
-
 
422
     /**
477
    /**
423
     * Add Option to array
478
     * Add Option to array
424
     */
479
     */
425
    const addOption = (section, title) => {
480
    const addOption = (section, title) => {
426
        sections.map((item) => {
481
        sections.map((item) => {
427
            if (item.id_option == section) {
482
            if (item.id_option == section) {
Línea 432... Línea 487...
432
            }
487
            }
433
        });
488
        });
434
        renderData(sections);
489
        renderData(sections);
435
    }
490
    }
436
    /**
491
    /**
437
    * Edit item Option
492
     * Edit item Option
438
    */
493
     */
439
    const editOption = (section, id, tilte) => {
494
    const editOption = (section, id, tilte) => {
440
        sections.map((item) => {
495
        sections.map((item) => {
441
            if (item.id_section == section) {
496
            if (item.id_section == section) {
442
                item.options.map((opt)=>{
497
                item.options.map((opt) => {
443
                    if(opt.id_option == id){
498
                    if (opt.id_option == id) {
444
                        opt.title = title
499
                        opt.title = title
445
                    }
500
                    }
446
                });
501
                });
447
            }
502
            }
448
        });
503
        });
Línea 450... Línea 505...
450
    }
505
    }
451
    /**
506
    /**
452
     * Remove Option
507
     * Remove Option
453
     */
508
     */
454
    const removeOption = (section, id) => {
509
    const removeOption = (section, id) => {
455
 
-
 
456
        sections.map((item) => {
510
        sections.map((item) => {
457
            if (item.id_section == section) {
511
            if (item.id_section == section) {
458
                item.options = item.options.filter((opt) => opt.id_option != id) || []
512
                item.options = item.options.filter((opt) => opt.id_option != id) || []
459
            }
513
            }
460
        });
514
        });
461
 
-
 
462
        renderData(sections);
515
        renderData(sections);
463
    }
516
    }
464
    /**
517
    /**
465
     * Clicked refresh button
518
     * Clicked refresh button
466
     */
519
     */
467
    $('button.btn-refresh').click(function(e) {
520
    $('button.btn-refresh').click(function(e) {
468
        tableForm.fnDraw();
521
        tableForm.fnDraw();
469
    });
522
    });
470
     
-
 
471
});
523
});
472
JS;
524
JS;
473
$this->inlineScript()->captureEnd();
525
$this->inlineScript()->captureEnd();
474
?>
526
?>
475
 
-
 
476
<!-- Content Header (Page header) -->
527
<!-- Content Header (Page header) -->
477
<section class="content-header">
528
<section class="content-header">
478
    <div class="container-fluid">
529
   <div class="container-fluid">
479
        <div class="row mb-2">
530
      <div class="row mb-2">
480
            <div class="col-sm-12">
531
         <div class="col-sm-12">
481
                <h1>LABEL_PERFORMANCE_EVALUATION</h1>
532
            <h1>LABEL_PERFORMANCE_EVALUATION</h1>
482
            </div>
533
         </div>
483
        </div>
534
      </div>
484
    </div>
535
   </div>
485
    <!-- /.container-fluid -->
536
   <!-- /.container-fluid -->
486
</section>
537
</section>
487
<section class="content">
538
<section class="content">
488
    <div class="container-fluid" id="row-lists">
539
   <div class="container-fluid" id="row-lists">
489
        <div class="row">
540
      <div class="row">
490
            <div class="col-12">
541
         <div class="col-12">
491
                <div class="card">
542
            <div class="card">
492
                    <div class="card-body">
543
               <div class="card-body">
493
                        <table id="gridTable" class="table   table-hover">
544
                  <table id="gridTable" class="table   table-hover">
494
                            <thead>
545
                     <thead>
495
                                <tr>
546
                        <tr>
496
                                    <th>LABEL_NAME</th>
547
                           <th>LABEL_NAME</th>
497
                                    <th>LABEL_LANGUAGE</th>
548
                           <th>LABEL_LANGUAGE</th>
498
                                    <th>LABEL_ACTIVE</th>
549
                           <th>LABEL_ACTIVE</th>
499
                                    <th>LABEL_ACTIONS</th>
550
                           <th>LABEL_ACTIONS</th>
500
                                </tr>
551
                        </tr>
501
                            </thead>
552
                     </thead>
502
                            <tbody></tbody>
553
                     <tbody></tbody>
503
                        </table>
554
                  </table>
504
                    </div>
555
               </div>
505
                    <div class="card-footer clearfix">
556
               <div class="card-footer clearfix">
506
                        <div style="float:right;">
557
                  <div style="float:right;">
507
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
558
                     <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
508
                            <?php if ($allowAdd) : ?>
559
                     <?php if ($allowAdd) : ?>
509
                                <button type="button" class="btn btn-primary btn-add-form"><i class="fa fa-plus"></i> LABEL_ADD </button>
560
                     <button type="button" class="btn btn-primary btn-add-form"><i class="fa fa-plus"></i> LABEL_ADD </button>
510
                            <?php endif; ?>
561
                     <?php endif; ?>
511
                        </div>
-
 
512
                    </div>
562
                  </div>
513
                </div>
563
               </div>
514
            </div>
564
            </div>
515
        </div>
565
         </div>
516
    </div>
566
      </div>
517
 
567
   </div>
518
    <!-- Create/Edit Form -->
568
   <!-- Create/Edit Form -->
519
 
-
 
520
    <div class="row" id="row-form" style="display: none">
569
   <div class="row" id="row-form" style="display: none">
521
        <div class="col-xs-12 col-md-12">
570
      <div class="col-xs-12 col-md-12">
522
            <form action="#" name="form-main" id="form-main">
571
         <form action="#" name="form-main" id="form-main">
523
                <input type="hidden" name="form-id" id="form-id" value="0" />
572
            <input type="hidden" name="form-id" id="form-id" value="0" />
524
                <input type="hidden" name="form-continue" id="form-continue" value="0" />
573
            <input type="hidden" name="form-continue" id="form-continue" value="0" />
525
                <div class="form-group">
574
            <div class="form-group">
526
                    <label for="form-name">LABEL_FIRST_NAME</label>
575
               <label for="form-name">LABEL_FIRST_NAME</label>
527
                    <input type="text" name="form-name" id="form-name" class="form-control" maxlength="50" />
576
               <input type="text" name="form-name" id="form-name" class="form-control" maxlength="50" />
528
                </div>
-
 
529
                <div class="row">
-
 
530
                    <div class="col-xs-12 col-md-12 text-right">
-
 
531
                        <button type="button" class="btn btn-primary" id="btn-add-section" data-toggle="tooltip" title="LABEL_ADD LABEL_SECTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_SECTION</button>
-
 
532
                    </div>
-
 
533
                </div>
-
 
534
                <br />	
-
 
535
                <div class="row">
-
 
536
                    <div class="col-xs-12 col-md-12">
-
 
537
                        <div class="panel-group" id="rows"></div>
-
 
538
                    </div>
-
 
539
                </div>
-
 
540
                <div class="form-group">
-
 
541
                    <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
-
 
542
                    <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
-
 
543
                    <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
-
 
544
                </div>
-
 
545
            </form>
-
 
546
        </div>
-
 
547
    </div>
-
 
548
 
-
 
549
    <!-- Create/Edit Form-->
-
 
550
 
-
 
551
     <!-- section Modal -->
-
 
552
 
-
 
553
    <div  id="modal-section" class="modal" tabindex="-1" role="dialog">
-
 
554
        <div class="modal-dialog modal-lg" role="document">
-
 
555
            <form action="#" name="form-section" id="form-section">
-
 
556
                <input type="hidden" name="id_section" id="id_section" />
-
 
557
                <div class="modal-content">
-
 
558
                    <div class="modal-header">
-
 
559
                        <h4 class="modal-title">LABEL_ADD LABEL_SECTION</h4>
-
 
560
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
561
                            <span aria-hidden="true">&times;</span>
-
 
562
                        </button>
-
 
563
                    </div>
-
 
564
                    <div class="modal-body">
-
 
565
                    <div class="form-group">
-
 
566
                            <label for="title-section">LABEL_FIRST_NAME</label>
-
 
567
                            <input type="text" name="title-section" id="title-section" class="form-control" maxlength="50" value="" />
-
 
568
                        </div>
-
 
569
                        <div class="form-group">
-
 
570
                            <label for="text-section">LABEL_TEXT</label>
-
 
571
                            <textarea  name="text-section" id="text-section" rows="5" class="form-control"></textarea>
-
 
572
                        </div>
-
 
573
                        <div class="form-group">
-
 
574
                            <label for="type-section">LABEL_TYPE</label>
-
 
575
                            <select name="type-section" id="type-section" class="form-control">
-
 
576
                                <option value="simple">Simple</option>
-
 
577
                                <option value="multiple">Multiple</option>
-
 
578
                            </select>
-
 
579
                        </div>
-
 
580
                    </div>
-
 
581
                    <div class="modal-footer">
-
 
582
                        <button type="button" id="btn-save-section" class="btn btn-primary">LABEL_SAVE</button>
-
 
583
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
-
 
584
                    </div>
-
 
585
                </div>
-
 
586
            </form>
-
 
587
        </div>
-
 
588
    </div>
-
 
589
 
-
 
590
    <!-- End Modal section -->
-
 
591
 
-
 
592
    <!-- Modal Options -->
-
 
593
 
-
 
594
    <div  id="modal-option" class="modal" tabindex="-1" role="dialog">
-
 
595
        <div class="modal-dialog modal-lg" role="document">
-
 
596
            <form action="#" name="form-option" id="form-option">
-
 
597
                <input type="hidden" name="option-section" id="option-section" value="" />
-
 
598
                <input type="hidden" name="option-section" id="option-section" value="" />
-
 
599
                <input type="hidden" name="option-slug" id="option-slug" value="" />
-
 
600
                <div class="modal-content">
-
 
601
                    <div class="modal-header">
-
 
602
                        <h4 class="modal-title">LABEL_OPTION</h4>
-
 
603
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
604
                            <span aria-hidden="true">&times;</span>
-
 
605
                        </button>
-
 
606
                    </div>
-
 
607
                    <div class="modal-body">
-
 
608
                        <div class="form-group">
-
 
609
                            <label for="option-text">LABEL_TEXT</label>
-
 
610
                            <!--  ckeditor -->
-
 
611
                            <textarea  name="option-text" id="option-text" rows="5" class="ckeditor form-control"></textarea>
-
 
612
                        </div>
-
 
613
                    </div>
-
 
614
                    <div class="modal-footer">
-
 
615
                        <button type="button" class="btn btn-primary">LABEL_SAVE</button>
-
 
616
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
-
 
617
                    </div>
-
 
618
                </div>
-
 
619
            </form>
-
 
620
        </div>
-
 
621
    </div>
-
 
622
 
-
 
623
    <!-- End Modal Options -->
-
 
624
 
-
 
625
    <!---Template Sections --->
-
 
626
    <script id="sectionTemplate" type="text/x-jsrender">
-
 
627
 
-
 
628
    <div class="panel panel-default" id="panel-{{:id_section}}">
-
 
629
        <div class="panel-heading">
-
 
630
            <h4 class="panel-title">
-
 
631
                <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:id_section}}" href="#collapse-{{:id_section}}">
-
 
632
                    <span class="section-name{{:id_section}}">
-
 
633
                        {{:name}}
-
 
634
                    </span>
-
 
635
                </a>
-
 
636
            </h4>
-
 
637
        </div>
-
 
638
        <div id="collapse-{{:id_section}}" class="panel-collapse in collapse show">
-
 
639
            <div class="panel-body">
-
 
640
                <div class="table-responsive">
-
 
641
                    <table class="table table-bordered">
-
 
642
                        <thead>
-
 
643
                            <tr>
-
 
644
                                <th style="width: 10%;">LABEL_ELEMENT</th>
-
 
645
                                <th style="width: 40%;">LABEL_TEXT</th>
-
 
646
                                <th style="width: 10%;">LABEL_TYPE</th>
-
 
647
                                <th style="width: 30%;">LABEL_ACTIONS</th>
-
 
648
                            </tr>
-
 
649
                        </thead>
-
 
650
                        <tbody>
-
 
651
                            <tr class="tr-section">
-
 
652
                                <td class="text-left">LABEL_SECTION</td>
-
 
653
                                <td class="text-left">{{:title}}</td>
-
 
654
                                <td>
-
 
655
                                    
-
 
656
                                    {{if type == 'simple'}} Simple {{/if}}
-
 
657
                                    {{if type == 'multiple'}} Multiple {{/if}}
-
 
658
            
-
 
659
 
-
 
660
                                </td>
-
 
661
                                <td>
-
 
662
                                    <button  class="btn btn-default btn-edit-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_SECTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_SECTION </button>
-
 
663
 
-
 
664
                                    <button  class="btn btn-default btn-delete-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_SECTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_SECTION </button> 
-
 
665
 
-
 
666
                                     {{if type == 'multiple'}}
-
 
667
                                    <button type="button" class="btn btn-default btn-add-option" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_ADD  LABEL_OPTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD  LABEL_OPTION </button> 
-
 
668
                                    {{/if}}
-
 
669
                                </td>
-
 
670
                            </tr>
-
 
671
                            {{for options}}
-
 
672
                            <tr >
-
 
673
                                <td class="text-left">--LABEL_OPTION</td>
-
 
674
                                <td class="text-left">
-
 
675
                                    {{:title}}
-
 
676
                                </td>
-
 
677
                                <td></td>
-
 
678
                                <td></td>
-
 
679
                                <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> 
-
 
681
 
-
 
682
 
-
 
683
                                    <button type="button" class="btn btn-default btn-delete-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_OPTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_OPTION</button> 
-
 
684
                                
-
 
685
                                </td>
-
 
686
                            </tr>
-
 
687
                      
-
 
688
                            {{/for}}
-
 
689
                        </tbody>
-
 
690
                    </table>
-
 
691
                </div>
-
 
692
            </div>
577
            </div>
-
 
578
            <div class="row">
-
 
579
               <div class="col-xs-12 col-md-12 text-right">
-
 
580
                  <button type="button" class="btn btn-primary" id="btn-add-section" data-toggle="tooltip" title="LABEL_ADD LABEL_SECTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_SECTION</button>
-
 
581
               </div>
-
 
582
            </div>
-
 
583
            <br />	
-
 
584
            <div class="row">
-
 
585
               <div class="col-xs-12 col-md-12">
-
 
586
                  <div class="panel-group" id="rows"></div>
-
 
587
               </div>
-
 
588
            </div>
-
 
589
            <div class="form-group">
-
 
590
               <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
-
 
591
               <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
-
 
592
               <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
-
 
593
            </div>
-
 
594
         </form>
-
 
595
      </div>
-
 
596
   </div>
-
 
597
   <!-- Create/Edit Form-->
-
 
598
   <!-- section Modal -->
-
 
599
   <div  id="modal-section" class="modal" tabindex="-1" role="dialog">
-
 
600
      <div class="modal-dialog modal-lg" role="document">
-
 
601
         <form action="#" name="form-section" id="form-section">
-
 
602
            <input type="hidden" name="id-section" id="id-section" />
-
 
603
            <div class="modal-content">
-
 
604
               <div class="modal-header">
-
 
605
                  <h4 class="modal-title">LABEL_ADD LABEL_SECTION</h4>
-
 
606
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
607
                  <span aria-hidden="true">&times;</span>
-
 
608
                  </button>
-
 
609
               </div>
-
 
610
               <div class="modal-body">
-
 
611
                  <div class="form-group">
-
 
612
                     <label for="title-section">LABEL_FIRST_NAME</label>
-
 
613
                     <input type="text" name="title-section" id="title-section" class="form-control" maxlength="50" value="" />
-
 
614
                  </div>
-
 
615
                  <div class="form-group">
-
 
616
                     <label for="text-section">LABEL_TEXT</label>
-
 
617
                     <textarea  name="text-section" id="text-section" rows="5" class="form-control"></textarea>
-
 
618
                  </div>
-
 
619
                  <div class="form-group">
-
 
620
                     <label for="type-section">LABEL_TYPE</label>
-
 
621
                     <select name="type-section" id="type-section" class="form-control">
-
 
622
                        <option value="simple">Simple</option>
-
 
623
                        <option value="multiple">Multiple</option>
-
 
624
                     </select>
-
 
625
                  </div>
-
 
626
               </div>
-
 
627
               <div class="modal-footer">
-
 
628
                  <button type="button" id="btn-save-section" class="btn btn-primary">LABEL_SAVE</button>
-
 
629
                  <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
-
 
630
               </div>
-
 
631
            </div>
-
 
632
         </form>
-
 
633
      </div>
-
 
634
   </div>
-
 
635
   <!-- End Modal section -->
-
 
636
   <!-- Modal Options -->
-
 
637
   <div  id="modal-option" class="modal" tabindex="-1" role="dialog">
-
 
638
      <div class="modal-dialog modal-lg" role="document">
-
 
639
         <form action="#" name="form-option" id="form-option">
-
 
640
            <input type="hidden" name="section-option" id="section-option" value="" />
-
 
641
            <input type="hidden" name="id-option" id="id-option" value="" />
-
 
642
            <div class="modal-content">
-
 
643
               <div class="modal-header">
-
 
644
                  <h4 class="modal-title">LABEL_OPTION</h4>
-
 
645
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
646
                  <span aria-hidden="true">&times;</span>
-
 
647
                  </button>
-
 
648
               </div>
-
 
649
               <div class="modal-body">
-
 
650
                  <div class="form-group">
-
 
651
                     <label for="title-option">LABEL_TEXT</label>
-
 
652
                     <!--  ckeditor -->
-
 
653
                     <textarea  name="title-option" id="title-option" rows="5" class="ckeditor form-control"></textarea>
-
 
654
                  </div>
-
 
655
               </div>
-
 
656
               <div class="modal-footer">
-
 
657
                  <button type="button" class="btn btn-primary" id="btn-save-option">LABEL_SAVE</button>
-
 
658
                  <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
-
 
659
               </div>
-
 
660
            </div>
-
 
661
         </form>
693
        </div>
662
      </div>
694
    </div>
663
   </div>
-
 
664
   <!-- End Modal Options -->
-
 
665
   <!---Template Sections --->
-
 
666
   <script id="sectionTemplate" type="text/x-jsrender">
-
 
667
      <div class="panel panel-default" id="panel-{{:id_section}}">
-
 
668
          <div class="panel-heading">
-
 
669
              <h4 class="panel-title">
-
 
670
                  <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:id_section}}" href="#collapse-{{:id_section}}">
-
 
671
                      <span class="section-name{{:id_section}}">
-
 
672
                          {{:name}}
-
 
673
                      </span>
-
 
674
                  </a>
-
 
675
              </h4>
-
 
676
          </div>
-
 
677
          <div id="collapse-{{:id_section}}" class="panel-collapse in collapse show">
-
 
678
              <div class="panel-body">
-
 
679
                  <div class="table-responsive">
-
 
680
                      <table class="table table-bordered">
-
 
681
                          <thead>
-
 
682
                              <tr>
-
 
683
                                  <th style="width: 10%;">LABEL_ELEMENT</th>
-
 
684
                                  <th style="width: 40%;">LABEL_TEXT</th>
-
 
685
                                  <th style="width: 10%;">LABEL_TYPE</th>
-
 
686
                                  <th style="width: 30%;">LABEL_ACTIONS</th>
-
 
687
                              </tr>
-
 
688
                          </thead>
-
 
689
                          <tbody>
-
 
690
                              <tr class="tr-section">
-
 
691
                                  <td class="text-left">LABEL_SECTION</td>
-
 
692
                                  <td class="text-left">{{:title}}</td>
-
 
693
                                  <td>
-
 
694
                                      
-
 
695
                                      {{if type == 'simple'}} Simple {{/if}}
-
 
696
                                      {{if type == 'multiple'}} Multiple {{/if}}
-
 
697
              
-
 
698
      
-
 
699
                                  </td>
-
 
700
                                  <td>
-
 
701
                                      <button  class="btn btn-default btn-edit-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_SECTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_SECTION </button>
-
 
702
      
-
 
703
                                      <button  class="btn btn-default btn-delete-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_SECTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_SECTION </button> 
695
 
704
      
-
 
705
                                       {{if type == 'multiple'}}
-
 
706
                                      <button type="button" class="btn btn-default btn-add-option" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_ADD  LABEL_OPTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD  LABEL_OPTION </button> 
-
 
707
                                      {{/if}}
-
 
708
                                  </td>
-
 
709
                              </tr>
-
 
710
                              {{for options}}
-
 
711
                              <tr >
-
 
712
                                  <td class="text-left">--LABEL_OPTION</td>
-
 
713
                                  <td class="text-left">
-
 
714
                                      {{:title}}
-
 
715
                                  </td>
-
 
716
                                  <td></td>
-
 
717
                                  <td></td>
-
 
718
                                  <td>
696
    </script>
719
                                      <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> 
-
 
720
      
697
 
721
      
698
<!-- End Template Sections-->
722
                                      <button type="button" class="btn btn-default btn-delete-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_OPTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_OPTION</button> 
-
 
723
                                  
-
 
724
                                  </td>
-
 
725
                              </tr>
-
 
726
                        
-
 
727
                              {{/for}}
-
 
728
                          </tbody>
-
 
729
                      </table>
-
 
730
                  </div>
-
 
731
              </div>
-
 
732
          </div>
-
 
733
      </div>
699
 
734
      
-
 
735
   </script>
-
 
736
   <!-- End Template Sections-->
700
</section>
737
</section>
701
738