mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
Implement "renamed" posts
Record when the discussion was renamed, from what, and by whom. Information is stored in the `content` field as a serialised JSON object because proper polymorphism will be too difficult with Ember Data and especially when extensions try to add new post types.
This commit is contained in:
@@ -107,7 +107,16 @@ export default Ember.Controller.extend(Ember.Evented, UseComposerMixin, {
|
||||
rename: function(title) {
|
||||
var discussion = this.get('model');
|
||||
discussion.set('title', title);
|
||||
discussion.save();
|
||||
|
||||
// When we save the title, we should get back an 'added post' in the
|
||||
// response which documents the title change. We'll add this to the post
|
||||
// stream.
|
||||
var controller = this;
|
||||
discussion.save().then(function(discussion) {
|
||||
discussion.get('addedPosts').forEach(function(post) {
|
||||
controller.get('stream').addPostToEnd(post);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
delete: function() {
|
||||
|
Reference in New Issue
Block a user