diff options
author | Patrick Maia and Victor Shyba <pixelated-team+pmaia+vshyba@thoughtworks.com> | 2014-11-03 17:35:12 -0300 |
---|---|---|
committer | Patrick Maia <pmaia@thoughtworks.com> | 2014-11-03 17:35:12 -0300 |
commit | b1283a90007a85d4d3ac565d484334a77523ca63 (patch) | |
tree | f2e335be9bf40dcc19d650ea1d5e24d9f6e5de25 /web-ui | |
parent | c4d6f25902a28e7a17bb2bb2dce10db90b0ce8c8 (diff) |
Card #30 - shows attachment information on mail visualization
Diffstat (limited to 'web-ui')
-rw-r--r-- | web-ui/app/js/mail_view/ui/mail_view.js | 8 | ||||
-rw-r--r-- | web-ui/app/templates/mails/full_view.hbs | 8 |
2 files changed, 15 insertions, 1 deletions
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 @@ <p>{{ this }}</p> {{/each }} </div> + + {{#if attachments}} + <div class="attachmentsArea column large-12"> + {{#each attachments }} + <a href="/attachment/{{ this.ident }}?encoding={{ this.encoding }}" target="_blank">{{ this.name }}</a> + {{/each }} + </div> + {{/if}} </div> <script> (function () { |