Merge pull request #4273 from cobbspur/tags

Create Tags Management Stubs for Ember
This commit is contained in:
Matt Enlow 2014-11-04 10:30:00 -07:00
commit f14e8138e2
7 changed files with 120 additions and 2 deletions

View File

@ -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;

View File

@ -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');

View File

@ -39,6 +39,7 @@ Router.map(function () {
});
this.route('about');
this.route('tags');
});
this.route('debug');

View File

@ -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;

View File

@ -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}}

View File

@ -0,0 +1,85 @@
<header class="settings-view-header">
<a class="btn btn-default btn-back active" href="/ghost/settings/">Back</a>
<h2 class="page-title">Tags</h2>
<section class="page-actions">
<button type="button" class="btn btn-green">New Tag</button>
<span class="tags-search">
<button href="#" class="btn btn-default">
<i class="icon-search"></i>
<span class="hidden">Search Tags</span>
</button>
<input type="text" class="tags-search-input">
</span>
</section>
</header>
<section class="content settings-tags">
{{#each}}
<div class="settings-tag">
<a href="#" class="tag-title">{{name}}</a>
<span class="label label-default">/{{slug}}</span>
<p class="tag-description">{{description}}</p>
<span class="tags-count">N/A</span>
</div>
{{/each}}
</section>
{{!-- This is the example markup
<section class="content settings-tags">
<div class="settings-tag">
<a href="#" class="tag-title">News</a>
<span class="label label-default">/news</span>
<p class="tag-description">The latest news, reviews and information from around the world</p>
<span class="tags-count">20</span>
<div class="settings-tag">
<a href="#" class="tag-title">General</a>
<span class="label label-default">/news/general</span>
<p class="tag-description">My go-to category when Im not really sure what else to file news</p>
<span class="tags-count">7</span>
</div>
</div>
<div class="settings-tag">
<a href="#" class="tag-title">Image</a>
<span class="label label-alt">Private</span>
<p class="tag-description">All posts with the “image” post format</p>
<span class="tags-count">12</span>
</div>
<div class="settings-tag">
<a href="#" class="tag-title">Kittens</a>
<span class="label label-default">/kittens</span>
<p class="tag-description">My sordid past and wrongdoings</p>
<span class="tags-count">9</span>
<div class="settings-tag">
<a href="#" class="tag-title">A Short History of Nearly Everything</a>
<span class="label label-default">/kittens/a-short-history</span>
<span class="tags-count">4</span>
<div class="settings-tag">
<a href="#" class="tag-title">In Parts</a>
<span class="label label-default">/kittens/a-short-history/in-parts</span>
<p class="tag-description">Lorem ipsum kittens innit</p>
<span class="tags-count">2</span>
</div>
</div>
</div>
<div class="settings-tag">
<a href="#" class="tag-title">Video</a>
<span class="label label-default">Private</span>
<p class="tag-description">All posts containing a YouTube video link</p>
<span class="tags-count">6</span>
</div>
<div class="settings-tag">
<a href="#" class="tag-title">The End</a>
<span class="label label-default">/the-end</span>
<p class="tag-description">The final frontier</p>
<span class="tags-count">1</span>
</div>
</section>
--}}

View File

@ -0,0 +1,5 @@
import BaseView from 'ghost/views/settings/content-base';
var SettingsTagsView = BaseView.extend();
export default SettingsTagsView;