-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4c3f78
commit d13136d
Showing
19 changed files
with
12,539 additions
and
1,586 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Radio from "backbone.radio"; | ||
import RODAN_EVENTS from "js/Shared/RODAN_EVENTS"; | ||
import ViewResetPassword from "js/Views/Master/Main/User/Individual/ViewResetPassword"; | ||
import AppRouter from "marionette.approuter"; | ||
|
||
const Router = AppRouter.extend({ | ||
controller: { | ||
resetPassword(uid, token) { | ||
const options = { uid, token }; | ||
const view = new ViewResetPassword(options); | ||
Radio.channel("rodan").request(RODAN_EVENTS.REQUEST__MODAL_HIDE); | ||
Radio.channel("rodan").request(RODAN_EVENTS.REQUEST__MODAL_SHOW, { title: "Reset Password", content: view }); | ||
} | ||
}, | ||
|
||
appRoutes: { | ||
"password-reset/:uid/:token": "resetPassword" | ||
} | ||
}); | ||
|
||
export default Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
rodan-client/code/src/js/Views/Master/Main/Login/ViewForgotPassword.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Marionette from "backbone.marionette"; | ||
import Radio from "backbone.radio"; | ||
import $ from "jquery"; | ||
import RODAN_EVENTS from "js/Shared/RODAN_EVENTS"; | ||
import _ from "underscore"; | ||
|
||
/** | ||
* Forgot password view. | ||
*/ | ||
export default class ViewForgotPassword extends Marionette.View { | ||
/////////////////////////////////////////////////////////////////////////////////////// | ||
// PRIVATE METHODS | ||
/////////////////////////////////////////////////////////////////////////////////////// | ||
/** | ||
* Handle save button. | ||
*/ | ||
_handleButtonSubmit() { | ||
Radio.channel("rodan").request(RODAN_EVENTS.REQUEST__USER_RESET_PASSWORD, { email: this.ui.textEmail.val() }); | ||
} | ||
} | ||
ViewForgotPassword.prototype.modelEvents = { | ||
"all": "render" | ||
}; | ||
ViewForgotPassword.prototype.ui = { | ||
buttonSubmit: "#button-request_password_reset", | ||
textEmail: "#text-email", | ||
textMessage: "#text-message", | ||
}; | ||
ViewForgotPassword.prototype.events = { | ||
"click @ui.buttonSubmit": "_handleButtonSubmit" | ||
}; | ||
ViewForgotPassword.prototype.template = _.template($("#template-main_forgot-password").text()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
rodan-client/code/src/js/Views/Master/Main/User/Individual/ViewResetPassword.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Marionette from "backbone.marionette"; | ||
import Radio from "backbone.radio"; | ||
import $ from "jquery"; | ||
import RODAN_EVENTS from "js/Shared/RODAN_EVENTS"; | ||
import _ from "underscore"; | ||
|
||
/** | ||
* Password reset view. | ||
*/ | ||
export default class ViewResetPassword extends Marionette.View { | ||
initialize(options) { | ||
this._uid = options.uid; | ||
this._token = options.token; | ||
} | ||
/////////////////////////////////////////////////////////////////////////////////////// | ||
// PRIVATE METHODS | ||
/////////////////////////////////////////////////////////////////////////////////////// | ||
/** | ||
* Handle submit button. | ||
*/ | ||
_handleButtonSubmit() { | ||
var passwordError = this._checkPassword(); | ||
if (passwordError) { | ||
this.ui.textMessage.text(passwordError); | ||
} | ||
else { | ||
Radio.channel("rodan").request(RODAN_EVENTS.REQUEST__USER_RESET_PASSWORD_CONFIRM, { uid: this._uid, token: this._token, new_password: this.ui.textPassword.val() }); | ||
} | ||
} | ||
|
||
/** | ||
* Checks password fields. Will provide error text if passwords no good, else null. | ||
*/ | ||
_checkPassword() { | ||
var password = this.ui.textPassword.val(); | ||
var confirm = this.ui.textPasswordConfirm.val(); | ||
if (!password) { | ||
return "Your password cannot be empty. Come on, you must have done this before."; | ||
} | ||
else if (password !== confirm) { | ||
return "Passwords do not match."; | ||
} | ||
return null; | ||
} | ||
} | ||
ViewResetPassword.prototype.modelEvents = { | ||
"all": "render" | ||
}; | ||
ViewResetPassword.prototype.ui = { | ||
buttonSubmit: "#button-reset_password", | ||
textPassword: "#text-password", | ||
textPasswordConfirm: "#text-password_confirm", | ||
textMessage: "#text-message", | ||
}; | ||
ViewResetPassword.prototype.events = { | ||
"click @ui.buttonSubmit": "_handleButtonSubmit" | ||
}; | ||
ViewResetPassword.prototype.template = _.template($("#template-main_user_reset-password").text()); |
10 changes: 10 additions & 0 deletions
10
rodan-client/code/templates/Views/Master/Main/Login/template-main_forgot-password.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="fixed_individual"> | ||
<label for="text-email">Email:</label> | ||
<input type="email" class="form-control input-sm" id="text-email" value="" name="text-email"> | ||
<span id="text-message" class="text-danger"></span> | ||
<br> | ||
<br> | ||
<div class="btn-group" role="group"> | ||
<button class="btn btn-xs btn-warning" id="button-request_password_reset">Submit</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...t/code/templates/Views/Master/Main/User/Individual/template-main_user_reset-password.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="fixed_individual"> | ||
<label for="text-password">Password:</label> | ||
<input type="password" class="form-control input-sm" id="text-password" value="" name="text-password"> | ||
<label for="text-password_confirm">Confirm password:</label> | ||
<input type="password" class="form-control input-sm" id="text-password_confirm" value="" name="text-password_confirm"> | ||
<span id="text-message" class="text-danger"></span> | ||
<br> | ||
<br> | ||
<div class="btn-group" role="group"> | ||
<button class="btn btn-xs btn-warning" id="button-reset_password">Submit</button> | ||
</div> | ||
</div> |
Oops, something went wrong.