diff --git a/app/assets/javascripts/discourse/controllers/queued-posts.js.es6 b/app/assets/javascripts/discourse/controllers/queued-posts.js.es6 new file mode 100644 index 00000000000..a597c2cb40b --- /dev/null +++ b/app/assets/javascripts/discourse/controllers/queued-posts.js.es6 @@ -0,0 +1,16 @@ +export default Ember.Controller.extend({ + + actions: { + approve(post) { + post.update({ state: 'approved' }).then(() => { + this.get('model').removeObject(post); + }); + }, + + reject(post) { + post.update({ state: 'rejected' }).then(() => { + this.get('model').removeObject(post); + }); + } + } +}); diff --git a/app/assets/javascripts/discourse/helpers/cook-text.js.es6 b/app/assets/javascripts/discourse/helpers/cook-text.js.es6 new file mode 100644 index 00000000000..c7acadce1b1 --- /dev/null +++ b/app/assets/javascripts/discourse/helpers/cook-text.js.es6 @@ -0,0 +1,6 @@ +import registerUnbound from 'discourse/helpers/register-unbound'; + +registerUnbound('cook-text', function(text) { + return new Handlebars.SafeString(Discourse.Markdown.cook(text)); +}); + diff --git a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 index b866d99a278..922183aebea 100644 --- a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 +++ b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 @@ -93,4 +93,6 @@ export default function() { this.resource('badges', function() { this.route('show', {path: '/:id/:slug'}); }); + + this.resource('queued-posts', { path: '/queued-posts' }); } diff --git a/app/assets/javascripts/discourse/routes/queued-posts.js.es6 b/app/assets/javascripts/discourse/routes/queued-posts.js.es6 new file mode 100644 index 00000000000..58b28dd8fa8 --- /dev/null +++ b/app/assets/javascripts/discourse/routes/queued-posts.js.es6 @@ -0,0 +1,8 @@ +import DiscourseRoute from 'discourse/routes/discourse'; + +export default DiscourseRoute.extend({ + model() { + return this.store.find('queuedPost', {status: 'new'}); + } +}); + diff --git a/app/assets/javascripts/discourse/templates/queued-posts.hbs b/app/assets/javascripts/discourse/templates/queued-posts.hbs new file mode 100644 index 00000000000..2119de912b0 --- /dev/null +++ b/app/assets/javascripts/discourse/templates/queued-posts.hbs @@ -0,0 +1,30 @@ +
{{i18n "queue.none"}}
+ {{/each}} +