mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-08-08 15:30:20 +02:00
Tests
This commit is contained in:
BIN
apps/family/static/family/img/default_picture.png
Normal file
BIN
apps/family/static/family/img/default_picture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
@@ -113,6 +113,7 @@ function reset () {
|
||||
* Apply all transactions: all notes in `notes` buy each item in `buttons`
|
||||
*/
|
||||
function consumeAll () {
|
||||
console.log("test");
|
||||
if (LOCK) { return }
|
||||
LOCK = true
|
||||
|
||||
@@ -130,11 +131,13 @@ function consumeAll () {
|
||||
LOCK = false
|
||||
return
|
||||
}
|
||||
|
||||
console.log("couocu")
|
||||
// Récupérer les IDs des familles et des challenges
|
||||
const family_ids = notes_display.map(fam => fam.id)
|
||||
const challenge_ids = buttons.map(chal => chal.id)
|
||||
|
||||
console.log(family_ids)
|
||||
console.log(challenge_ids)
|
||||
$.ajax({
|
||||
url: '/family/api/family/achievements/batch/',
|
||||
type: 'POST',
|
||||
@@ -157,34 +160,6 @@ function consumeAll () {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new achievement through the API.
|
||||
* @param family The selected family
|
||||
* @param challenge The selected challenge
|
||||
*/
|
||||
function grantAchievement (family, challenge) {
|
||||
console.log("grant lancée",family,challenge)
|
||||
$.post('/api/family/achievement/',
|
||||
{
|
||||
csrfmiddlewaretoken: CSRF_TOKEN,
|
||||
family: family.id,
|
||||
challenge: challenge.id,
|
||||
})
|
||||
.done(function () {
|
||||
reset()
|
||||
addMsg("Défi validé pour la famille !", 'success', 5000)
|
||||
})
|
||||
.fail(function (e) {
|
||||
reset()
|
||||
if (e.responseJSON) {
|
||||
errMsg(e.responseJSON)
|
||||
} else if (e.responseText) {
|
||||
errMsg(e.responseText)
|
||||
} else {
|
||||
errMsg("Erreur inconnue lors de la création de l'achievement.")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var searchbar = document.getElementById("search-input")
|
||||
var search_results = document.getElementById("search-results")
|
||||
@@ -264,7 +239,6 @@ function li (id, text, extra_css) {
|
||||
*/
|
||||
function autoCompleteFamily(field_id, family_list_id, families, families_display, family_prefix = 'family', user_family_field = null, profile_pic_field = null, family_click = null) {
|
||||
const field = $('#' + field_id)
|
||||
console.log("autoCompleteFamily commence")
|
||||
// Configuration du tooltip
|
||||
field.tooltip({
|
||||
html: true,
|
||||
|
Reference in New Issue
Block a user