mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Implements page class toggling.
- Toggles page class when post is marked as static/non-static
This commit is contained in:
parent
a7daeecbf2
commit
6deb206e84
3 changed files with 8 additions and 3 deletions
|
@ -11,7 +11,7 @@ var PostController = Ember.ObjectController.extend({
|
||||||
|
|
||||||
this.get('model').save().then(function () {
|
this.get('model').save().then(function () {
|
||||||
self.notifications.showSuccess('Post successfully marked as ' + (featured ? 'featured' : 'not featured') + '.');
|
self.notifications.showSuccess('Post successfully marked as ' + (featured ? 'featured' : 'not featured') + '.');
|
||||||
}, function() {
|
}, function () {
|
||||||
self.notifications.showError('An error occured while saving the post.');
|
self.notifications.showError('An error occured while saving the post.');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
{{#view "content-list-content-view" tagName="section"}}
|
{{#view "content-list-content-view" tagName="section"}}
|
||||||
<ol class="posts-list">
|
<ol class="posts-list">
|
||||||
{{#each itemController="posts/post" itemView="post-item-view" itemTagName="li"}}
|
{{#each itemController="posts/post" itemView="post-item-view" itemTagName="li"}}
|
||||||
{{!-- @TODO: Restore functionality where 'featured' and 'page' classes are added for proper posts --}}
|
|
||||||
{{#link-to "posts.post" this class="permalink" title="Edit this post"}}
|
{{#link-to "posts.post" this class="permalink" title="Edit this post"}}
|
||||||
<h3 class="entry-title">{{title}}</h3>
|
<h3 class="entry-title">{{title}}</h3>
|
||||||
<section class="entry-meta">
|
<section class="entry-meta">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import itemView from 'ghost/views/item-view';
|
import itemView from 'ghost/views/item-view';
|
||||||
|
|
||||||
var PostItemView = itemView.extend({
|
var PostItemView = itemView.extend({
|
||||||
classNameBindings: ['isFeatured'],
|
classNameBindings: ['isFeatured', 'isPage'],
|
||||||
|
|
||||||
isFeatured: function () {
|
isFeatured: function () {
|
||||||
if (this.get('controller.model.featured')) {
|
if (this.get('controller.model.featured')) {
|
||||||
|
@ -9,6 +9,12 @@ var PostItemView = itemView.extend({
|
||||||
}
|
}
|
||||||
}.property('controller.model.featured'),
|
}.property('controller.model.featured'),
|
||||||
|
|
||||||
|
isPage: function () {
|
||||||
|
if (this.get('controller.model.page')) {
|
||||||
|
return 'page';
|
||||||
|
}
|
||||||
|
}.property('controller.model.page'),
|
||||||
|
|
||||||
openEditor: function () {
|
openEditor: function () {
|
||||||
this.get('controller').send('openEditor', this.get('controller.model')); // send action to handle transition to editor route
|
this.get('controller').send('openEditor', this.get('controller.model')); // send action to handle transition to editor route
|
||||||
}.on('doubleClick')
|
}.on('doubleClick')
|
||||||
|
|
Loading…
Add table
Reference in a new issue