This commit is contained in:
asyncnomi 2023-01-09 10:38:50 +01:00
parent 1777e5abdc
commit 956b570f67

View file

@ -289,7 +289,7 @@ function get_admin(type) {
}
activityData.sort((a, b) => new Date(a.start) - new Date(b.start));
for (entry in activityData) {
if (activityData[entry].type = "event") {
if (activityData[entry].type == "event") {
$("#admin-content").append(`
<span id="${activityData[entry].activityUid}" class="activity">
<div class="activity-title">Event: <textarea class="admin-textarea">${activityData[entry].title}</textarea></div>
@ -306,7 +306,7 @@ function get_admin(type) {
</span>
</span>
`)
} else if (activityData[entry].type = "treasure") {
} else if (activityData[entry].type == "treasure") {
$("#admin-content").prepend(`
<span id="${activityData[entry].activityUid}" class="activity">
<div class="activity-title">Trésor: <textarea class="admin-textarea">${activityData[entry].title}</textarea></div>
@ -631,7 +631,7 @@ $('#treasure-popup-button').click((e) => {
var tuid = $('#treasure-popup-uid').val();
if(tuid != '') {
indata.treasureUid = tuid;
}
}
fr.addEventListener('load', () => {
indata.image = fr.result;
@ -641,7 +641,7 @@ $('#treasure-popup-button').click((e) => {
data: JSON.stringify(indata),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
if(data.success) {
updateDemandes();
@ -653,7 +653,7 @@ $('#treasure-popup-button').click((e) => {
});
});
fr.readAsDataURL(f);
});
@ -816,7 +816,7 @@ function updateDemandes() {
$elem = $('#' + td[td_uid].activityUid);
$elem.addClass('treasure-submitted');
$elem.find(".treasure-btn-submit").text('Editer la soumission');
$(`<div class="treasure-image">Image: <a href="${base_url}images/${td[td_uid].image}.html" target="_blank"> Lien</a></div>`).insertAfter($elem.find('.treasure-desc'))
$(`<div class="treasure-user-desc">${td[td_uid].desc}</div>`).insertAfter($elem.find('.treasure-desc'))
$(`<p>Votre soumission :</p>`).insertAfter($elem.find('.treasure-desc'))
@ -831,7 +831,7 @@ function updateDemandes() {
console.error(data.why);
}
}
});
}
}