Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
1709 eleazar 1
<?php
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
$roleName       = $currentUser->getUserTypeId();
5
 
2029 eleazar 6
$routeIndex = $this->url('recruitment-and-selection/interview/form');
2128 eleazar 7
$routeAdd = $this->url('recruitment-and-selection/interview/form/add', ['candidate_uuid' => 'UUID_PLACEHOLDER']);
1877 eleazar 8
 
1827 eleazar 9
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/interview/form/add') ? 1 : 0;
1709 eleazar 10
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
11
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
12
 
13
 
14
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
15
 
16
 
1885 eleazar 17
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
1709 eleazar 18
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
19
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
20
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
21
 
22
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
23
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
24
 
25
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
26
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
27
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
28
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
29
 
30
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
33
 
34
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
35
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
36
 
37
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
38
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
39
 
40
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
41
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
43
 
1887 eleazar 44
 
2746 eleazar 45
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
46
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
47
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
48
 
1887 eleazar 49
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
1709 eleazar 50
 
2052 eleazar 51
// JsRender //
52
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
1709 eleazar 53
 
2510 eleazar 54
 
55
$points_0 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_0;
56
$points_1 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_1;
57
$points_2 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_2;
58
$points_3 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_3;
59
$points_4 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_4;
60
 
61
 
62
 
1709 eleazar 63
$this->headStyle()->captureStart();
64
echo <<<CSS
65
 
66
CSS;
67
$this->headStyle()->captureEnd();
68
 
69
$this->inlineScript()->captureStart();
70
echo <<<JS
71
 
2503 eleazar 72
const classFormGenerator = function() {
73
    this.id = 0,
74
        this.table = '',
75
        this.text = '',
2506 eleazar 76
        this.behaviors = [],
2503 eleazar 77
        this.clear = function() {
2506 eleazar 78
            this.behaviors = [];
2503 eleazar 79
            this.render();
80
        },
81
 
82
        /**
83
         * Add element to section array
84
         */
2506 eleazar 85
        this.addSection = function( text, value) {
2503 eleazar 86
            var d = new Date();
87
            var slug = 'section' + d.getTime();
88
            var position = 0;
2506 eleazar 89
            $.each(this.behaviors, function(index, section) {
2503 eleazar 90
                if (position < section.position) {
91
                    position = section.position;
92
                }
93
            });
94
            position++;
95
            var section = {
2506 eleazar 96
                'slug_behaviors': slug,
2503 eleazar 97
                'text': text,
98
                'value': value,
99
                'position': position,
100
                'questions': [],
101
                'status': 0
102
            }
2506 eleazar 103
            this.behaviors.push(section);
2503 eleazar 104
        },
105
         /**
106
         * Edit element to section array
107
         */
2506 eleazar 108
        this.editSection = function(slug, text, value) {
2503 eleazar 109
            var renderTable = false;
2506 eleazar 110
            for (i = 0; i < this.behaviors.length; i++) {
111
                if (slug == this.behaviors[i].slug_behaviors) {
112
                    this.behaviors[i].text = text;
113
                    this.behaviors[i].value = value;
2503 eleazar 114
                    renderTable = true;
115
                    break;
116
                }
117
            }
118
            if (renderTable) {
119
                this.renderSection(slug);
120
            }
121
        },
122
         /**
123
         * Remove element to section array
124
         */
125
        this.deleteSection = function(slug) {
126
            var renderTable = false;
2506 eleazar 127
            for (i = 0; i < this.behaviors.length; i++) {
128
                if (slug == this.behaviors[i].slug_behaviors) {
129
                    this.behaviors.splice(i, 1);
2503 eleazar 130
                    renderTable = true;
131
                    break;
132
                }
133
            }
134
            if (renderTable) {
135
                $('#panel' + slug).remove();
136
            }
137
        }
138
}
139
 
1709 eleazar 140
jQuery( document ).ready(function( $ ) {
2504 eleazar 141
    var objFormGenerator = new classFormGenerator();
2506 eleazar 142
    //objFormGenerator.render();
1877 eleazar 143
    $.validator.setDefaults({
2015 eleazar 144
        debug: true,
145
        highlight: function(element) {
146
            $(element).addClass('is-invalid');
147
        },
148
        unhighlight: function(element) {
149
            $(element).removeClass('is-invalid');
150
        },
151
        errorElement: 'span',
152
        errorClass: 'error invalid-feedback',
153
        errorPlacement: function(error, element) {
154
            if(element.parent('.btn-file').length) {
155
                error.insertAfter(element.parent().parent());
156
            } else if(element.parent('.toggle').length) {
157
                error.insertAfter(element.parent().parent());
158
            } else {
159
                error.insertAfter(element.parent());
1709 eleazar 160
            }
2015 eleazar 161
        }
162
    });
1709 eleazar 163
 
2015 eleazar 164
    $.fn.showFormErrorValidator = function(fieldname, errors) {
165
        var field = $(fieldname);
166
        if(field) {
167
            $(field).addClass('is-invalid');
1709 eleazar 168
 
2015 eleazar 169
            var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
170
 
171
            if(element.parent('.btn-file').length) {
172
                error.insertAfter(element.parent().parent());
173
            } else if(element.parent('.toggle').length) {
174
                error.insertAfter(element.parent().parent());
175
            } else {
176
                error.insertAfter(element.parent());
1709 eleazar 177
            }
2015 eleazar 178
        }
179
    };
1827 eleazar 180
 
2523 eleazar 181
    function getContent() {
182
        return $('[data-behavior-textarea]').map(
183
            function (idx, td) {
184
                const uuid = $(td).data('behavior-textarea');
185
                const textarea = $(td).find('textarea');
186
                const select = $(td).find('select');
2521 eleazar 187
 
2523 eleazar 188
                return {
189
                    uuid: uuid,
190
                    comment: textarea.val(),
191
                    evaluation: select.val(),
192
                }
193
            }
194
        ).get()
195
    }
196
 
2537 eleazar 197
    var validator = $('#form-interview').validate({
1877 eleazar 198
        debug: true,
199
        onclick: false,
200
        onkeyup: false,
201
        ignore: [],
2534 eleazar 202
        rules: {},
1877 eleazar 203
        submitHandler: function(form) {
204
            $.ajax({
205
                'dataType': 'json',
206
                'accept': 'application/json',
207
                'method': 'post',
2549 eleazar 208
                'url': '$routeAdd'.replaceAll('UUID_PLACEHOLDER', $('#candidate_uuid').val()),
2523 eleazar 209
                'data': {
2571 eleazar 210
                    content: JSON.stringify(getContent()),
2523 eleazar 211
                    vacancy_uuid: $('#vacancy_uuid').val(),
212
                    candidate_uuid: $('#candidate_uuid').val(),
2686 eleazar 213
                    points: $('#points').val(),
2744 eleazar 214
                    comment: $('#comment').val(),
2747 eleazar 215
                    type: $('#type').val(),
2749 eleazar 216
                    status: $('#status').val(),
2523 eleazar 217
                }
1877 eleazar 218
            }).done(function(response) {
219
                NProgress.start();
220
                if (response['success']) {
221
                    $.fn.showSuccess(response['data']);
2521 eleazar 222
                    $('#main').show();
2536 eleazar 223
                    $('#interview').hide();
2791 eleazar 224
                    $('#vacancy_uuid').change();
1877 eleazar 225
                } else {
226
                    validator.resetForm();
227
                    if (jQuery.type(response['data']) == 'string') {
228
                        $.fn.showError(response['data']);
229
                    } else {
230
                        $.each(response['data'], function(fieldname, errors) {
2531 eleazar 231
                            $.fn.showFormErrorValidator('#interview #' + fieldname, errors);
1877 eleazar 232
                        });
233
                    }
234
                }
235
            }).fail(function(jqXHR, textStatus, errorThrown) {
236
                $.fn.showError(textStatus);
237
            }).always(function() {
238
                NProgress.done();
239
            });
240
            return false;
241
        },
242
        invalidHandler: function(form, validator) {}
243
    });
1709 eleazar 244
 
2015 eleazar 245
    $('body').on('click', 'button.btn-add', function(e) {
246
        e.preventDefault();
247
        NProgress.start();
248
        $.ajax({
249
            'dataType': 'json',
250
            'accept': 'application/json',
251
            'method': 'get',
2785 eleazar 252
            'url': $(this).data('url'), //'$routeAdd'.replaceAll('UUID_PLACEHOLDER', $('#candidate_uuid').val()),
2015 eleazar 253
        }).done(function(response) {
254
            if (response['success']) {
2237 eleazar 255
                var data = response.data
2785 eleazar 256
                $("#interview #comment").val('');
257
                $('#interview #status').val('');
258
                $('#interview #type').val('')
259
                $("#interview #points").val('');
260
 
2264 eleazar 261
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2313 eleazar 262
                $("#interview").show()
1877 eleazar 263
            } else {
2015 eleazar 264
                $.fn.showError(response['data']);
1877 eleazar 265
            }
2015 eleazar 266
        }).fail(function(jqXHR, textStatus, errorThrown) {
267
            $.fn.showError(textStatus);
268
        }).always(function() {
269
            NProgress.done();
1877 eleazar 270
        });
2015 eleazar 271
    });
2785 eleazar 272
 
273
    $('body').on('click', 'button.btn-edit', function(e) {
274
        e.preventDefault();
275
        NProgress.start();
276
        $.ajax({
277
            'dataType': 'json',
278
            'accept': 'application/json',
279
            'method': 'get',
280
            'url': $(this).data('url'), //'$routeAdd'.replaceAll('UUID_PLACEHOLDER', $('#candidate_uuid').val()),
281
        }).done(function(response) {
282
            if (response['success']) {
283
                var data = response.data
2798 eleazar 284
                $("#interview #comment").val(data['interview']['comment']);
285
                $('#interview #status').val(data['interview']['status']);
286
                $('#interview #type').val(data['interview']['type']);
287
                $("#interview #points").val(data['interview']['points']);
2785 eleazar 288
                $("#competencies-job").html($("#competenciesTemplate").render(data))
289
                $("#interview").show()
290
            } else {
291
                $.fn.showError(response['data']);
292
            }
293
        }).fail(function(jqXHR, textStatus, errorThrown) {
294
            $.fn.showError(textStatus);
295
        }).always(function() {
296
            NProgress.done();
297
        });
298
    });
2788 eleazar 299
 
300
    $('button.btn-delete').confirmation({
301
                rootSelector: 'button.btn-delete',
302
                title: 'LABEL_ARE_YOU_SURE',
303
                singleton: true,
304
                btnOkLabel: 'LABEL_YES',
305
                btnCancelLabel: 'LABEL_NO',
306
                onConfirm: function (value) {
307
                    action = $(this).data('href');
308
                    NProgress.start();
309
                    $.ajax({
310
                        'dataType': 'json',
311
                        'accept': 'application/json',
312
                        'method': 'post',
313
                        'url': $(this).data('url'),
314
                    }).done(function (response) {
315
                        if (response['success']) {
316
                            $.fn.showSuccess(response['data']);
2790 eleazar 317
                            $('#vacancy_uuid').change();
2788 eleazar 318
                        } else {
319
                            $.fn.showError(response['data']);
320
                        }
321
                    }).fail(function (jqXHR, textStatus, errorThrown) {
322
                        $.fn.showError(textStatus);
323
                    }).always(function () {
324
                        NProgress.done();
325
                    });
326
                },
327
            });
2015 eleazar 328
 
329
    $('body').on('click', 'button.btn-cancel', function(e) {
330
        e.preventDefault();
2521 eleazar 331
        $('#main').show();
2015 eleazar 332
        $('#row-form').hide();
333
        $('#div-listing').show();
334
    });
335
 
336
    $('#form-filter #vacancy_uuid').change(function(e) {
337
        e.preventDefault();
2577 eleazar 338
        $('#form-filter #candidate_uuid').empty();
2015 eleazar 339
    })
2118 eleazar 340
 
2577 eleazar 341
    $('#form-filter #candidate_uuid').change(function(e) {
2015 eleazar 342
        e.preventDefault();
343
    })
2525 eleazar 344
     /**
345
     * Clicked cancel new/edit Form
346
     */
347
    $('button.btn-edit-cancel').click(function(e) {
348
        e.preventDefault();
2526 eleazar 349
        $('#interview').hide();
2525 eleazar 350
    });
351
    /**
352
     * Clicked save and continue new Form
353
     */
354
    $('button.btn-form-save-continue').click(function(e) {
355
        e.preventDefault();
356
        $('#interview #form-continue').val('1')
2540 eleazar 357
        $('#form-interview').submit();
2525 eleazar 358
    });
359
    /**
360
     * Clicked save and close new/edit Form
361
     */
362
    $('button.btn-form-save-close').click(function(e) {
363
        e.preventDefault();
364
        $('#interview #form-continue').val('0')
2540 eleazar 365
        $('#form-interview').submit();
2525 eleazar 366
    });
2029 eleazar 367
 
368
    $('#vacancy_uuid').on('change', function () {
2042 eleazar 369
        $('#candidate_uuid').html('');
370
 
2029 eleazar 371
        $.ajax({
372
            'dataType': 'json',
373
            'accept': 'application/json',
374
            'method': 'get',
2031 eleazar 375
            'url': "$routeIndex" + "?vacancy_uuid=" + $('#vacancy_uuid').val(),
2038 eleazar 376
        }).done(function (response) {
377
            var data = response.data
378
 
2036 eleazar 379
            data.candidates.forEach(function (candidate) {
2761 eleazar 380
                var option = $('<option />')
381
                    .val(candidate.uuid)
2777 eleazar 382
                    .text(candidate.first_name)
383
                    .data('addUrl', candidate.add_url)
384
                    .data('editUrl', candidate.edit_url)
385
                    .data('deleteUrl', candidate.delete_url)
2041 eleazar 386
 
387
                $('#candidate_uuid').append(option);
2036 eleazar 388
            });
2052 eleazar 389
 
2785 eleazar 390
            $('#candidate_uuid').change();
391
 
2244 eleazar 392
            $('#job-description').html($('#job-description-template').render(response.data));
2029 eleazar 393
        })
394
    });
2032 eleazar 395
 
396
    $('#vacancy_uuid').change();
2785 eleazar 397
 
398
    $('#candidate_uuid').on('change', function () {
399
        const uuid = $('#candidate_uuid').val();
400
        const data = $('#candidate_uuid option[value="' + uuid + '"]').data()
401
 
402
        $('#add-button').data('url', data.addUrl)
403
        $("#edit-button").data('url', data.editUrl)
404
        $("#delete-button").data('url', data.deleteUrl)
405
        if (data.addUrl) {
406
            $('#add-button').show();
407
            $('#edit-button').hide();
408
            $('#delete-button').hide();
409
        } else {
410
            $('#add-button').hide();
411
            $('#edit-button').show();
412
            $('#delete-button').show();
413
        }
414
 
415
    });
1709 eleazar 416
});
417
JS;
418
$this->inlineScript()->captureEnd();
419
?>
420
 
421
 
422
<!-- Content Header (Page header) -->
2521 eleazar 423
<section class="main-header">
1709 eleazar 424
	<div class="container-fluid">
425
    	<div class="row mb-2">
426
        	<div class="col-sm-12">
427
            	<h1>LABEL_INTERVIEW</h1>
428
			</div>
429
		</div>
430
	</div><!-- /.container-fluid -->
431
</section>
432
 
2521 eleazar 433
<section class="main">
1709 eleazar 434
	<div class="container-fluid">
435
    	<div class="row">
436
        	<div class="col-12">
2537 eleazar 437
 
438
				<div class="card">
439
					<div class="card-header">
440
                        <div class="row">
441
                            <div class="col-md-6 col-sm-12">
442
                                <div class="form-group">
443
                                    <label for="vacancy_uuid">LABEL_VACANCY</label>
444
                                    <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
445
                                        <?php foreach($this->vacancies as $vacancy): ?>
446
                                            <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
447
                                        <?php endforeach; ?>
448
                                    </select>
449
                                </div>
1709 eleazar 450
                            </div>
2537 eleazar 451
                            <div class="col-md-6 col-sm-12">
452
                                <div class="form-group">
453
                                    <label for="candidate_uuid">LABEL_CANDIDATES</label>
454
                                    <select id="candidate_uuid" name="candidate_uuid" class="form-control">
455
                                    </select>
456
                                </div>
1709 eleazar 457
                            </div>
2537 eleazar 458
                            <div
459
                                class="col-md-12 col-sm-12"
460
                            >
461
                            </div>
1709 eleazar 462
                        </div>
2537 eleazar 463
					</div>
464
					<div class="card-body">
465
                        <div id="job-description"></div>
466
                   	</div>
467
                    <div class="card-footer clearfix">
468
                        <div style="float:right;">
2785 eleazar 469
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
470
                            <button id="edit-button" type="button" class="btn btn-primary btn-edit"><i class="fa fa-plus"></i> LABEL_EDIT </button>
471
                            <button id="delete-button" type="button" class="btn btn-primary btn-delete"><i class="fa fa-plus"></i> LABEL_DELETE </button>
2537 eleazar 472
                        </div>
2015 eleazar 473
                    </div>
2537 eleazar 474
                 </div>
1876 eleazar 475
            </div>
2015 eleazar 476
        </div>
477
 	</div>
478
</section>
2052 eleazar 479
 
480
<script id="job-description-template" type="text/x-jsrender">
481
    <div class="card">
482
        <div class="card-body">
483
            <h5 class="card-title">{{:job_description.name}}</h5>
484
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 485
            <p class="card-text">{{:job_description.objectives}}</p>
486
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 487
        </div>
488
    </div>
2061 eleazar 489
</script>
490
 
2314 eleazar 491
<section id="interview" style="display: none;">
2215 eleazar 492
	<div class="container-fluid">
493
    	<div class="row">
494
        	<div class="col-12">
2537 eleazar 495
                <form action="#" name="form-interview" id="form-interview">
496
                    <input type="hidden" name="form-continue" id="form-continue" value="0" />
2689 eleazar 497
			    	<div class="card">
498
                    <?php
499
                         $form->setAttributes([
500
                             'method' => 'post',
501
                             'name' => 'form-add',
502
                             'id' => 'form-add'
503
                         ]);
504
                         $form->prepare();
505
                         echo $this->form()->openTag($form);
506
                         ?>
2537 eleazar 507
			    		<div class="card-header">
508
                            <label>interview</label>
509
			    		</div>
510
			    		<div class="card-body">
511
                            <div id="competencies-job"></div>
2683 eleazar 512
                                <div class="form-group">
513
                                    <?php
514
                                    $element = $form->get('comment');
515
                                    $element->setOptions(['label' => 'LABEL_COMMENT']);
516
                                    $element->setAttributes(['class' => 'form-control']);
517
                                    echo $this->formLabel($element);
518
                                    echo $this->formText($element);
519
                                    ?>
520
                                </div>
521
                                <div class="form-group">
522
                                    <?php
523
                                    $element = $form->get('points');
524
                                    $element->setAttributes(['class' => 'form-control']);
525
                                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
526
                                    echo $this->formLabel($element);
527
                                    echo $this->formSelect($element);
528
                                    ?>
529
                                </div>
2744 eleazar 530
                                <div class="form-group">
531
                                    <?php
532
                                    $element = $form->get('status');
533
                                    $element->setAttributes(['class' => 'form-control']);
534
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
535
                                    echo $this->formLabel($element);
536
                                    echo $this->formSelect($element);
537
                                    ?>
538
                                </div>
539
                                <div class="form-group">
540
                                    <?php
2747 eleazar 541
                                    $element = $form->get('type');
2744 eleazar 542
                                    $element->setAttributes(['class' => 'form-control']);
543
                                    $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
544
                                    echo $this->formLabel($element);
545
                                    echo $this->formSelect($element);
546
                                    ?>
547
                                </div>
2537 eleazar 548
                            </div>
549
                       	</div>
550
                        <div class="card-footer clearfix">
551
                        <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
552
                        <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
553
                        <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
2515 eleazar 554
                        </div>
2280 eleazar 555
                    </div>
2537 eleazar 556
                </form>
2215 eleazar 557
            </div>
558
        </div>
559
 	</div>
560
</section>
561
 
2264 eleazar 562
<script id="competenciesTemplate" type="text/x-jsrender">
2508 eleazar 563
<table class="table table-bordered" id="panel-{{:slug_section}}>
2293 eleazar 564
    <thead>
565
        <tr>
2306 eleazar 566
           <th style="width: 50%;">LABEL_ELEMENT</th>
2293 eleazar 567
           <th style="width: 50%;">LABEL_TITLE</th>
568
        </tr>
569
    </thead>
2300 eleazar 570
    <tbody>
571
        {{for job_description.competencies}}
572
            <tr>
573
               <td class="text-left">LABEL_COMPETENCY</td>
2302 eleazar 574
               <td class="text-left">{{:competency_name}}</td>
2300 eleazar 575
            </tr>
2302 eleazar 576
 
577
            {{for behaviors}}
2308 eleazar 578
                <tr>
2302 eleazar 579
                   <td class="text-left">--LABEL_CONDUCT</td>
580
                   <td class="text-left">
2303 eleazar 581
                      {{:description}}
2508 eleazar 582
                   </td>
2507 eleazar 583
                </tr>
584
                <tr>
2520 eleazar 585
                    <td colspan="2" data-behavior-textarea="{{:uuid}}">
2519 eleazar 586
                        <label for="textarea-{{:uuid}}">LABEL_COMMENT</label>
587
 
588
                        <textarea
589
                            id="textarea-{{:uuid}}"
590
                            class="form-control"
591
                        ></textarea>
592
 
593
                        <label for="select-{{:uuid}}">LABEL_EVALUATION</label>
594
 
595
                        <select class="form-control" id="behavior-level-{{:uuid}}">
596
                            <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
597
                            <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
598
                            <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
599
                            <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
600
                            <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
601
                        </select>
602
                    </td>
2506 eleazar 603
                </tr>
604
            {{/for}}
605
 
2300 eleazar 606
        {{/for}}
607
    </tbody>
2293 eleazar 608
</table>
2241 eleazar 609
</script>