mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 04:09:20 +00:00
Made the option "contact admin" lives
This commit is contained in:
parent
91f8edd2de
commit
bde2b5dde6
18
assets/css/pages/passwordForgotten/mailAdmin.css
Normal file
18
assets/css/pages/passwordForgotten/mailAdmin.css
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Mail admin to reset password
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
.reset-password-by-mail-step .title {
|
||||
text-align: center;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.reset-password-by-mail-step p {
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.reset-password-by-mail-step .btn-mail {
|
||||
width: 100%;
|
||||
}
|
@ -1299,6 +1299,13 @@ var ComunicWeb = {
|
||||
//TODO : implement
|
||||
},
|
||||
|
||||
/**
|
||||
* Option : send a mail to the admin
|
||||
*/
|
||||
mailAdmin: {
|
||||
//TODO : implement
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
47
assets/js/pages/passwordForgotten/mailAdmin.js
Normal file
47
assets/js/pages/passwordForgotten/mailAdmin.js
Normal file
@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Send a mail to the administration option
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.pages.passwordForgotten.mailAdmin = {
|
||||
|
||||
/**
|
||||
* Send a mail to admin
|
||||
*
|
||||
* @param {String} email The email address of the user
|
||||
* @param {HTMLElement} target The target for the form
|
||||
*/
|
||||
open: function(email, target){
|
||||
|
||||
//Create container
|
||||
var container = createElem2({
|
||||
appendTo: target,
|
||||
type: "div",
|
||||
class: "reset-password-by-mail-step"
|
||||
});
|
||||
|
||||
//Add title
|
||||
createElem2({
|
||||
appendTo: container,
|
||||
type: "h1",
|
||||
class: "title",
|
||||
innerHTML: "Email us"
|
||||
});
|
||||
|
||||
//Message
|
||||
add_p(container, "You decided to reset your password by contacting us. " +
|
||||
"Please find a way to prove us your identity in your mail, and if possible, send " +
|
||||
"your email from your account email address.");
|
||||
|
||||
//Add admin email address
|
||||
createElem2({
|
||||
appendTo: container,
|
||||
type: "a",
|
||||
class: "btn btn-default btn-mail",
|
||||
innerHTML: "contact@communiquons.org",
|
||||
href: "mailto:contact@communiquons.org"
|
||||
});
|
||||
},
|
||||
|
||||
}
|
@ -70,8 +70,21 @@ ComunicWeb.pages.passwordForgotten.main = {
|
||||
//Prompt user reset option
|
||||
ComunicWeb.pages.passwordForgotten.promptOption.open(email, boxBody, function(option){
|
||||
|
||||
alert(option);
|
||||
//Empty body
|
||||
emptyElem(boxBody);
|
||||
|
||||
//Open appropriate page
|
||||
if(option == "mail"){
|
||||
ComunicWeb.pages.passwordForgotten.mailAdmin.open(email, boxBody);
|
||||
}
|
||||
|
||||
//Option not recognized
|
||||
else {
|
||||
boxBody.appendChild(ComunicWeb.common.messages.createCalloutElem(
|
||||
"Error",
|
||||
"Option not found!",
|
||||
"danger"));
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -82,7 +82,10 @@ ComunicWeb.pages.passwordForgotten.promptOption = {
|
||||
appendTo: form,
|
||||
type: "div",
|
||||
class: "btn btn-default",
|
||||
innerHTML: "<i class='fa fa-envelope-o'></i> Contact the administration"
|
||||
innerHTML: "<i class='fa fa-envelope-o'></i> Send a mail to the administration"
|
||||
});
|
||||
contact.addEventListener("click", function(){
|
||||
callback("mail");
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -228,7 +228,8 @@ class Dev {
|
||||
|
||||
//Password forgotten page
|
||||
"css/pages/passwordForgotten/main.css",
|
||||
"css/pages/passwordForgotten/promptOption.css"
|
||||
"css/pages/passwordForgotten/promptOption.css",
|
||||
"css/pages/passwordForgotten/mailAdmin.css"
|
||||
);
|
||||
|
||||
/**
|
||||
@ -416,6 +417,7 @@ class Dev {
|
||||
"js/pages/passwordForgotten/main.js",
|
||||
"js/pages/passwordForgotten/promptEmail.js",
|
||||
"js/pages/passwordForgotten/promptOption.js",
|
||||
"js/pages/passwordForgotten/mailAdmin.js",
|
||||
|
||||
//Logout page
|
||||
"js/pages/logout.js",
|
||||
|
Loading…
Reference in New Issue
Block a user