mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
bfe542b27d
refs #101, #95 - shim controllers that were missed initially
20 lines
557 B
JavaScript
20 lines
557 B
JavaScript
import Controller from 'ember-controller';
|
|
import computed from 'ember-computed';
|
|
|
|
export default Controller.extend({
|
|
|
|
stack: false,
|
|
|
|
code: computed('content.status', function () {
|
|
return this.get('content.status') > 200 ? this.get('content.status') : 500;
|
|
}),
|
|
|
|
message: computed('content.statusText', function () {
|
|
if (this.get('code') === 404) {
|
|
return 'Page not found';
|
|
}
|
|
|
|
return this.get('content.statusText') !== 'error' ? this.get('content.statusText') : 'Internal Server Error';
|
|
})
|
|
});
|