summaryrefslogtreecommitdiff
path: root/web-ui/app
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/app')
-rw-r--r--web-ui/app/js/mail_list/ui/mail_item_factory.js21
-rw-r--r--web-ui/app/js/views/templates.js1
-rw-r--r--web-ui/app/templates/mails/draft.hbs32
3 files changed, 36 insertions, 18 deletions
diff --git a/web-ui/app/js/mail_list/ui/mail_item_factory.js b/web-ui/app/js/mail_list/ui/mail_item_factory.js
index 88638c9d..87a883b0 100644
--- a/web-ui/app/js/mail_list/ui/mail_item_factory.js
+++ b/web-ui/app/js/mail_list/ui/mail_item_factory.js
@@ -30,7 +30,7 @@ define(
};
var TEMPLATE_TYPE = {
- 'drafts': 'sent',
+ 'drafts': 'draft',
'sent': 'sent'
};
@@ -38,32 +38,17 @@ define(
var mailItemContainer = $('<li>', { id: 'mail-' + mail.ident});
nodeToAttachTo.append(mailItemContainer);
- var mailToCreate;
- if(currentTag === 'all'){
- mailToCreate = detectMailType(mail);
- } else {
- mailToCreate = MAIL_ITEM_TYPE[currentTag] || GenericMailItem;
- }
+ var mailToCreate = MAIL_ITEM_TYPE[mail.mailbox] || GenericMailItem;
mailToCreate.attachTo(mailItemContainer, {
mail: mail,
selected: mail.ident === currentMailIdent,
tag: currentTag,
isChecked: isChecked,
- templateType: TEMPLATE_TYPE[currentTag] || 'single'
+ templateType: TEMPLATE_TYPE[mail.mailbox] || 'single'
});
};
- var detectMailType = function(mail) {
- if (mail.isDraftMail()) {
- return MAIL_ITEM_TYPE.drafts;
- } else if (mail.isSentMail()) {
- return MAIL_ITEM_TYPE.sent;
- } else {
- return GenericMailItem;
- }
- };
-
return {
createAndAttach: createAndAttach
};
diff --git a/web-ui/app/js/views/templates.js b/web-ui/app/js/views/templates.js
index 874e691d..470c6e51 100644
--- a/web-ui/app/js/views/templates.js
+++ b/web-ui/app/js/views/templates.js
@@ -40,6 +40,7 @@ define(['hbs/templates'], function (templates) {
single: window.Pixelated['app/templates/mails/single.hbs'],
fullView: window.Pixelated['app/templates/mails/full_view.hbs'],
mailActions: window.Pixelated['app/templates/mails/mail_actions.hbs'],
+ draft: window.Pixelated['app/templates/mails/draft.hbs'],
sent: window.Pixelated['app/templates/mails/sent.hbs']
},
mailActions: {
diff --git a/web-ui/app/templates/mails/draft.hbs b/web-ui/app/templates/mails/draft.hbs
new file mode 100644
index 00000000..87862f34
--- /dev/null
+++ b/web-ui/app/templates/mails/draft.hbs
@@ -0,0 +1,32 @@
+<span>
+ <input type="checkbox"/>
+</span>
+<span>
+ <a href="/#/{{ tag }}/mail/{{ ident }}">
+ <span class="sent-date">{{ header.formattedDate }}</span>
+
+ <div class="from">
+ {{t 'to:'}}
+ {{#if header.to }}
+ {{ header.to }}
+ {{else}}
+ {{t 'no_recipient'}}
+ {{/if}}
+ </div>
+ <div class="subject-and-tags">
+ <i class="fa fa-pencil"></i>
+ {{#if header.subject }}
+ {{header.subject}}
+ {{else}}
+ {{t 'no_subject'}}
+ {{/if}}
+ </div>
+ <div class="subject-and-tags">
+ <ul class="tags">
+ {{#each tagsForListView }}
+ <li class="tag" data-tag="{{this}}">{{ this }}</li>
+ {{/each }}
+ </ul>
+ </div>
+ </a>
+</span>