Merge branch 'master' of git.rezo-rm.fr:BDEMetz/bde-liste

This commit is contained in:
johan 2023-01-09 11:16:30 +01:00
commit 67cd8f7fe1
2 changed files with 10 additions and 12 deletions

View file

@ -1,7 +1,4 @@
const fastify = require('fastify')({
logger: true,
bodyLimit: 10485760
})
const fastify = require('fastify')({ logger: true })
const fs = require('fs');
const path = require('path')
const CryptoJS = require("crypto-js");
@ -28,7 +25,8 @@ let MaxAmountCrepe = 10;
let Supplements = ["nature", "sucre", "nutella", "confiture"];
fastify.addContentTypeParser('application/json', {
parseAs: 'string'
parseAs: 'string',
bodyLimit: 10485760
}, function(req, body, done) {
try {
var json = JSON.parse(body)

View file

@ -300,7 +300,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>
@ -317,7 +317,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>
@ -642,7 +642,7 @@ $('#treasure-popup-button').click((e) => {
var tuid = $('#treasure-popup-uid').val();
if(tuid != '') {
indata.treasureUid = tuid;
}
}
fr.addEventListener('load', () => {
indata.image = fr.result;
@ -652,7 +652,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();
@ -664,7 +664,7 @@ $('#treasure-popup-button').click((e) => {
});
});
fr.readAsDataURL(f);
});
@ -830,7 +830,7 @@ function updateDemandes() {
else
$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'))
@ -845,7 +845,7 @@ function updateDemandes() {
console.error(data.why);
}
}
});
}
}