diff --git a/app/assets/javascripts/discourse/controllers/raw-email.js.es6 b/app/assets/javascripts/discourse/controllers/raw-email.js.es6 new file mode 100644 index 00000000000..24fa2eb85b4 --- /dev/null +++ b/app/assets/javascripts/discourse/controllers/raw-email.js.es6 @@ -0,0 +1,24 @@ +import ModalFunctionality from 'discourse/mixins/modal-functionality'; + +import ObjectController from 'discourse/controllers/object'; + +/** + This controller handles displaying of raw email + + @class RawEmailController + @extends ObjectController + @namespace Discourse + @uses ModalFunctionality + @module Discourse +**/ +export default ObjectController.extend(ModalFunctionality, { + raw_email: "", + + loadEmail: function(postId) { + var self = this; + Discourse.Post.load(postId).then(function (result) { + self.set("raw_email", result.get('raw_email')); + }); + } + +}); diff --git a/app/assets/javascripts/discourse/routes/topic_route.js b/app/assets/javascripts/discourse/routes/topic_route.js index a02a635bc67..23aab8a89d6 100644 --- a/app/assets/javascripts/discourse/routes/topic_route.js +++ b/app/assets/javascripts/discourse/routes/topic_route.js @@ -73,6 +73,11 @@ Discourse.TopicRoute = Discourse.Route.extend({ this.controllerFor('modal').set('modalClass', 'history-modal'); }, + showRawEmail: function(post) { + Discourse.Route.showModal(this, 'raw-email', post); + this.controllerFor('raw_email').loadEmail(post.get("id")); + }, + mergeTopic: function() { Discourse.Route.showModal(this, 'mergeTopic', this.modelFor('topic')); }, diff --git a/app/assets/javascripts/discourse/templates/modal/raw_email.hbs b/app/assets/javascripts/discourse/templates/modal/raw_email.hbs new file mode 100644 index 00000000000..522602dfa92 --- /dev/null +++ b/app/assets/javascripts/discourse/templates/modal/raw_email.hbs @@ -0,0 +1,7 @@ +
{{raw_email}}
+ {{else}}
+ Not Available!
+ {{/if}}
+