This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/static.js.es6
2016-07-11 12:57:05 -04:00

26 lines
635 B
JavaScript

import { ajax } from 'discourse/lib/ajax';
import computed from 'ember-addons/ember-computed-decorators';
export default Ember.Controller.extend({
needs: ['application'],
showLoginButton: Em.computed.equal("model.path", "login"),
@computed("model.path")
showSignupButton() {
return this.get("model.path") === "login" && this.get('controllers.application.canSignUp');
},
actions: {
markFaqRead() {
const currentUser = this.currentUser;
if (currentUser) {
ajax("/users/read-faq", { method: "POST" }).then(() => {
currentUser.set('read_faq', true);
});
}
}
}
});