From b1283a90007a85d4d3ac565d484334a77523ca63 Mon Sep 17 00:00:00 2001 From: Patrick Maia and Victor Shyba Date: Mon, 3 Nov 2014 17:35:12 -0300 Subject: Card #30 - shows attachment information on mail visualization --- web-ui/app/js/mail_view/ui/mail_view.js | 8 +++++++- web-ui/app/templates/mails/full_view.hbs | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/web-ui/app/js/mail_view/ui/mail_view.js b/web-ui/app/js/mail_view/ui/mail_view.js index fbf5c6ed..214b85d8 100644 --- a/web-ui/app/js/mail_view/ui/mail_view.js +++ b/web-ui/app/js/mail_view/ui/mail_view.js @@ -64,6 +64,10 @@ define( encrypted = this.checkEncrypted(data.mail); } + var attachments = _.map(data.mail.attachments, function(a){ + return { 'encoding': a.headers['Content-Transfer-Encoding'], 'name': a.name, 'ident': a.ident }; + }); + this.$node.html(templates.mails.fullView({ header: data.mail.header, body: [], @@ -72,7 +76,8 @@ define( tags: data.mail.tags, encryptionStatus: encrypted, signatureStatus: signed, - features: features + features: features, + attachments: attachments })); this.$node.find('.bodyArea').html(viewHelpers.formatMailBody(data.mail)); @@ -197,6 +202,7 @@ define( this.trigger(events.mail.want, {mail: this.attr.ident, caller: this}); }; + this.after('initialize', function () { this.on(this, events.mail.here, this.displayMail); this.on(this, events.mail.notFound, this.openNoMessageSelectedPane); diff --git a/web-ui/app/templates/mails/full_view.hbs b/web-ui/app/templates/mails/full_view.hbs index b28e8086..820d2ed0 100644 --- a/web-ui/app/templates/mails/full_view.hbs +++ b/web-ui/app/templates/mails/full_view.hbs @@ -68,6 +68,14 @@

{{ this }}

{{/each }} + + {{#if attachments}} +
+ {{#each attachments }} + {{ this.name }} + {{/each }} +
+ {{/if}}