diff options
author | Giovane <giovaneliberato@gmail.com> | 2016-01-25 16:25:26 -0200 |
---|---|---|
committer | Giovane <giovaneliberato@gmail.com> | 2016-01-25 16:25:26 -0200 |
commit | 685760ed085d3144511b4a56e2b23dadc6e62c1c (patch) | |
tree | d70848501d2780a42e63ef0302b5cc459339b242 | |
parent | 48eea2554803fa18f745d0e9234d950b3da5dbcf (diff) |
Enable attachments on inline compose #579
- Extracts the attachents list template to a partial
- Enable attachments on reply, reply all and forward
-rw-r--r-- | web-ui/app/js/mixins/with_compose_inline.js | 1 | ||||
-rw-r--r-- | web-ui/app/js/views/templates.js | 4 | ||||
-rw-r--r-- | web-ui/app/templates/compose/compose_box.hbs | 27 | ||||
-rw-r--r-- | web-ui/app/templates/compose/inline_box.hbs | 3 |
4 files changed, 8 insertions, 27 deletions
diff --git a/web-ui/app/js/mixins/with_compose_inline.js b/web-ui/app/js/mixins/with_compose_inline.js index b39201ae..83a1a1fb 100644 --- a/web-ui/app/js/mixins/with_compose_inline.js +++ b/web-ui/app/js/mixins/with_compose_inline.js @@ -48,6 +48,7 @@ define( .cc(this.attr.recipientValues.cc) .bcc(this.attr.recipientValues.bcc) .body(this.select('bodyBox').val()) + .attachment(this.attr.attachments) .tag(tag); }; diff --git a/web-ui/app/js/views/templates.js b/web-ui/app/js/views/templates.js index e3b8d1f2..d0a1ccde 100644 --- a/web-ui/app/js/views/templates.js +++ b/web-ui/app/js/views/templates.js @@ -26,7 +26,8 @@ define(['hbs/templates'], function (templates) { recipientInput: window.Pixelated['app/templates/compose/recipient_input.hbs'], fixedRecipient: window.Pixelated['app/templates/compose/fixed_recipient.hbs'], recipients: window.Pixelated['app/templates/compose/recipients.hbs'], - feedback: window.Pixelated['app/templates/compose/feedback_box.hbs'] + feedback: window.Pixelated['app/templates/compose/feedback_box.hbs'], + attachmentsList: window.Pixelated['app/templates/compose/attachments_list.hbs'] }, tags: { tagList: window.Pixelated['app/templates/tags/tag_list.hbs'], @@ -71,6 +72,7 @@ define(['hbs/templates'], function (templates) { Handlebars.registerPartial('tag_inner', Templates.tags.tagInner); Handlebars.registerPartial('recipients', Templates.compose.recipients); + Handlebars.registerPartial('attachments_list', Templates.compose.attachmentsList); return Templates; }); diff --git a/web-ui/app/templates/compose/compose_box.hbs b/web-ui/app/templates/compose/compose_box.hbs index 06cc099a..78447ec2 100644 --- a/web-ui/app/templates/compose/compose_box.hbs +++ b/web-ui/app/templates/compose/compose_box.hbs @@ -19,32 +19,7 @@ <textarea class="floatlabel" name="body" id="text-box" placeholder="{{t 'Body'}}" tabindex="5">{{body}}</textarea> </div> -<div id="attachment-list" class="buttons-group columns"> - <span class="btn btn-success fileinput-button"> - <!-- The file input field used as target for the file upload widget --> - <input id="fileupload" type="file" name="attachment"> - </span> - <!-- The global progress bar --> - <div id="progress" class="progress"> - <div class="progress-bar progress-bar-success"></div> - </div> - - <!-- The container for the uploaded files --> - <div class="attachmentsAreaWrap {{#unless attachments}}hide{{/unless}}"> - <div class="attachmentsArea column large-12"> - <ul id="attachment-list-item"> - {{#each attachments }} - <li> - <a href="/attachment/{{ this.ident }}?encoding={{ this.encoding }}&filename={{ this.name }}">{{ this.name }} <span class="attachment-size">({{ formatSize this.size}})</span> - <i class="fa fa-arrow-down download-icon"></i></a> - </li> - {{/each }} - </ul> - </div> - </div> - - <br> -</div> +{{> attachments_list }} <div class="buttons-group columns"> <button id="send-button" tabindex="6"><i class="fa fa-send"></i></button> diff --git a/web-ui/app/templates/compose/inline_box.hbs b/web-ui/app/templates/compose/inline_box.hbs index 21ab7603..59dc67bc 100644 --- a/web-ui/app/templates/compose/inline_box.hbs +++ b/web-ui/app/templates/compose/inline_box.hbs @@ -10,8 +10,11 @@ {{> recipients }} +{{> attachments_list }} + <div class="buttons-group columns"> <button id="send-button" tabindex=6><i class="fa fa-send"></i></button> + <span id="attachment-button" tabindex="6"></span> <button id="trash-button" tabindex=7>{{t 'trash-button'}}<i class="fa fa-trash-o"></i></button> <div id="draft-save-status"></div> </div> |