Proyectos de Subversion LeadersLinked - Backend

Rev

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