FIX: remove bookmark from user stream

This commit is contained in:
Régis Hanol 2015-08-05 12:40:43 +02:00
parent aef575aad0
commit b8c8348e5b
5 changed files with 19 additions and 14 deletions

View File

@ -1,7 +1,13 @@
import { actionDescription } from 'discourse/components/small-action';
import { actionDescription } from "discourse/components/small-action";
export default Ember.Component.extend({
classNameBindings: [':item', 'item.hidden', 'item.deleted', 'moderatorAction'],
moderatorAction: Discourse.computed.propertyEqual('item.post_type', 'site.post_types.moderator_action'),
actionDescription: actionDescription('item.action_code', 'item.created_at')
classNameBindings: [":item", "item.hidden", "item.deleted", "moderatorAction"],
moderatorAction: Discourse.computed.propertyEqual("item.post_type", "site.post_types.moderator_action"),
actionDescription: actionDescription("item.action_code", "item.created_at"),
actions: {
removeBookmark(userAction) {
this.sendAction("removeBookmark", userAction);
}
}
});

View File

@ -1,20 +1,20 @@
export default Discourse.Route.extend({
model: function() {
return this.modelFor('user');
model() {
return this.modelFor("user");
},
setupController: function(controller, user) {
this.controllerFor('user-activity').set('model', user);
setupController(controller, user) {
this.controllerFor("user-activity").set("model", user);
// Bring up a draft
const composerController = this.controllerFor('composer');
controller.set('model', user);
const composerController = this.controllerFor("composer");
controller.set("model", user);
if (this.currentUser) {
Discourse.Draft.get('new_private_message').then(function(data) {
Discourse.Draft.get("new_private_message").then(function(data) {
if (data.draft) {
composerController.open({
draft: data.draft,
draftKey: 'new_private_message',
draftKey: "new_private_message",
ignoreIfChanged: true,
draftSequence: data.draft_sequence
});

View File

@ -14,7 +14,6 @@
<p class='excerpt'>{{{item.excerpt}}}</p>
{{#each item.children as |child|}}
<div class='child-actions'>
<i class="icon {{child.icon}}"></i>

View File

@ -1,3 +1,3 @@
{{#each model.content as |item|}}
{{stream-item item=item}}
{{stream-item item=item removeBookmark="removeBookmark"}}
{{/each}}