Commit 5d959d7d authored by Floréal Cabanettes's avatar Floréal Cabanettes

Replace alerts by notifications, Fixes #33

parent 08eec11a
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-12 22:25+0100\n"
"PO-Revision-Date: 2017-11-12 22:26+0100\n"
"POT-Creation-Date: 2017-11-12 22:38+0100\n"
"PO-Revision-Date: 2017-11-12 22:37+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
......@@ -28,8 +28,8 @@ msgid ""
">Available for Windows and Linux (click here to install)"
msgstr ""
"Pour ajouter une nouvelle recette, veuillez utiliser le <b>logiciel "
"QRecipeWriter</b> !<br/>Disponible pour Windows et Linux (cliquez ici "
"pour l'installer)"
"QRecipeWriter</b> !<br/>Disponible pour Windows et Linux (cliquez ici pour "
"l'installer)"
#: panel/static/js/panel.recipes.js:60
msgid "Please select an action to do!"
......@@ -38,3 +38,7 @@ msgstr "Veuillez sélectionner une action à effectuer !"
#: panel/static/js/panel.recipes.js:70
msgid "recipes"
msgstr "recettes"
#: panel/static/js/panel.recipes.js:81 panel/static/js/panel.recipes.js:104
msgid "An error has occurred!"
msgstr "Une erreur est survenue !"
......@@ -4,7 +4,7 @@ panel.init = function(csrftoken) {
panel.csrftoken = csrftoken;
};
panel.notify = function(message, delay=5000, type="info", url=null) {
panel.notify = function(message, type="info", delay=5000, url=null) {
$.notify({
message: message,
url: url,
......@@ -20,5 +20,7 @@ panel.notify = function(message, delay=5000, type="info", url=null) {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
},
offset: 55,
newest_on_top: true,
})
};
\ No newline at end of file
......@@ -41,7 +41,7 @@ panel.recipes.init_events = function () {
});
$("input.add-new-recipe").click(function() {
panel.notify(django.gettext("To add a new recipe, please use the <b>QRecipeWriter software</b>!<br/>Available for Windows and Linux (click here to install)"),
0, "info", "https://gite.flo-art.fr/cooking/qrecipewriter");
"info", 0, "https://gite.flo-art.fr/cooking/qrecipewriter");
})
};
......@@ -57,7 +57,7 @@ panel.recipes.check_all = function (check) {
panel.recipes.submit_grouped_actions = function (action, selected=[]) {
if (action === 0) {
alert(django.gettext("Please select an action to do!"))
panel.notify(django.gettext("Please select an action to do!"), "warning", 1000)
}
else {
// Get selected recipes:
......@@ -78,7 +78,7 @@ panel.recipes.submit_grouped_actions = function (action, selected=[]) {
location.reload();
}
else {
alert("message" in data ? data["message"] : "An error has occurred!")
panel.notify("message" in data ? data["message"] : django.gettext("An error has occurred!"), "error")
}
})
}
......@@ -101,7 +101,7 @@ panel.recipes.empty_trash = function () {
window.location.href = "/panel/recipes/"
}
else {
alert("message" in data ? data["message"] : "An error has occurred!")
panel.notify("message" in data ? data["message"] : django.gettext("An error has occurred!"), "error")
}
});
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment