Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 480 | Rev 482 | 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
 
262 geraldo 7
$routeDatatable = $this->url('self-evaluation/reviews');
251 geraldo 8
$routeDashboard = $this->url('dashboard');
9
 
469 geraldo 10
$allowEdit = $acl->isAllowed($roleName, 'self-evaluation/reviews/edit') ? 1 : 0;
11
$allowReport = $acl->isAllowed($roleName, 'self-evaluation/reviews/report') ? 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
339 geraldo 67
const classFormGenerator = function() {
251 geraldo 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
        };
352 geraldo 149
    /**
150
     * Add element to question array
151
     */
439 geraldo 152
    this.editQuestion = function(slug_section, slug_question, comment, question_value, status) {
352 geraldo 153
        var renderTable = false;
154
        for (i = 0; i < this.sections.length; i++) {
155
            if (slug_section == this.sections[i].slug_section) {
156
                for (j = 0; j < this.sections[i].questions.length; j++) {
157
                    if (slug_question == this.sections[i].questions[j].slug_question) {
158
                        this.sections[i].questions[j].status = status;
417 geraldo 159
                        this.sections[i].questions[j].comment = comment;
432 geraldo 160
                        this.sections[i].questions[j].question_value = question_value;
395 geraldo 161
                        this.renderSection(slug_section);
394 geraldo 162
                        return true;
345 geraldo 163
                    }
164
                }
165
            }
352 geraldo 166
        }
167
    };
339 geraldo 168
}
251 geraldo 169
jQuery(document).ready(function($) {
170
    var objFormGenerator = new classFormGenerator();
171
    objFormGenerator.render();
172
    var allowEdit = $allowEdit;
469 geraldo 173
    var allowReport = $allowReport;
251 geraldo 174
    /**
175
     * Get rows and set data table
176
     */
177
    var tableForm = $('#gridTable').dataTable({
178
        'processing': true,
179
        'serverSide': true,
180
        'searching': true,
181
        'order': [
182
            [0, 'asc']
183
        ],
184
        'ordering': true,
185
        'ordenable': true,
186
        'responsive': true,
187
        'select': false,
188
        'paging': true,
189
        'pagingType': 'simple_numbers',
190
        'ajax': {
191
            'url': '$routeDatatable',
192
            'type': 'get',
193
            'beforeSend': function(request) {
194
                NProgress.start();
195
            },
196
            'dataFilter': function(response) {
197
                var response = jQuery.parseJSON(response);
198
                var json = {};
199
                json.recordsTotal = 0;
200
                json.recordsFiltered = 0;
201
                json.data = [];
202
                if (response.success) {
481 geraldo 203
 
204
                    if( $('#only_pending').is(':checked') ) {
205
 
206
                        let items = response.data.items.filter((item)=> item.status=='Pendiente');
207
 
208
                        json.recordsTotal = items.length;
209
                    json.recordsFiltered = items.length;
210
                    json.data = items;
211
 
212
}else{
251 geraldo 213
                    json.recordsTotal = response.data.total;
214
                    json.recordsFiltered = response.data.total;
215
                    json.data = response.data.items;
481 geraldo 216
}
251 geraldo 217
                } else {
218
                    $.fn.showError(response.data)
219
                }
220
                return JSON.stringify(json);
221
            }
222
        },
223
        'language': {
224
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
225
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
226
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
227
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
228
            'sInfo': 'LABEL_DATATABLE_SINFO',
229
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
230
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
231
            'sInfoPostFix': '',
232
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
233
            'sUrl': '',
234
            'sInfoThousands': ',',
235
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
236
            'oPaginate': {
237
                'sFirst': 'LABEL_DATATABLE_SFIRST',
238
                'sLast': 'LABEL_DATATABLE_SLAST',
239
                'sNext': 'LABEL_DATATABLE_SNEXT',
240
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
241
            },
242
            'oAria': {
243
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
244
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
245
            },
246
        },
247
        'drawCallback': function(settings) {
248
            NProgress.done();
249
            $('button.btn-delete').confirmation({
250
                rootSelector: 'button.btn-delete',
251
                title: 'LABEL_ARE_YOU_SURE',
252
                singleton: true,
253
                btnOkLabel: 'LABEL_YES',
254
                btnCancelLabel: 'LABEL_NO',
255
                onConfirm: function(value) {
256
                    action = $(this).data('href');
257
                    NProgress.start();
258
                    $.ajax({
259
                        'dataType': 'json',
260
                        'accept': 'application/json',
261
                        'method': 'post',
262
                        'url': action,
263
                    }).done(function(response) {
264
                        if (response['success']) {
265
                            $.fn.showSuccess(response['data']);
266
                            tableForm.fnDraw();
267
                        } else {
268
                            $.fn.showError(response['data']);
269
                        }
270
                    }).fail(function(jqXHR, textStatus, errorThrown) {
271
                        $.fn.showError(textStatus);
272
                    }).always(function() {
273
                        NProgress.done();
274
                    });
275
                },
276
            });
277
        },
339 geraldo 278
        'aoColumns': [{
294 geraldo 279
                'mDataProp': 'user'
339 geraldo 280
            }, {
251 geraldo 281
                'mDataProp': 'name'
282
            },
283
            {
284
                'mDataProp': 'language'
285
            },
286
            {
287
                'mDataProp': 'status'
288
            },
289
            {
447 geraldo 290
                'mDataProp': 'added_on'
291
            },
292
            {
471 geraldo 293
                'mDataProp': 'actions'
251 geraldo 294
            },
295
        ],
339 geraldo 296
        'columnDefs': [{
251 geraldo 297
                'targets': 0,
298
                'className': 'text-vertical-middle',
339 geraldo 299
            }, {
294 geraldo 300
                'targets': 1,
301
                'className': 'text-vertical-middle',
251 geraldo 302
            },
303
            {
294 geraldo 304
                'targets': -1,
251 geraldo 305
                'className': 'text-vertical-middle',
306
            },
307
            {
447 geraldo 308
                'targets': -1,
292 geraldo 309
                'className': 'text-center',
293 geraldo 310
                'className': 'text-vertical-middle',
251 geraldo 311
            },
312
            {
313
                'targets': -1,
447 geraldo 314
                'className': 'text-vertical-middle',
315
            },
316
            {
317
                'targets': -1,
251 geraldo 318
                'orderable': false,
319
                'render': function(data, type, row) {
320
                    s = '';
469 geraldo 321
                    if (allowEdit && data['link_edit']) {
322
                        s = s + '<button class="btn btn-primary btn-edit-form" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT">LABEL_EDIT</button>&nbsp;';
251 geraldo 323
                    }
469 geraldo 324
                    if (allowReport && data['link_report']) {
472 geraldo 325
                        s = s + '<button class="btn btn-primary btn-edit-form" data-href="' + data['link_report'] + '" data-toggle="tooltip" title="LABEL_VIEW_REPORT">LABEL_VIEW_REPORT</button>&nbsp;';
469 geraldo 326
                    }
251 geraldo 327
                    return s;
328
                }
329
            }
330
        ],
331
    });
332
    /**
391 geraldo 333
     * Clicked edit question
334
     */
412 geraldo 335
    $('body').on('click', 'button.btn-add-review', function(e) {
391 geraldo 336
        e.preventDefault();
439 geraldo 337
        if ($('#question-value').val() == '') {
432 geraldo 338
            $.fn.showError('ERROR_ENTER_VALUE');
339
            return false;
439 geraldo 340
        } else {
341
            objFormGenerator.editQuestion(
342
                $('#section').val(),
343
                $('#question').val(),
344
                $('#question-comment').val(),
345
                $('#question-value').val(),
346
                $('#question-status').val() == '1' ? true : false
347
            );
348
            renderSectionData(objFormGenerator.sections);
349
            $('#form-review')[0].reset();
350
            $('#modal-review').modal('hide');
351
        }
391 geraldo 352
    });
353
    /**
354
     * Clicked edit question
355
     */
411 geraldo 356
    $('body').on('click', 'button.btn-edit-review', function(e) {
391 geraldo 357
        e.preventDefault();
411 geraldo 358
        e.preventDefault();
359
        var slug_section = $(this).data('section');
412 geraldo 360
        var slug_question = $(this).data('question');
411 geraldo 361
        var showForm = false;
362
        for (i = 0; i < objFormGenerator.sections.length; i++) {
363
            if (slug_section == objFormGenerator.sections[i].slug_section) {
364
                for (j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
412 geraldo 365
                    if (slug_question == objFormGenerator.sections[i].questions[j].slug_question) {
366
                        $('#form-review #section').val(objFormGenerator.sections[i].slug_section);
367
                        $('#form-review #question').val(objFormGenerator.sections[i].questions[j].slug_question);
429 geraldo 368
                        if (objFormGenerator.sections[i].questions[j].status) {
411 geraldo 369
                            $('#form-review #question-status').val('1');
370
                        } else {
371
                            $('#form-review #question-status').val('0');
372
                        }
429 geraldo 373
                        if (objFormGenerator.sections[i].questions[j].comment) {
419 geraldo 374
                            $('#form-review #question-comment').val(objFormGenerator.sections[i].questions[j].comment);
429 geraldo 375
                        } else {
376
                            $('#form-review #question-comment').val('');
411 geraldo 377
                        }
432 geraldo 378
                        if (objFormGenerator.sections[i].questions[j].question_value) {
379
                            $('#form-review #question-value').val(objFormGenerator.sections[i].questions[j].question_value);
380
                        } else {
435 geraldo 381
                            $('#form-review #question-value').val(0);
432 geraldo 382
                        }
412 geraldo 383
                        $('#modal-review').modal('show');
384
                        return true;
411 geraldo 385
                    }
386
                }
387
            }
388
        }
391 geraldo 389
    });
390
    /**
251 geraldo 391
     * Clicked on edit form
392
     */
393
    $('body').on('click', 'button.btn-edit-form', function(e) {
394
        e.preventDefault();
395
        form_id = $(this).data('id')
396
        var action = $(this).data('href');
397
        $.ajax({
398
            'dataType': 'json',
399
            'accept': 'application/json',
400
            'method': 'get',
401
            'url': action,
402
        }).done(function(response) {
403
            if (response['success']) {
404
                $('#form-main').attr('action', action);
405
                $('#form-main #form-id').val(response['data']['id']),
387 geraldo 406
                    $('#name').html(response['data']['name']);
366 geraldo 407
                $('#form-status').val(response['data']['status']);
316 geraldo 408
                $('#text').html(response['data']['text']);
409
                $('#user').html(response['data']['user']);
251 geraldo 410
                /*-------------Render Sections -------*/
411
                objFormGenerator.clear();
412
                objFormGenerator.sections = response['data']['content'] || [];
413
                objFormGenerator.render();
414
                renderSectionData(objFormGenerator.sections);
254 geraldo 415
                $('#row-forms').hide();
251 geraldo 416
                $('#row-edit').show();
417
            } else {
418
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
419
            }
420
        }).fail(function(jqXHR, textStatus, errorThrown) {
421
            $.fn.showError(textStatus);
422
        });
423
    });
351 geraldo 424
    $('button.btn-form-save-close').click(function(e) {
444 geraldo 425
        var formContinue = parseFloat($('#form-main #form-continue').val());
352 geraldo 426
        var data = {
427
            'status': $('#form-main #form-status').val(),
428
            'content': JSON.stringify(objFormGenerator.sections)
429
        }
430
        $.ajax({
431
            'dataType': 'json',
432
            'method': 'post',
433
            'url': $('#form-main').attr('action'),
434
            'data': data,
435
        }).done(function(response) {
436
            if (response['success']) {
437
                $.fn.showSuccess(response['data']);
438
                $('#row-edit').hide();
439
                $('#row-forms').show();
440
                /*---------- Reset Form -------- */
441
                $('#form-main')[0].reset();
442
                /*--------Reset Sections ----------*/
443
                clearSectionData();
444
                /* ------- Refresh Table -----------*/
445
                tableForm.fnDraw();
446
            } else {
447
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
448
            }
449
        }).fail(function(jqXHR, textStatus, errorThrown) {
450
            $.fn.showError(textStatus);
451
        });
452
        return false;
351 geraldo 453
    });
251 geraldo 454
    /**
455
     * Clicked cancel new/edit Form
456
     */
457
    $('button.btn-edit-cancel').click(function(e) {
458
        e.preventDefault();
459
        $('#row-edit').hide();
254 geraldo 460
        $('#row-forms').show();
251 geraldo 461
    });
462
    /**
339 geraldo 463
     * Get Answers
464
     */
465
    const getAnswer = (type, options, answer) => {
466
        if (type == 'open' || type == 'rating-range') {
328 geraldo 467
            return answer;
251 geraldo 468
        }
339 geraldo 469
        if (type == 'multiple') {
352 geraldo 470
            let opt = '';
339 geraldo 471
            opt += removeTags(options.filter((opt) => answer.includes(opt.slug_option))[0].text) + ' ';
332 geraldo 472
            return opt;
330 geraldo 473
        }
338 geraldo 474
        return removeTags(options.filter((opt) => opt.slug_option == answer)[0].text);
251 geraldo 475
    }
476
    /**
341 geraldo 477
     * Get Status
478
     */
400 geraldo 479
    const getStatus = (options, answer, type) => {
407 geraldo 480
        let status;
409 geraldo 481
        status = type == 'multiple' ?
482
            options.filter((opt) => answer.includes(opt.slug_option) && opt.correct == '1') :
410 geraldo 483
            options.filter((opt) => opt.slug_option == answer && opt.correct == '1');
409 geraldo 484
        return status.length != 0 ? '<font color="green">LABEL_CORRECT</font>' : '<font color="red">LABEL_FAIL</red>';
400 geraldo 485
    }
441 geraldo 486
    const getPtos = (options, answer, type, value, question_value) => {
429 geraldo 487
        let ptos = 0;
488
        if (type == "open" || type == "rating-open" || type == "rating-range") {
441 geraldo 489
            ptos = question_value ? question_value : 0;
429 geraldo 490
        } else {
491
            if (type == 'multiple') {
492
                options.map((opt) => {
493
                    if (answer.includes(opt.slug_option)) {
444 geraldo 494
                        ptos += parseFloat(opt.value);
429 geraldo 495
                    }
496
                })
497
            } else {
498
                options.map((opt) => {
499
                    if (opt.slug_option == answer) {
444 geraldo 500
                        ptos = parseFloat(opt.value);
429 geraldo 501
                    }
502
                });
503
            }
504
        }
445 geraldo 505
        return  parseFloat(ptos).toFixed(2) + '/' + parseFloat(value).toFixed(2);
429 geraldo 506
    }
341 geraldo 507
    /**
251 geraldo 508
     * Remove Html Tags
509
     */
339 geraldo 510
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
251 geraldo 511
    /**
512
     * Render Sections data
513
     */
398 geraldo 514
    const renderSectionData = (data) => $("#rows").html($("#sectionTemplate").render(data, {
323 geraldo 515
        removeTags: removeTags,
341 geraldo 516
        getAnswer: getAnswer,
429 geraldo 517
        getStatus: getStatus,
518
        getPtos: getPtos
398 geraldo 519
    }));
251 geraldo 520
    /**
521
     * Clear Div Section data
522
     */
523
    const clearSectionData = () => $("#rows").html('');
524
    /**
525
     * Clicked refresh button
526
     */
527
    $('button.btn-refresh').click(function(e) {
528
        tableForm.fnDraw();
529
    });
438 geraldo 530
    /**
531
     * Format input number (Form Option)
532
     */
533
    $('#form-review #question-value').inputNumberFormat({
534
        'decimal': 2
535
    });
475 geraldo 536
 
481 geraldo 537
    $('input[type=checkbox]').change(function () {
538
     tableForm.fnDraw();
539
    });
475 geraldo 540
 
478 geraldo 541
});
477 geraldo 542
 
543
 
544
 
545
 
546
 
547
 
251 geraldo 548
JS;
549
$this->inlineScript()->captureEnd();
550
?>
551
 
552
<!-- Content Header (Page header) -->
553
<section class="content-header">
476 geraldo 554
   <div class="container-fluid">
555
      <div class="row mb-2">
556
         <div class="col-sm-12">
557
            <h1>LABEL_REVIEWS</h1>
558
         </div>
559
      </div>
560
   </div>
561
   <!-- /.container-fluid -->
251 geraldo 562
</section>
314 geraldo 563
<section class="content" style="padding: 13px;">
476 geraldo 564
<div class="container-fluid" id="row-forms">
565
   <div class="row">
566
      <div class="col-12">
567
         <div class="card">
568
            <div class="card-body">
569
               <table id="gridTable" class="table   table-hover">
570
                  <thead>
571
                     <tr>
572
                        <th style="width: 16.6%;">LABEL_USER</th>
573
                        <th style="width: 16.6%;">LABEL_NAME</th>
574
                        <th style="width: 16.6%;">LABEL_LANGUAGE</th>
575
                        <th style="width: 16.6%;">LABEL_STATUS</th>
576
                        <th style="width: 16.6%;">LABEL_REGISTER</th>
577
                        <th style="width: 16.6%;">LABEL_ACTIONS</th>
578
                     </tr>
579
                  </thead>
580
                  <tbody></tbody>
581
               </table>
582
            </div>
583
            <div class="card-footer clearfix">
584
               <div class="row">
585
                  <div class="col-md-6 col-sm-6 col-xs-12">
586
                     <div class="form-check">
587
                        <input class="form-check-input" type="checkbox" id="only_pending" name="only_pending" value="1">
588
                        <label class="form-check-label">LABEL_ONLY_PENDING</label>
589
                     </div>
590
                  </div>
591
                  <div class="col-md-6 col-sm-6 col-xs-12">
592
                     <div style="float:right;">
474 geraldo 593
                        <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
476 geraldo 594
                     </div>
595
                  </div>
596
               </div>
597
            </div>
598
         </div>
599
      </div>
600
   </div>
474 geraldo 601
</div>
476 geraldo 602
<!-- Create/Edit Form -->
603
<div class="row" id="row-edit" style="display: none">
604
   <div class="col-xs-12 col-md-12">
605
      <form action="#" name="form-main" id="form-main">
606
         <div class="form-group">
607
            <label for="form-status">LABEL_USER:</label>
608
            <div id="user"></div>
609
         </div>
610
         <div class="form-group">
611
            <label for="form-status">LABEL_FORM:</label>
612
            <div id="name"></div>
613
         </div>
614
         <div class="form-group">
615
            <label for="form-status">LABEL_DESCRIPTION:</label>
616
            <div id="text"></div>
617
         </div>
618
         <div class="row">
619
            <div class="col-xs-12 col-md-12">
620
               <div class="panel-group" id="rows"></div>
251 geraldo 621
            </div>
476 geraldo 622
         </div>
623
         <div class="form-group">
624
            <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE</button>
625
            <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
626
         </div>
627
      </form>
628
   </div>
434 geraldo 629
</div>
476 geraldo 630
<!-- Create/Edit Form-->
631
<div  id="modal-review" class="modal" tabindex="-1" role="dialog">
632
   <div class="modal-dialog modal-lg" role="document">
633
      <form action="#" name="form-option" id="form-review">
634
         <input type="hidden" name="section" id="section" value="" />
635
         <input type="hidden" name="question" id="question" value="" />
636
         <div class="modal-content">
637
            <div class="modal-header">
638
               <h4 class="modal-title">LABEL_RESPONSE_REVIEW</h4>
639
               <button type="button" class="close" data-dismiss="modal" aria-label="Close">
640
               <span aria-hidden="true">&times;</span>
641
               </button>
642
            </div>
643
            <div class="modal-body">
644
               <div class="form-group">
645
                  <label for="option-text">LABEL_COMMENT</label>
646
                  <!--  ckeditor -->
647
                  <textarea  name="question-comment" id="question-comment" rows="5" class="form-control" placeholder="LABEL_ENTER_COMMENT"></textarea>
648
               </div>
649
               <div class="form-group">
650
                  <label for="question-status">LABEL_ANSWER_CORRECT</label>
651
                  <select name="question-status" id="question-status" class="form-control">
652
                     <option value="1">LABEL_YES</option>
653
                     <option value="0">LABEL_NOT</option>
654
                  </select>
655
               </div>
656
               <div class="form-group">
657
                  <label for="question-value">LABEL_VALUE</label>
658
                  <input type="text" name="question-value" id="question-value"  class="form-control" />
659
               </div>
660
            </div>
661
            <div class="modal-footer">
662
               <button type="button" class="btn btn-primary btn-add-review">LABEL_SAVE</button>
663
               <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
664
            </div>
665
         </div>
666
      </form>
667
   </div>
668
</div>
411 geraldo 669
 
251 geraldo 670
    <!---Template Sections --->
671
    <script id="sectionTemplate" type="text/x-jsrender">
460 geraldo 672
    <div class="panel panel-default" id="panel-{{:slug_section}}">
369 geraldo 673
   <div class="panel-heading">
674
      <h4 class="panel-title">
675
         <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:slug_section}}" href="#collapse-{{:slug_section}}">
676
         <span class="section-name{{:slug_section}}">
677
         {{:name}}
678
         </span>
679
         </a>
680
      </h4>
681
   </div>
682
   <div id="collapse-{{:slug_section}}" class="panel-collapse in collapse show">
683
      <div class="panel-body">
450 geraldo 684
         <div class="table-responsive">
463 geraldo 685
            <table class="table table-bordered table-review">
459 geraldo 686
               <thead>
369 geraldo 687
                  <tr>
399 geraldo 688
                     <th style="width: 30%;">LABEL_QUESTION</th>
428 geraldo 689
                     <th style="width: 30%;">LABEL_ANSWER</th>
399 geraldo 690
                     <th style="width: 10%;">LABEL_STATUS</th>
467 geraldo 691
                     <th style="width: 15%;">LABEL_PTOS</th>
692
                     <th style="width: 15%;">LABEL_ACTIONS</th>
369 geraldo 693
                  </tr>
459 geraldo 694
               </thead>
695
               <tbody>
460 geraldo 696
                  {{for questions}}
369 geraldo 697
                  <tr class="tr-question">
698
                     <td class="text-left">{{:~removeTags(text)}} </td>
699
                     <td>{{:~getAnswer(type,options,answer)}}</td>
700
                     <td>
701
                        {{if type == 'simple'  || type=='multiple' }}
429 geraldo 702
                        {{:~getStatus(options,answer,type)}}
369 geraldo 703
                        {{else}}
399 geraldo 704
                        {{if status}}
460 geraldo 705
                        <font color="green">LABEL_CORRECT</font>
706
                        {{else}}
707
                        <font color="red">LABEL_FAIL</font>
399 geraldo 708
                        {{/if}}
460 geraldo 709
                        {{/if}}
399 geraldo 710
                     </td>
711
                     <td>
460 geraldo 712
                        {{:~getPtos(options,answer,type, value, question_value)}}
713
                     </td>
429 geraldo 714
                     <td>
399 geraldo 715
                        {{if type != 'simple'  && type !='multiple' }}
466 geraldo 716
                        <button class="btn btn-default btn-edit-review"  data-original-title="LABEL_EDIT" data-section="{{:slug_section}}" data-question="{{:slug_question}}">
717
                        <i class="fa fa-pencil" aria-hidden="true"></i> LABEL_EDIT
369 geraldo 718
                        </button>
413 geraldo 719
                        {{/if}}
369 geraldo 720
                     </td>
721
                  </tr>
460 geraldo 722
                  {{/for}}
459 geraldo 723
               </tbody>
369 geraldo 724
            </table>
450 geraldo 725
         </div>
369 geraldo 726
      </div>
727
   </div>
728
</div>
251 geraldo 729
    </script>
730
 
731
    <!-- End Template Sections-->
732
 
733
</section>