Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1022 | Rev 1024 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
977 geraldo 1
<?php
2
$acl = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
985 geraldo 7
$routeAdd = $this->url('performance-evaluation/forms/add');
8
$routeDatatable = $this->url('performance-evaluation/forms');
977 geraldo 9
$routeDashboard = $this->url('dashboard');
10
 
985 geraldo 11
$allowAdd = $acl->isAllowed($roleName, 'performance-evaluation/forms/add') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'performance-evaluation/forms/edit') ? 1 : 0;
13
$allowDelete = $acl->isAllowed($roleName, 'performance-evaluation/forms/delete') ? 1 : 0;
977 geraldo 14
 
15
 
16
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
17
 
18
 
19
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
20
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
21
 
22
 
23
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
24
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
25
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
26
 
27
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
28
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
29
 
30
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
33
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
34
 
35
 
36
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
37
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
38
 
39
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.full.min.js'));
40
 
41
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
42
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
43
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
44
 
45
 
46
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
47
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
48
 
49
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
50
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
51
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
52
 
53
// bootbox Alert //
54
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
55
 
56
// JsRender //
57
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
58
 
59
$this->inlineScript()->captureStart();
60
echo <<<JS
1006 geraldo 61
 
62
jQuery(document).ready(function($) {
977 geraldo 63
 
64
    var allowEdit = $allowEdit;
65
    var allowDelete = $allowDelete;
1007 geraldo 66
    var sections = [];
977 geraldo 67
    /**
68
     * Get rows and set data table
69
     */
70
    var tableForm = $('#gridTable').dataTable({
71
        'processing': true,
72
        'serverSide': true,
73
        'searching': true,
74
        'order': [
75
            [0, 'asc']
76
        ],
77
        'ordering': true,
78
        'ordenable': true,
79
        'responsive': true,
80
        'select': false,
81
        'paging': true,
82
        'pagingType': 'simple_numbers',
83
        'ajax': {
84
            'url': '$routeDatatable',
85
            'type': 'get',
86
            'beforeSend': function(request) {
87
                NProgress.start();
88
            },
89
            'dataFilter': function(response) {
90
                var response = jQuery.parseJSON(response);
91
                var json = {};
92
                json.recordsTotal = 0;
93
                json.recordsFiltered = 0;
94
                json.data = [];
95
                if (response.success) {
96
                    json.recordsTotal = response.data.total;
97
                    json.recordsFiltered = response.data.total;
98
                    json.data = response.data.items;
99
                } else {
100
                    $.fn.showError(response.data)
101
                }
102
                return JSON.stringify(json);
103
            }
104
        },
105
        'language': {
106
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
107
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
108
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
109
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
110
            'sInfo': 'LABEL_DATATABLE_SINFO',
111
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
112
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
113
            'sInfoPostFix': '',
114
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
115
            'sUrl': '',
116
            'sInfoThousands': ',',
117
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
118
            'oPaginate': {
119
                'sFirst': 'LABEL_DATATABLE_SFIRST',
120
                'sLast': 'LABEL_DATATABLE_SLAST',
121
                'sNext': 'LABEL_DATATABLE_SNEXT',
122
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
123
            },
124
            'oAria': {
125
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
126
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
127
            },
128
        },
129
        'drawCallback': function(settings) {
130
            NProgress.done();
131
            $('button.btn-delete').confirmation({
132
                rootSelector: 'button.btn-delete',
133
                title: 'LABEL_ARE_YOU_SURE',
134
                singleton: true,
135
                btnOkLabel: 'LABEL_YES',
136
                btnCancelLabel: 'LABEL_NO',
137
                onConfirm: function(value) {
138
                    action = $(this).data('href');
139
                    NProgress.start();
140
                    $.ajax({
141
                        'dataType': 'json',
142
                        'accept': 'application/json',
143
                        'method': 'post',
144
                        'url': action,
145
                    }).done(function(response) {
146
                        if (response['success']) {
147
                            $.fn.showSuccess(response['data']);
148
                            tableForm.fnDraw();
149
                        } else {
150
                            $.fn.showError(response['data']);
151
                        }
152
                    }).fail(function(jqXHR, textStatus, errorThrown) {
153
                        $.fn.showError(textStatus);
154
                    }).always(function() {
155
                        NProgress.done();
156
                    });
157
                },
158
            });
159
        },
160
        'aoColumns': [{
161
                'mDataProp': 'name'
162
            },
163
            {
164
                'mDataProp': 'language'
165
            },
166
            {
167
                'mDataProp': 'status'
168
            },
169
            {
170
                'mDataProp': 'actions'
171
            },
172
        ],
173
        'columnDefs': [{
174
                'targets': 0,
175
                'className': 'text-vertical-middle',
176
            },
177
            {
178
                'targets': 1,
179
                'className': 'text-vertical-middle',
180
            },
181
            {
182
                'targets': -2,
183
                'orderable': false,
184
                'className': 'text-center',
185
                'render': function(data, type, row) {
186
                    checked = data == 'a' ? ' checked="checked" ' : '';
187
                    return '<div class="checkbox checkbox-success">' +
188
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
189
                        '<label ></label></div>';
190
                }
191
            },
192
            {
193
                'targets': -1,
194
                'orderable': false,
195
                'render': function(data, type, row) {
196
                    s = '';
197
                    if (allowEdit) {
198
                        s = s + '<button class="btn btn-primary btn-edit-form" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
199
                    }
200
                    if (allowDelete) {
201
                        s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete'] + '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button>&nbsp;';
202
                    }
203
                    return s;
204
                }
205
            }
206
        ],
207
    });
208
    /**
209
     * Clicked on edit form
210
     */
211
    $('body').on('click', 'button.btn-edit-form', function(e) {
212
        e.preventDefault();
213
        form_id = $(this).data('id')
214
        var action = $(this).data('href');
215
        $.ajax({
216
            'dataType': 'json',
217
            'accept': 'application/json',
218
            'method': 'get',
219
            'url': action,
220
        }).done(function(response) {
221
            if (response['success']) {
1006 geraldo 222
 
977 geraldo 223
                $('#form-main').attr('action', action);
224
                $('#form-main #form-id').val(response['data']['id']),
225
                $('#form-main #form-continue').val('0');
226
                $('#form-main #form-name').val(response['data']['name']),
227
 
228
                /*----------Set Ckeditor ------------*/
229
                CKEDITOR.instances['form-description'].setData(response['data']['description']);
230
                CKEDITOR.instances['form-text'].setData(response['data']['text']);
231
 
232
                $('#form-main #form-language').val(response['data']['language']),
233
                $('#form-main #form-status').val(response['data']['status']);
234
 
235
                /*-------------Render Sections -------*/
236
 
1006 geraldo 237
                renderSectionData();
977 geraldo 238
 
1005 geraldo 239
                $('#row-lists').hide();
240
                $('#row-form').show();
977 geraldo 241
                $('#form-main #form-name').focus();
242
 
243
            } else {
244
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
245
            }
246
        }).fail(function(jqXHR, textStatus, errorThrown) {
247
            $.fn.showError(textStatus);
248
        });
249
    });
1006 geraldo 250
 
977 geraldo 251
 
252
    /**
997 geraldo 253
     * Clicked add new section
977 geraldo 254
     */
1004 geraldo 255
    $('#btn-add-section').click(function(e) {
1012 geraldo 256
        $('#form-section #id_section').val('');
1016 geraldo 257
        $('#form-section #title-section').val('');
1012 geraldo 258
        $('#form-section #text-section').val('');
259
        $('#form-section #type-section').val($('#form-section #type-section option:first').val());
1005 geraldo 260
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
993 geraldo 261
        $('#modal-section').modal('show');
977 geraldo 262
    });
263
    /**
997 geraldo 264
     * Clicked edit section
977 geraldo 265
     */
1021 geraldo 266
 
1022 geraldo 267
    $(".btn-edit-section").on('click', function(event){
268
    console.log(0)
269
});
1021 geraldo 270
 
1023 geraldo 271
$(".btn-edit-section").click(function(){
272
    console.log(1)
273
});
274
 
1022 geraldo 275
 
1009 geraldo 276
 
1016 geraldo 277
    /**
278
     * Clicked edit section
279
     */
1019 geraldo 280
    $('button.btn-delete-section').click(function(e) {
1017 geraldo 281
        var id = $(this).data('section');
282
        bootbox.confirm({
283
            title: "LABEL_DELETE LABEL_CONDUCT",
284
            message: "LABEL_QUESTION_DELETE",
285
            buttons: {
286
                cancel: {
287
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
288
                },
289
                confirm: {
290
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
291
                }
292
            },
293
            callback: function(result) {
294
                if (result) {
295
                    removeSection(id);
296
                }
297
            }
298
        });
1016 geraldo 299
    });
1009 geraldo 300
 
1016 geraldo 301
 
977 geraldo 302
    /**
1009 geraldo 303
     * Clicked save section
304
     */
305
    $('#btn-save-section').click(function(e) {
306
 
1016 geraldo 307
        if($('#title-section').val()==''){
1009 geraldo 308
 
1010 geraldo 309
            $.fn.showError('Ingrese un nombre');
1009 geraldo 310
            return;
311
 
312
        }else{
1012 geraldo 313
            if($('#id_section').val()==""){
1009 geraldo 314
                addSection(
1016 geraldo 315
                    $('#title-section').val(),
1012 geraldo 316
                    $('#text-section').val(),
317
                    $('#type-section').val(),
1009 geraldo 318
                    )
319
            }else{
320
                editSection(
1012 geraldo 321
                    $('#id_section').val(),
1016 geraldo 322
                    $('#title-section').val(),
1012 geraldo 323
                    $('#text-section').val(),
324
                    $('#type-section').val()
1009 geraldo 325
                )
326
            }
1011 geraldo 327
            $('#modal-section').modal('hide');
1010 geraldo 328
            return;
1009 geraldo 329
 
330
        }
1011 geraldo 331
 
332
 
1009 geraldo 333
    });
334
 
335
    /**
997 geraldo 336
     * Clicked remove section
977 geraldo 337
     */
1005 geraldo 338
    $('#btn-delete-section').click(function(e) {
339
        var id = $(this).data('section');
977 geraldo 340
        bootbox.confirm({
993 geraldo 341
            title: "LABEL_DELETE LABEL_SECTION",
342
            message: "LABEL_SECTION_DELETE",
977 geraldo 343
            buttons: {
344
                cancel: {
345
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
346
                },
347
                confirm: {
348
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
349
                }
350
            },
351
            callback: function(result) {
352
                if (result) {
1007 geraldo 353
 
977 geraldo 354
                }
355
            }
356
        });
357
    });
1006 geraldo 358
 
977 geraldo 359
    /**
360
     * Clicked new Form
361
     */
362
    $('button.btn-add-form').click(function(e) {
363
        $('#form-main').attr('action', '$routeAdd');
364
        $('#form-main #form-id').val('0');
365
        $('#form-main #form-continue').val('0');
366
        $('#form-main #form-name').val('');
1005 geraldo 367
        $('#row-lists').hide();
368
        $('#row-form').show();
977 geraldo 369
        $('#form-main #form-name').focus();
370
    });
371
    /**
372
     * Clicked cancel new/edit Form
373
     */
374
    $('button.btn-edit-cancel').click(function(e) {
375
        e.preventDefault();
1005 geraldo 376
        $('#row-form').hide();
377
        $('#row-lists').show();
977 geraldo 378
    });
379
    /**
380
     * Clicked save and continue new Form
381
     */
382
    $('button.btn-form-save-continue').click(function(e) {
383
        e.preventDefault();
384
        $('#form-main #form-continue').val('1')
385
        $('#form-main').submit();
386
    });
387
    /**
388
     * Clicked save and close new/edit Form
389
     */
390
    $('button.btn-form-save-close').click(function(e) {
391
        e.preventDefault();
392
        $('#form-main #form-continue').val('0')
393
        $('#form-main').submit();
394
    });
1007 geraldo 395
 
396
 
977 geraldo 397
    /**
1007 geraldo 398
     * Clicked save and close new/edit Form
399
     */
400
    $('#btn-save-section').click(function(e) {
401
 
402
    });
403
 
404
 
405
 
406
    /**
977 geraldo 407
     * Remove Html Tags
408
     */
409
    const removeTags = (str) => str.toString().replace( /(<([^>]+)>)/ig, '')
410
    /**
411
     * Render Sections data
412
     */
1011 geraldo 413
    const renderData= (data) => {
414
        console.log(data);
1013 geraldo 415
 
416
        $("#rows").html($("#sectionTemplate").render(data));
1011 geraldo 417
    }
977 geraldo 418
 
419
    /**
1007 geraldo 420
     * Add Section to array
977 geraldo 421
     */
1014 geraldo 422
    const addSection = (title, text, type) => {
1007 geraldo 423
        sections.push({
1012 geraldo 424
            'id_section': new Date().getTime(),
1007 geraldo 425
            'title': title,
426
            'type': type,
1009 geraldo 427
            'text': text,
1007 geraldo 428
            'options': []
429
        });
430
        renderData(sections);
431
    }
977 geraldo 432
    /**
1007 geraldo 433
     * Edit item behavior
434
     */
1009 geraldo 435
    const editSection = (id, title, type, text) => {
1007 geraldo 436
        sections.map((item) => {
1012 geraldo 437
            if (item.id_section == id) {
1009 geraldo 438
                item.title = title;
439
                item.type = type;
440
                item.text = text;
1007 geraldo 441
            }
442
        });
443
        renderData(sections);
444
    }
445
    /**
446
     * Remove behavior
447
     */
448
    const removeSection = (id) => {
1012 geraldo 449
        sections = sections.filter((item) => item.id_section != id);
1007 geraldo 450
        renderData(sections);
451
    }
452
 
1012 geraldo 453
     /**
454
     * Add Option to array
455
     */
456
    const addOption = (section, title) => {
457
        sections.map((item) => {
458
            if (item.id_option == section) {
459
                item.options.push({
460
                    'id_option': new Date().getTime(),
461
                    'title': title,
462
                });
463
            }
464
        });
465
        renderData(sections);
466
    }
467
    /**
468
    * Edit item Option
469
    */
470
    const editOption = (section, id, tilte) => {
471
        sections.map((item) => {
472
            if (item.id_section == section) {
473
                item.options.map((opt)=>{
474
                    if(opt.id_option == id){
475
                        opt.title = title
476
                    }
477
                });
478
            }
479
        });
480
        renderData(sections);
481
    }
482
    /**
483
     * Remove Option
484
     */
485
    const removeOption = (section, id) => {
1007 geraldo 486
 
1012 geraldo 487
        sections.map((item) => {
488
            if (item.id_section == section) {
489
                item.options = item.options.filter((opt) => opt.id_option != id) || []
490
            }
491
        });
1011 geraldo 492
 
1012 geraldo 493
        renderData(sections);
494
    }
1007 geraldo 495
    /**
977 geraldo 496
     * Clicked refresh button
497
     */
498
    $('button.btn-refresh').click(function(e) {
499
        tableForm.fnDraw();
500
    });
501
 
502
});
503
JS;
504
$this->inlineScript()->captureEnd();
505
?>
506
 
507
<!-- Content Header (Page header) -->
508
<section class="content-header">
509
    <div class="container-fluid">
510
        <div class="row mb-2">
511
            <div class="col-sm-12">
984 geraldo 512
                <h1>LABEL_PERFORMANCE_EVALUATION</h1>
977 geraldo 513
            </div>
514
        </div>
515
    </div>
516
    <!-- /.container-fluid -->
517
</section>
518
<section class="content">
1005 geraldo 519
    <div class="container-fluid" id="row-lists">
977 geraldo 520
        <div class="row">
521
            <div class="col-12">
522
                <div class="card">
523
                    <div class="card-body">
524
                        <table id="gridTable" class="table   table-hover">
525
                            <thead>
526
                                <tr>
990 geraldo 527
                                    <th>LABEL_NAME</th>
528
                                    <th>LABEL_LANGUAGE</th>
529
                                    <th>LABEL_ACTIVE</th>
977 geraldo 530
                                    <th>LABEL_ACTIONS</th>
531
                                </tr>
532
                            </thead>
533
                            <tbody></tbody>
534
                        </table>
535
                    </div>
536
                    <div class="card-footer clearfix">
537
                        <div style="float:right;">
538
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
539
                            <?php if ($allowAdd) : ?>
540
                                <button type="button" class="btn btn-primary btn-add-form"><i class="fa fa-plus"></i> LABEL_ADD </button>
541
                            <?php endif; ?>
542
                        </div>
543
                    </div>
544
                </div>
545
            </div>
546
        </div>
547
    </div>
548
 
549
    <!-- Create/Edit Form -->
550
 
1005 geraldo 551
    <div class="row" id="row-form" style="display: none">
977 geraldo 552
        <div class="col-xs-12 col-md-12">
553
            <form action="#" name="form-main" id="form-main">
554
                <input type="hidden" name="form-id" id="form-id" value="0" />
555
                <input type="hidden" name="form-continue" id="form-continue" value="0" />
990 geraldo 556
                <div class="form-group">
557
                    <label for="form-name">LABEL_FIRST_NAME</label>
558
                    <input type="text" name="form-name" id="form-name" class="form-control" maxlength="50" />
559
                </div>
977 geraldo 560
                <div class="row">
561
                    <div class="col-xs-12 col-md-12 text-right">
994 geraldo 562
                        <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>
977 geraldo 563
                    </div>
564
                </div>
565
                <br />
566
                <div class="row">
567
                    <div class="col-xs-12 col-md-12">
568
                        <div class="panel-group" id="rows"></div>
569
                    </div>
570
                </div>
571
                <div class="form-group">
572
                    <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
573
                    <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
574
                    <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
575
                </div>
576
            </form>
577
        </div>
578
    </div>
579
 
580
    <!-- Create/Edit Form-->
581
 
1005 geraldo 582
     <!-- section Modal -->
977 geraldo 583
 
993 geraldo 584
    <div  id="modal-section" class="modal" tabindex="-1" role="dialog">
977 geraldo 585
        <div class="modal-dialog modal-lg" role="document">
1005 geraldo 586
            <form action="#" name="form-section" id="form-section">
1012 geraldo 587
                <input type="hidden" name="id_section" id="id_section" />
1005 geraldo 588
                <div class="modal-content">
589
                    <div class="modal-header">
590
                        <h4 class="modal-title">LABEL_ADD LABEL_SECTION</h4>
591
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
592
                            <span aria-hidden="true">&times;</span>
593
                        </button>
594
                    </div>
595
                    <div class="modal-body">
1009 geraldo 596
                    <div class="form-group">
1016 geraldo 597
                            <label for="title-section">LABEL_FIRST_NAME</label>
598
                            <input type="text" name="title-section" id="title-section" class="form-control" maxlength="50" value="" />
1009 geraldo 599
                        </div>
1005 geraldo 600
                        <div class="form-group">
1012 geraldo 601
                            <label for="text-section">LABEL_TEXT</label>
602
                            <textarea  name="text-section" id="text-section" rows="5" class="form-control"></textarea>
1005 geraldo 603
                        </div>
604
                        <div class="form-group">
1012 geraldo 605
                            <label for="type-section">LABEL_TYPE</label>
606
                            <select name="type-section" id="type-section" class="form-control">
1005 geraldo 607
                                <option value="simple">Simple</option>
608
                                <option value="multiple">Multiple</option>
609
                            </select>
610
                        </div>
611
                    </div>
612
                    <div class="modal-footer">
1007 geraldo 613
                        <button type="button" id="btn-save-section" class="btn btn-primary">LABEL_SAVE</button>
1005 geraldo 614
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
615
                    </div>
616
                </div>
617
            </form>
977 geraldo 618
        </div>
619
    </div>
620
 
1005 geraldo 621
    <!-- End Modal section -->
622
 
623
    <!-- Modal Options -->
624
 
625
    <div  id="modal-option" class="modal" tabindex="-1" role="dialog">
626
        <div class="modal-dialog modal-lg" role="document">
627
            <form action="#" name="form-option" id="form-option">
628
                <input type="hidden" name="option-section" id="option-section" value="" />
629
                <input type="hidden" name="option-section" id="option-section" value="" />
630
                <input type="hidden" name="option-slug" id="option-slug" value="" />
631
                <div class="modal-content">
632
                    <div class="modal-header">
633
                        <h4 class="modal-title">LABEL_OPTION</h4>
634
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
635
                            <span aria-hidden="true">&times;</span>
636
                        </button>
637
                    </div>
638
                    <div class="modal-body">
639
                        <div class="form-group">
640
                            <label for="option-text">LABEL_TEXT</label>
641
                            <!--  ckeditor -->
642
                            <textarea  name="option-text" id="option-text" rows="5" class="ckeditor form-control"></textarea>
643
                        </div>
644
                    </div>
645
                    <div class="modal-footer">
1007 geraldo 646
                        <button type="button" class="btn btn-primary">LABEL_SAVE</button>
1005 geraldo 647
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
648
                    </div>
649
                </div>
650
            </form>
651
        </div>
652
    </div>
653
 
654
    <!-- End Modal Options -->
655
 
1012 geraldo 656
    <!---Template Sections --->
657
    <script id="sectionTemplate" type="text/x-jsrender">
977 geraldo 658
 
1012 geraldo 659
    <div class="panel panel-default" id="panel-{{:id_section}}">
660
        <div class="panel-heading">
661
            <h4 class="panel-title">
662
                <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:id_section}}" href="#collapse-{{:id_section}}">
663
                    <span class="section-name{{:id_section}}">
664
                        {{:name}}
665
                    </span>
666
                </a>
667
            </h4>
668
        </div>
669
        <div id="collapse-{{:id_section}}" class="panel-collapse in collapse show">
670
            <div class="panel-body">
671
                <div class="table-responsive">
672
                    <table class="table table-bordered">
673
                        <thead>
674
                            <tr>
675
                                <th style="width: 10%;">LABEL_ELEMENT</th>
1022 geraldo 676
                                <th style="width: 40%;">LABEL_TEXT</th>
1012 geraldo 677
                                <th style="width: 10%;">LABEL_TYPE</th>
1022 geraldo 678
                                <th style="width: 30%;">LABEL_ACTIONS</th>
1012 geraldo 679
                            </tr>
680
                        </thead>
681
                        <tbody>
682
                            <tr class="tr-section">
683
                                <td class="text-left">LABEL_SECTION</td>
684
                                <td class="text-left">{{:title}}</td>
685
                                <td>
686
 
687
                                    {{if type == 'simple'}} Simple {{/if}}
688
                                    {{if type == 'multiple'}} Multiple {{/if}}
689
 
690
 
691
                                </td>
692
                                <td>
1022 geraldo 693
                                    <button type="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>
1012 geraldo 694
 
1022 geraldo 695
                                    <button  type="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>
1012 geraldo 696
 
697
                                     {{if type == 'multiple'}}
1022 geraldo 698
                                    <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>
1012 geraldo 699
                                    {{/if}}
700
                                </td>
701
                            </tr>
702
                            {{for options}}
703
                            <tr >
704
                                <td class="text-left">--LABEL_OPTION</td>
705
                                <td class="text-left">
1016 geraldo 706
                                    {{:title}}
1012 geraldo 707
                                </td>
708
                                <td></td>
709
                                <td></td>
710
                                <td>
711
                                    <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>
712
 
713
 
714
                                    <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>
715
 
716
                                </td>
717
                            </tr>
718
 
719
                            {{/for}}
720
                        </tbody>
721
                    </table>
722
                </div>
723
            </div>
724
        </div>
725
    </div>
726
 
727
    </script>
728
 
729
<!-- End Template Sections-->
730
 
977 geraldo 731
</section>