FIX: remove bookmark from user stream
This commit is contained in:
parent
aef575aad0
commit
b8c8348e5b
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -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
|
||||||
});
|
});
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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}}
|
||||||
|
|
Loading…
Reference in New Issue