diff --git a/ghost/admin/controllers/settings.js b/ghost/admin/controllers/settings.js index 5db611072a..d3e4277570 100644 --- a/ghost/admin/controllers/settings.js +++ b/ghost/admin/controllers/settings.js @@ -1,5 +1,6 @@ var SettingsController = Ember.Controller.extend({ - showApps: Ember.computed.bool('config.apps') + showApps: Ember.computed.bool('config.apps'), + showTags: Ember.computed.bool('config.tagsUI') }); export default SettingsController; diff --git a/ghost/admin/initializers/ghost-config.js b/ghost/admin/initializers/ghost-config.js index 8c1dd02d01..4f74d54bac 100644 --- a/ghost/admin/initializers/ghost-config.js +++ b/ghost/admin/initializers/ghost-config.js @@ -3,11 +3,12 @@ var ConfigInitializer = { initialize: function (container, application) { var apps = $('body').data('apps'), + tagsUI = $('body').data('tagsui'), fileStorage = $('body').data('filestorage'), blogUrl = $('body').data('blogurl'); application.register( - 'ghost:config', {apps: apps, fileStorage: fileStorage, blogUrl: blogUrl}, {instantiate: false} + 'ghost:config', {apps: apps, fileStorage: fileStorage, blogUrl: blogUrl, tagsUI: tagsUI}, {instantiate: false} ); application.inject('route', 'config', 'ghost:config'); diff --git a/ghost/admin/router.js b/ghost/admin/router.js index 7af7751f73..684650ab10 100644 --- a/ghost/admin/router.js +++ b/ghost/admin/router.js @@ -39,6 +39,7 @@ Router.map(function () { }); this.route('about'); + this.route('tags'); }); this.route('debug'); diff --git a/ghost/admin/routes/settings/tags.js b/ghost/admin/routes/settings/tags.js new file mode 100644 index 0000000000..17e6dc5fa6 --- /dev/null +++ b/ghost/admin/routes/settings/tags.js @@ -0,0 +1,20 @@ +import AuthenticatedRoute from 'ghost/routes/authenticated'; +import CurrentUserSettings from 'ghost/mixins/current-user-settings'; + +var TagsRoute = AuthenticatedRoute.extend(CurrentUserSettings, { + + beforeModel: function () { + if (!this.get('config.tagsUI')) { + return this.transitionTo('settings.general'); + } + + return this.currentUser() + .then(this.transitionAuthor()); + }, + + model: function () { + return this.store.find('tag'); + } +}); + +export default TagsRoute; diff --git a/ghost/admin/templates/settings.hbs b/ghost/admin/templates/settings.hbs index 5928075cdf..631a0ef224 100644 --- a/ghost/admin/templates/settings.hbs +++ b/ghost/admin/templates/settings.hbs @@ -11,6 +11,11 @@ {{gh-activating-list-item route="settings.general" title="General" classNames="settings-nav-general icon-settings"}} {{/unless}} + {{! Whilst tag management is still in development only show tags button if there if tagsUI is true in config.js --}} + {{#if showTags}} + {{gh-activating-list-item route="settings.tags" title="Tags" classNames="settings-nav-tags icon-tag"}} + {{/if}} + {{gh-activating-list-item route="settings.users" title="Users" classNames="settings-nav-users icon-users"}} {{/unless}} diff --git a/ghost/admin/templates/settings/tags.hbs b/ghost/admin/templates/settings/tags.hbs new file mode 100644 index 0000000000..1d9e179074 --- /dev/null +++ b/ghost/admin/templates/settings/tags.hbs @@ -0,0 +1,85 @@ +
+ Back +

Tags

+
+ + + + + +
+
+ +
+ {{#each}} +
+ {{name}} + /{{slug}} +

{{description}}

+ N/A +
+ {{/each}} +
+{{!-- This is the example markup +
+ +
+ News + /news +

The latest news, reviews and information from around the world

+ 20 + +
+ General + /news/general +

My go-to category when I’m not really sure what else to file news

+ 7 +
+
+ +
+ Image + Private +

All posts with the “image” post format

+ 12 +
+ +
+ Kittens + /kittens +

My sordid past and wrongdoings

+ 9 + +
+ A Short History of Nearly Everything + /kittens/a-short-history + 4 + +
+ In Parts + /kittens/a-short-history/in-parts +

Lorem ipsum kittens innit

+ 2 +
+
+
+ +
+ Video + Private +

All posts containing a YouTube video link

+ 6 +
+ +
+ The End + /the-end +

The final frontier

+ 1 +
+ +
+--}} \ No newline at end of file diff --git a/ghost/admin/views/settings/tags.js b/ghost/admin/views/settings/tags.js new file mode 100644 index 0000000000..359d32c56e --- /dev/null +++ b/ghost/admin/views/settings/tags.js @@ -0,0 +1,5 @@ +import BaseView from 'ghost/views/settings/content-base'; + +var SettingsTagsView = BaseView.extend(); + +export default SettingsTagsView;