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({ export default Ember.Component.extend({
classNameBindings: [':item', 'item.hidden', 'item.deleted', 'moderatorAction'], classNameBindings: [":item", "item.hidden", "item.deleted", "moderatorAction"],
moderatorAction: Discourse.computed.propertyEqual('item.post_type', 'site.post_types.moderator_action'), moderatorAction: Discourse.computed.propertyEqual("item.post_type", "site.post_types.moderator_action"),
actionDescription: actionDescription('item.action_code', 'item.created_at') 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({ export default Discourse.Route.extend({
model: function() { model() {
return this.modelFor('user'); return this.modelFor("user");
}, },
setupController: function(controller, user) { setupController(controller, user) {
this.controllerFor('user-activity').set('model', user); this.controllerFor("user-activity").set("model", user);
// Bring up a draft // Bring up a draft
const composerController = this.controllerFor('composer'); const composerController = this.controllerFor("composer");
controller.set('model', user); controller.set("model", user);
if (this.currentUser) { if (this.currentUser) {
Discourse.Draft.get('new_private_message').then(function(data) { Discourse.Draft.get("new_private_message").then(function(data) {
if (data.draft) { if (data.draft) {
composerController.open({ composerController.open({
draft: data.draft, draft: data.draft,
draftKey: 'new_private_message', draftKey: "new_private_message",
ignoreIfChanged: true, ignoreIfChanged: true,
draftSequence: data.draft_sequence draftSequence: data.draft_sequence
}); });

View File

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

View File

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