mirror of
https://github.com/flarum/core.git
synced 2025-10-13 16:05:05 +02:00
* Replace gulp with webpack and npm scripts for JS compilation * Set up Travis CI to commit compiled JS * Restructure `js` directory; only one instance of npm, forum/admin are "submodules" * Refactor JS initializers into Application subclasses * Maintain partial compatibility API (importing from absolute paths) for extensions * Remove minification responsibility from PHP asset compiler * Restructure `less` directory
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
import Modal from '../../common/components/Modal';
|
|
import Button from '../../common/components/Button';
|
|
|
|
/**
|
|
* The `ChangePasswordModal` component shows a modal dialog which allows the
|
|
* user to send themself a password reset email.
|
|
*/
|
|
export default class ChangePasswordModal extends Modal {
|
|
className() {
|
|
return 'ChangePasswordModal Modal--small';
|
|
}
|
|
|
|
title() {
|
|
return app.translator.trans('core.forum.change_password.title');
|
|
}
|
|
|
|
content() {
|
|
return (
|
|
<div className="Modal-body">
|
|
<div className="Form Form--centered">
|
|
<p className="helpText">{app.translator.trans('core.forum.change_password.text')}</p>
|
|
<div className="Form-group">
|
|
{Button.component({
|
|
className: 'Button Button--primary Button--block',
|
|
type: 'submit',
|
|
loading: this.loading,
|
|
children: app.translator.trans('core.forum.change_password.send_button')
|
|
})}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
onsubmit(e) {
|
|
e.preventDefault();
|
|
|
|
this.loading = true;
|
|
|
|
app.request({
|
|
method: 'POST',
|
|
url: app.forum.attribute('apiUrl') + '/forgot',
|
|
data: {email: app.session.user.email()}
|
|
}).then(
|
|
this.hide.bind(this),
|
|
this.loaded.bind(this)
|
|
);
|
|
}
|
|
}
|