Ghost/ghost/admin/app/components/gh-nav-menu.js
Kevin Ansfield 755e048f98 Subscribers: Admin UI updates & fixes
Update for synchronous feature service

Add client-side handling of server-side errors when adding subscribers
- display server-provided error message when we get a server error
- fix the ajax util's `getRequestErrorMessage` method so that it works correctly with Ember's `InvalidError` object instead of the previous request object that it was receiving (*TODO:* this really needs looking at properly so we aren't losing details and Ember Data can do it's stuff)

Styling updates
- proper icon for ascending/descending
- change hover colour to green for "Import CSV" button

Delete subscriber button with confirm modal
- display delete button when hovering over a subscriber row (WARN: really ugly button, styles definitely want looking at)
- show confirm modal when clicking the delete button
- delete subscriber, remove from table, and update total on confirm
2016-05-11 11:22:35 +02:00

49 lines
986 B
JavaScript

import Ember from 'ember';
const {
Component,
inject: {service},
computed
} = Ember;
export default Component.extend({
tagName: 'nav',
classNames: ['gh-nav'],
classNameBindings: ['open'],
open: false,
navMenuIcon: computed('ghostPaths.subdir', function () {
let url = `${this.get('ghostPaths.subdir')}/ghost/img/ghosticon.jpg`;
return Ember.String.htmlSafe(`background-image: url(${url})`);
}),
config: service(),
session: service(),
ghostPaths: service(),
feature: service(),
mouseEnter() {
this.sendAction('onMouseEnter');
},
actions: {
toggleAutoNav() {
this.sendAction('toggleMaximise');
},
showMarkdownHelp() {
this.sendAction('showMarkdownHelp');
},
closeMobileMenu() {
this.sendAction('closeMobileMenu');
},
openAutoNav() {
this.sendAction('openAutoNav');
}
}
});