Proyectos de Subversion LeadersLinked - Backend

Rev

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

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