mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-25 03:30:30 +02:00
Merge branch 'main' into potvieux
This commit is contained in:
@ -83,14 +83,14 @@ body {
|
||||
.btn-outline-primary:not(:disabled):not(.disabled).active,
|
||||
.btn-outline-primary:not(:disabled):not(.disabled):active {
|
||||
color: #fff;
|
||||
background-color: rgb(18, 67, 46);
|
||||
border-color: rgb(18, 67, 46);
|
||||
background-color: rgb(102, 83, 105);
|
||||
border-color: rgb(102, 83, 105);
|
||||
}
|
||||
|
||||
.btn-outline-primary {
|
||||
color: rgb(18, 67, 46);
|
||||
color: rgb(102, 83, 105);
|
||||
background-color: rgba(248, 249, 250, 0.9);
|
||||
border-color: rgb(18, 67, 46);
|
||||
border-color: rgb(102, 83, 105);
|
||||
}
|
||||
|
||||
.turbolinks-progress-bar {
|
||||
@ -101,35 +101,35 @@ body {
|
||||
.btn-primary:not(:disabled):not(.disabled).active,
|
||||
.btn-primary:not(:disabled):not(.disabled):active {
|
||||
color: #fff;
|
||||
background-color: rgb(18, 67, 46);
|
||||
border-color: rgb(18, 67, 46);
|
||||
background-color: rgb(102, 83, 105);
|
||||
border-color: rgb(102, 83, 105);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: rgba(248, 249, 250, 0.9);
|
||||
background-color: rgb(28, 114, 10);
|
||||
border-color: rgb(18, 67, 46);
|
||||
background-color: rgb(102, 83, 105);
|
||||
border-color: rgb(102, 83, 105);
|
||||
}
|
||||
|
||||
.border-primary {
|
||||
border-color: rgb(28, 114, 10) !important;
|
||||
border-color: rgb(115, 15, 115) !important;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgb(28, 114, 10);
|
||||
color: rgb(102, 83, 105);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: rgb(122, 163, 75);
|
||||
color: rgb(200, 30, 200);
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
box-shadow: 0 0 0 0.25rem rgba(122, 163, 75, 0.25);
|
||||
border-color: rgb(122, 163, 75);
|
||||
box-shadow: 0 0 0 0.25rem rgba(200, 30, 200, 0.25);
|
||||
border-color: rgb(200, 30, 200);
|
||||
}
|
||||
|
||||
.btn-outline-primary.focus {
|
||||
box-shadow: 0 0 0 0.25rem rgba(122, 163, 75, 0.5);
|
||||
box-shadow: 0 0 0 0.25rem rgba(200, 30, 200, 0.5);
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,21 +13,29 @@ $(document).ready(function () {
|
||||
$('#' + prefix + '_reset').removeClass('d-none')
|
||||
|
||||
$.getJSON(api_url + (api_url.includes('?') ? '&' : '?') + 'format=json&search=^' + input + api_url_suffix, function (objects) {
|
||||
let html = ''
|
||||
let html = '<ul class="list-group list-group-flush" id="' + prefix + '_list">'
|
||||
|
||||
objects.results.forEach(function (obj) {
|
||||
html += li(prefix + '_' + obj.id, obj[name_field])
|
||||
})
|
||||
html += '</ul>'
|
||||
|
||||
const results_list = $('#' + prefix + '_list')
|
||||
results_list.html(html)
|
||||
target.tooltip({
|
||||
html: true,
|
||||
placement: 'bottom',
|
||||
trigger: 'manual',
|
||||
container: target.parent(),
|
||||
fallbackPlacement: 'clockwise'
|
||||
})
|
||||
|
||||
target.attr("data-original-title", html).tooltip("show")
|
||||
|
||||
objects.results.forEach(function (obj) {
|
||||
$('#' + prefix + '_' + obj.id).click(function () {
|
||||
target.val(obj[name_field])
|
||||
$('#' + prefix + '_pk').val(obj.id)
|
||||
|
||||
results_list.html('')
|
||||
target.tooltip("hide")
|
||||
target.removeClass('is-invalid')
|
||||
target.addClass('is-valid')
|
||||
|
||||
@ -37,8 +45,8 @@ $(document).ready(function () {
|
||||
if (input === obj[name_field]) { $('#' + prefix + '_pk').val(obj.id) }
|
||||
})
|
||||
|
||||
if (results_list.children().length === 1 && e.originalEvent.keyCode >= 32) {
|
||||
results_list.children().first().trigger('click')
|
||||
if (objects.results.length === 1 && e.originalEvent.keyCode >= 32) {
|
||||
$('#' + prefix + '_' + objects.results[0].id).trigger('click')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user