mirror of
https://github.com/flarum/core.git
synced 2025-08-05 07:57:46 +02:00
Show success message after submitting a flag
This commit is contained in:
@@ -5,6 +5,8 @@ export default class FlagPostModal extends Modal {
|
|||||||
init() {
|
init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
|
this.success = false;
|
||||||
|
|
||||||
this.reason = m.prop('');
|
this.reason = m.prop('');
|
||||||
this.reasonDetail = m.prop('');
|
this.reasonDetail = m.prop('');
|
||||||
}
|
}
|
||||||
@@ -18,6 +20,21 @@ export default class FlagPostModal extends Modal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
|
if (this.success) {
|
||||||
|
return (
|
||||||
|
<div className="Modal-body">
|
||||||
|
<div className="Form Form--centered">
|
||||||
|
<p className="helpText">{app.translator.trans('flarum-flags.forum.flag_post.confirmation_message')}</p>
|
||||||
|
<div className="Form-group">
|
||||||
|
<Button className="Button Button--primary Button--block" onclick={this.hide.bind(this)}>
|
||||||
|
{app.translator.trans('flarum-flags.forum.flag_post.dismiss_button')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const guidelinesUrl = app.forum.attribute('guidelinesUrl');
|
const guidelinesUrl = app.forum.attribute('guidelinesUrl');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -81,9 +98,8 @@ export default class FlagPostModal extends Modal {
|
|||||||
user: app.session.user,
|
user: app.session.user,
|
||||||
post: this.props.post
|
post: this.props.post
|
||||||
}
|
}
|
||||||
}).then(
|
})
|
||||||
() => this.hide(),
|
.then(() => this.success = true)
|
||||||
this.loaded.bind(this)
|
.finally(this.loaded.bind(this));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user