Proyectos de Subversion LeadersLinked - Backend

Rev

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