summaryrefslogtreecommitdiff
path: root/web-ui/app
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-08-02 00:05:25 +0200
committerRuben Pollan <meskio@sindominio.net>2017-08-02 00:05:25 +0200
commitc49293b7f3eff7a478fc388768366e7b025f7da0 (patch)
tree00e205a21f9541f5bd4debd57136eee9ecfdfcc8 /web-ui/app
parentccb4f03fe5854793742bed68ee5a83c343899ee1 (diff)
[feat] Display mixnet status on outgoing emails
Diffstat (limited to 'web-ui/app')
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipient.js20
-rw-r--r--web-ui/app/scss/base/_colors.scss3
-rw-r--r--web-ui/app/scss/views/_compose-view.scss29
-rw-r--r--web-ui/app/templates/compose/fixed_recipient.hbs2
4 files changed, 53 insertions, 1 deletions
diff --git a/web-ui/app/js/mail_view/ui/recipients/recipient.js b/web-ui/app/js/mail_view/ui/recipients/recipient.js
index c13a52b1..19866108 100644
--- a/web-ui/app/js/mail_view/ui/recipients/recipient.js
+++ b/web-ui/app/js/mail_view/ui/recipients/recipient.js
@@ -89,6 +89,25 @@ define(
}.bind(this));
};
+ this.discoverMixnet = function () {
+ var p = $.getJSON('/mixnet?search=' + this.attr.address).promise();
+ p.done(function (stat) {
+ switch (stat.status) {
+ case 'ok':
+ this.$node.find('.recipient-mixnet').addClass('mixnet');
+ break;
+ case 'unsuported':
+ this.$node.find('.recipient-mixnet').addClass('unsuported-mixnet');
+ break;
+ default:
+ this.$node.find('.recipient-mixnet').addClass('not-mixnet');
+ }
+ }.bind(this));
+ p.fail(function () {
+ this.$node.find('.recipient-mixnet').addClass('not-mixnet');
+ }.bind(this));
+ };
+
this.getMailAddress = function() {
return this.$node.find('input[type=hidden]').val();
};
@@ -105,6 +124,7 @@ define(
this.sinalizeInvalid();
} else {
this.discoverEncryption();
+ this.discoverMixnet();
}
});
}
diff --git a/web-ui/app/scss/base/_colors.scss b/web-ui/app/scss/base/_colors.scss
index c7807e8f..c23714f1 100644
--- a/web-ui/app/scss/base/_colors.scss
+++ b/web-ui/app/scss/base/_colors.scss
@@ -59,6 +59,9 @@ $will_be_encrypted: $success;
$wont_be_encrypted: $attention;
$recipients_font_color: #828282;
+$will_be_mixed: $success;
+$unsuported_mixed: $light_gray;
+
/* Attachments */
$attachment_text: #555;
$attachment_icon: lighten($attachment_text, 30);
diff --git a/web-ui/app/scss/views/_compose-view.scss b/web-ui/app/scss/views/_compose-view.scss
index 61e785a0..be193186 100644
--- a/web-ui/app/scss/views/_compose-view.scss
+++ b/web-ui/app/scss/views/_compose-view.scss
@@ -344,6 +344,35 @@
background-color: $background_light_grey;
border: 1px solid $border_light_grey;
border-radius: 2px;
+
+ .recipient-mixnet {
+ &:before {
+ font-family: FontAwesome;
+ padding-right: 6px;
+ font-size: 1.4em;
+ }
+
+ &.mixnet {
+ &:before {
+ color: $will_be_mixed;
+ content: "\f135";
+ }
+ }
+
+ &.unsuported-mixnet {
+ &:before {
+ color: $unsuported_mixed;
+ content: "\f135";
+ }
+ }
+
+ &.not-mixnet {
+ &:before {
+ color: $unsuported_mixed;
+ content: "";
+ }
+ }
+ }
}
.recipient-del {
diff --git a/web-ui/app/templates/compose/fixed_recipient.hbs b/web-ui/app/templates/compose/fixed_recipient.hbs
index 8b01717c..59efd7e3 100644
--- a/web-ui/app/templates/compose/fixed_recipient.hbs
+++ b/web-ui/app/templates/compose/fixed_recipient.hbs
@@ -1,7 +1,7 @@
<div class="fixed-recipient">
<span class="recipient-area">
<div class="recipient-value">
- <span>{{ address }}</span> <a class="recipient-del" href="#" data-label="{{t 'click-to-remove'}}"/>
+ <span class="recipient-mixnet"></span><span>{{ address }}</span> <a class="recipient-del" href="#" data-label="{{t 'click-to-remove'}}"/>
</div>
</span>
<input type="hidden" value="{{ address }}" name="{{ name }}" />