mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 23:54:25 +08:00
29 lines
753 B
JavaScript
29 lines
753 B
JavaScript
import { ajax } from 'discourse/lib/ajax';
|
|
import computed from 'ember-addons/ember-computed-decorators';
|
|
import { userPath } from 'discourse/lib/url';
|
|
|
|
export default Ember.Controller.extend({
|
|
application: Ember.inject.controller(),
|
|
|
|
showLoginButton: Em.computed.equal("model.path", "login"),
|
|
|
|
@computed('model.path')
|
|
bodyClass: path => `static-${path}`,
|
|
|
|
@computed("model.path")
|
|
showSignupButton() {
|
|
return this.get("model.path") === "login" && this.get('application.canSignUp');
|
|
},
|
|
|
|
actions: {
|
|
markFaqRead() {
|
|
const currentUser = this.currentUser;
|
|
if (currentUser) {
|
|
ajax(userPath("read-faq"), { method: "POST" }).then(() => {
|
|
currentUser.set('read_faq', true);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
});
|