Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 2777 | Rev 2788 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2777 Rev 2785
Línea 247... Línea 247...
247
        NProgress.start();
247
        NProgress.start();
248
        $.ajax({
248
        $.ajax({
249
            'dataType': 'json',
249
            'dataType': 'json',
250
            'accept': 'application/json',
250
            'accept': 'application/json',
251
            'method': 'get',
251
            'method': 'get',
252
            'url': '$routeAdd'.replaceAll('UUID_PLACEHOLDER', $('#candidate_uuid').val()),
252
            'url': $(this).data('url'), //'$routeAdd'.replaceAll('UUID_PLACEHOLDER', $('#candidate_uuid').val()),
253
        }).done(function(response) {
253
        }).done(function(response) {
254
            if (response['success']) {
254
            if (response['success']) {
255
                var data = response.data
255
                var data = response.data
256
                $("#interview #text-option").val('');
256
                $("#interview #comment").val('');
-
 
257
                $('#interview #status').val('');            
-
 
258
                $('#interview #type').val('')
257
                $("#interview #behavior-level").val('');
259
                $("#interview #points").val('');
-
 
260
              
-
 
261
                $("#competencies-job").html($("#competenciesTemplate").render(data))
-
 
262
                $("#interview").show()
-
 
263
            } else {
-
 
264
                $.fn.showError(response['data']);
-
 
265
            }
-
 
266
        }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
267
            $.fn.showError(textStatus);
-
 
268
        }).always(function() {
-
 
269
            NProgress.done();
-
 
270
        });
-
 
271
    });
-
 
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
-
 
284
                $("#interview #comment").val(data['comment']);
-
 
285
                $('#interview #status').val(data['status']);            
-
 
286
                $('#interview #type').val(data['type']);
-
 
287
                $("#interview #points").val(data['points']);
258
                $("#competencies-job").html($("#competenciesTemplate").render(data))
288
                $("#competencies-job").html($("#competenciesTemplate").render(data))
259
                $("#interview").show()
289
                $("#interview").show()
260
            } else {
290
            } else {
261
                $.fn.showError(response['data']);
291
                $.fn.showError(response['data']);
262
            }
292
            }
Línea 326... Línea 356...
326
                    .data('deleteUrl', candidate.delete_url)
356
                    .data('deleteUrl', candidate.delete_url)
Línea 327... Línea 357...
327
                
357
                
328
                $('#candidate_uuid').append(option);
358
                $('#candidate_uuid').append(option);
Línea -... Línea 359...
-
 
359
            });
-
 
360
 
329
            });
361
            $('#candidate_uuid').change();
330
 
362
 
331
            $('#job-description').html($('#job-description-template').render(response.data));
363
            $('#job-description').html($('#job-description-template').render(response.data));
Línea 332... Línea 364...
332
        })
364
        })
-
 
365
    });
-
 
366
 
-
 
367
    $('#vacancy_uuid').change();
-
 
368
 
-
 
369
    $('#candidate_uuid').on('change', function () {
-
 
370
        const uuid = $('#candidate_uuid').val();
-
 
371
        const data = $('#candidate_uuid option[value="' + uuid + '"]').data()
-
 
372
        
-
 
373
        $('#add-button').data('url', data.addUrl)
-
 
374
        $("#edit-button").data('url', data.editUrl)
-
 
375
        $("#delete-button").data('url', data.deleteUrl)
-
 
376
        if (data.addUrl) {
-
 
377
            $('#add-button').show();
-
 
378
            $('#edit-button').hide();
-
 
379
            $('#delete-button').hide();
-
 
380
        } else {
-
 
381
            $('#add-button').hide();
-
 
382
            $('#edit-button').show();
-
 
383
            $('#delete-button').show();
333
    });
384
        }
334
 
385
 
335
    $('#vacancy_uuid').change();
386
    });
336
});
387
});
Línea 384... Línea 435...
384
					<div class="card-body">
435
					<div class="card-body">
385
                        <div id="job-description"></div>
436
                        <div id="job-description"></div>
386
                   	</div>
437
                   	</div>
387
                    <div class="card-footer clearfix">
438
                    <div class="card-footer clearfix">
388
                        <div style="float:right;">
439
                        <div style="float:right;">
389
                            <?php if($allowAdd) : ?>
440
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
390
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
441
                            <button id="edit-button" type="button" class="btn btn-primary btn-edit"><i class="fa fa-plus"></i> LABEL_EDIT </button>
391
                            <?php endif; ?>
442
                            <button id="delete-button" type="button" class="btn btn-primary btn-delete"><i class="fa fa-plus"></i> LABEL_DELETE </button>
392
                        </div>
443
                        </div>
393
                    </div>
444
                    </div>
394
                 </div>
445
                 </div>
395
            </div>
446
            </div>
396
        </div>
447
        </div>