summaryrefslogtreecommitdiff
path: root/web-ui/app
diff options
context:
space:
mode:
authorPatrick Maia <patrickjourdanmaia@gmail.com>2014-08-08 15:19:09 -0300
committerPatrick Maia <patrickjourdanmaia@gmail.com>2014-08-08 15:19:09 -0300
commit6da512032af12aa58793741ba5bb4485a346ff10 (patch)
tree5ed8edbc6483e51589026d96e32e84e8db8449db /web-ui/app
parent08e622c79a1f128fbafe7a5b2c8001bed18b0c4f (diff)
adds signatureStatus, encryptionStatus, tags feature toggles
Diffstat (limited to 'web-ui/app')
-rw-r--r--web-ui/app/js/mail_view/ui/mail_view.js15
-rw-r--r--web-ui/app/js/services/mail_service.js9
-rw-r--r--web-ui/app/js/tags/data/tags.js4
-rw-r--r--web-ui/app/templates/mails/full_view.hbs4
4 files changed, 23 insertions, 9 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 9114fa2e..33eb71d9 100644
--- a/web-ui/app/js/mail_view/ui/mail_view.js
+++ b/web-ui/app/js/mail_view/ui/mail_view.js
@@ -61,8 +61,12 @@ define(
data.mail.header.formattedDate = viewHelpers.getFormattedDate(date);
data.mail.security_casing = data.mail.security_casing || {};
- var signed = this.checkSigned(data.mail);
- var encrypted = this.checkEncrypted(data.mail);
+ if(features.isEnabled('signatureStatus')) {
+ var signed = this.checkSigned(data.mail);
+ }
+ if(features.isEnabled('encryptionStatus')) {
+ var encrypted = this.checkEncrypted(data.mail);
+ }
this.$node.html(templates.mails.fullView({
header: data.mail.header,
@@ -71,7 +75,8 @@ define(
ident: data.mail.ident,
tags: data.mail.tags,
encryptionStatus: encrypted,
- signatureStatus: signed
+ signatureStatus: signed,
+ features: features
}));
this.$node.find('.bodyArea').html(viewHelpers.formatMailBody(data.mail));
@@ -79,7 +84,9 @@ define(
this.trigger(document, events.search.highlightResults, {where: '.subjectArea'});
this.trigger(document, events.search.highlightResults, {where: '.msg-header .recipients'});
- this.attachTagCompletion();
+ if(features.isEnabled('tags')) {
+ this.attachTagCompletion();
+ }
this.select('tags').on('click', function (event) {
this.removeTag($(event.target).data('tag'));
diff --git a/web-ui/app/js/services/mail_service.js b/web-ui/app/js/services/mail_service.js
index 86642f37..b23d569a 100644
--- a/web-ui/app/js/services/mail_service.js
+++ b/web-ui/app/js/services/mail_service.js
@@ -6,8 +6,9 @@ define(
'flight/lib/component',
'views/i18n',
'services/model/mail',
- 'page/events'
- ], function (defineComponent, i18n, Mail, events) {
+ 'page/events',
+ 'features'
+ ], function (defineComponent, i18n, Mail, events, features) {
'use strict';
@@ -238,7 +239,9 @@ define(
this.on(events.mail.want, this.fetchSingle);
this.on(document, events.mail.read, this.readMail);
this.on(document, events.mail.unread, this.unreadMail);
- this.on(document, events.mail.tags.update, this.updateTags);
+ if(features.isEnabled('tags')) {
+ this.on(document, events.mail.tags.update, this.updateTags);
+ }
this.on(document, events.mail.delete, this.deleteMail);
this.on(document, events.mail.deleteMany, this.deleteManyMails);
this.on(document, events.search.perform, this.newSearch);
diff --git a/web-ui/app/js/tags/data/tags.js b/web-ui/app/js/tags/data/tags.js
index 96f08b99..dba5c26f 100644
--- a/web-ui/app/js/tags/data/tags.js
+++ b/web-ui/app/js/tags/data/tags.js
@@ -1,7 +1,7 @@
-define(['flight/lib/component', 'page/events'], function (defineComponent, events) {
+define(['flight/lib/component', 'page/events', 'mixins/with_feature_toggle'], function (defineComponent, events, withFeatureToggle) {
'use strict';
- var DataTags = defineComponent(dataTags);
+ var DataTags = defineComponent(dataTags, withFeatureToggle('tags'));
DataTags.all = {
name: 'all',
diff --git a/web-ui/app/templates/mails/full_view.hbs b/web-ui/app/templates/mails/full_view.hbs
index a466308d..c674291c 100644
--- a/web-ui/app/templates/mails/full_view.hbs
+++ b/web-ui/app/templates/mails/full_view.hbs
@@ -11,12 +11,16 @@
<div style="display:inline-block;padding-top: 5px;width:95%;flex-shrink:1" >
<div class="column large-10 no-padding security-status">
+ {{#if signatureStatus}}
<span class="{{signatureStatus}}">
{{t signatureStatus }}
</span>
+ {{/if}}
+ {{#if encryptionStatus}}
<span class="{{encryptionStatus}}">
{{t encryptionStatus }}
</span>
+ {{/if}}
</div>
<div class="column large-2 no-padding text-right">
<span class="received-date">{{ header.formattedDate }}</span>