1
0
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:
Toby Zerner
2015-02-13 10:23:38 +10:30
parent fa3523ac74
commit 011ae3603e
19 changed files with 225 additions and 90 deletions

View File

@@ -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() {