diff --git a/static/css/main.css b/static/css/main.css
index 24a922d..e4b96c8 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -74,7 +74,7 @@ a:hover {
background-size: cover;
background-position: right;
- transition: 1.5s transform 0s ease-out;
+ transition: 1s transform 0s ease-out;
}
#logo {
diff --git a/static/index.html b/static/index.html
index d819b93..a76c561 100644
--- a/static/index.html
+++ b/static/index.html
@@ -66,7 +66,7 @@
Demandes
-
Ici vous pouvez demandez à un espion aguerri de faire une mission pour vous comme commander des crêpes. Aussi, vous pouvez tentez de valider la chasse au trésor du jour !
+
Ici vous pouvez demandez à un espion aguerri de vous livrer des crêpes. Aussi, vous pouvez tentez de valider la chasse au trésor du jour !
Pour cela il suffit d'envoyer une photo du ticket avec l'endroit où vous l'avez trouvé.
diff --git a/static/js/main.js b/static/js/main.js
index 1e8ba42..b7a3b2f 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -83,7 +83,17 @@ $("#register-button").click(function (e) {
user: $("#register-user").val(),
password: $("#register-password").val()
});
+ if( $("#register-password-confirm").val() != $("#register-password").val()) {
+ t = new TypeIt('#error-message-register', {
+ speed: 110,
+ lifeLike: true
+ })
+ .type("Oups, les 2 mots de passe ne correspondent pas !")
+ .go();
+ return;
+ }
$("#register-password").val('');
+ $("#register-password-confirm").val("");
$.ajax({
type: "POST",
url: base_url + "register",
@@ -222,7 +232,7 @@ function get_admin(type) {
}
$("#admin-content").append(`
- Nombre totale de mission achevées: ${doneCnt}
+ Nombre totale de missions achevées: ${doneCnt}
`);
break;
@@ -626,63 +636,65 @@ $('#demande-button').click(function () {
});
function updateDemandes() {
- $.ajax({
- type: "POST",
- url: base_url + "get",
- data: JSON.stringify({
- uid: localStorage.getItem('user'),
- token: localStorage.getItem('token'),
- type: "prank"
+ if(localStorage.getItem('user') && localStorage.getItem('token')) {
+ $.ajax({
+ type: "POST",
+ url: base_url + "get",
+ data: JSON.stringify({
+ uid: localStorage.getItem('user'),
+ token: localStorage.getItem('token'),
+ type: "prank"
- }),
- contentType: "application/json; charset=utf-8",
- dataType: "json",
+ }),
+ contentType: "application/json; charset=utf-8",
+ dataType: "json",
- success: function (data) {
- if(data.success) {
- $('#demande-list').html('');
- let pd = [];
- for (pd_uid in data.prankData) {
- if (data.prankData[pd_uid].creator == localStorage.getItem('user')) {
- data.prankData[pd_uid].prankUid = pd_uid;
- pd.push(data.prankData[pd_uid]);
+ success: function (data) {
+ if(data.success) {
+ $('#demande-list').html('');
+ let pd = [];
+ for (pd_uid in data.prankData) {
+ if (data.prankData[pd_uid].creator == localStorage.getItem('user')) {
+ data.prankData[pd_uid].prankUid = pd_uid;
+ pd.push(data.prankData[pd_uid]);
+ }
+ }
+ pd.sort((a, b) => new Date(b.date) - new Date(a.date));
+ for(const pd_uid in pd) {
+ $('#demande-list').append(`
+
+ Demande de crêpe
+ Quantité: ${pd[pd_uid].amount}
+ Garniture: ${pd[pd_uid].supplement}
+ Livraison: ${pd[pd_uid].where}
+ Notes: ${pd[pd_uid].note}
+ Statue: ${pd[pd_uid].state}
+
+ ${ (pd[pd_uid].state != "Accepted" && pd[pd_uid].state != "Refused" ) ?
+ `
+ Annuler
+ `
+ : ''
+ }
+
+ `)
+ }
+ refreshListener();
+ }
+ else {
+ if (data.why == "Not authentificated") {
+ show_page('#login-page');
+ } else {
+ alert(data.why);
}
}
- pd.sort((a, b) => new Date(b.date) - new Date(a.date));
- for(const pd_uid in pd) {
- $('#demande-list').append(`
-
- Demande de crêpe
- Quantité: ${pd[pd_uid].amount}
- Garniture: ${pd[pd_uid].supplement}
- Livraison: ${pd[pd_uid].where}
- Notes: ${pd[pd_uid].note}
- Statue: ${pd[pd_uid].state}
-
- ${ (pd[pd_uid].state != "Accepted" && pd[pd_uid].state != "Refused" ) ?
- `
- Annuler
- `
- : ''
- }
-
- `)
- }
- refreshListener();
}
- else {
- if (data.why == "Not authentificated") {
- show_page('#login-page');
- } else {
- alert(data.why);
- }
- }
- }
- });
+ });
+ }
}
function updateNextActivity() {
@@ -748,7 +760,6 @@ $(window).on("load", function() {
}
updateNextActivity();
- updateDemandes();
/* load timer */
window.setInterval(function() {
@@ -779,7 +790,7 @@ $(window).on("load", function() {
days = 0;
updateNextActivity();
}
- $('#timer').text(days + " jours " +(new Date('December 17, 1995 ' + t.join(':'))).toLocaleTimeString('default', {
+ $('#timer').text( (days == 0 ? "" : days + " jours ") + (new Date('December 17, 1995 ' + t.join(':'))).toLocaleTimeString('default', {
hour: '2-digit',
minute: '2-digit',
second: '2-digit'