From 1d4c7621c4961dd9f3eaad5532882477b3de91f7 Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Wed, 29 Apr 2015 16:28:59 -0700 Subject: [PATCH] UI-1354: Add better explanation to faxbox feature --- i18n/en-US.json | 31 ++++++++++++------- i18n/fr-FR.json | 29 ++++++++++------- submodules/users/users.css | 29 ++++++++++++----- submodules/users/users.js | 39 +++++++++++++++++++---- views/users-feature-faxing.html | 55 ++++++++++++++++----------------- 5 files changed, 116 insertions(+), 67 deletions(-) diff --git a/i18n/en-US.json b/i18n/en-US.json index 561b4a6..bee5098 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -513,19 +513,26 @@ "faxing": { "title": "Faxbox", "headline": "Faxbox", - "text": "This user will receive faxes at {{variable}} as an attachment.", - "helpOne": "For users running Windows, here is a link to the ", - "helpTwo": "Cloud Printer Installer", - "form": { - "label": { - "callerId": "Faxbox number", - "linkToPrinter": "Link to printer", - "smtpEmailAddress": "SMTP email address" - } + "__comment": "UI-1354: Add better explanation to faxbox feature", + "__version": "v3.20_s4", + "faxToEmail": { + "title": "Fax to Email", + "text1": "Faxes to", + "text2": "will be converted to email and sent to" }, - "defaultSettings": { - "nameExtension": "'s Faxbox", - "headerExtension": " Fax Printer" + "emailToFax": { + "title": "Email to Fax", + "text1": "Emails sent from", + "text2": "to", + "text3": "with a pdf will fax the number in the 'to' address.", + "default": "- Select a number -" + }, + + "googlePrinter": { + "title": "Google Printer", + "text1": "Click ", + "text2": " to activate the Google Cloud Printer. Get the printer installer from ", + "link": "here" } }, "vm_to_email": { diff --git a/i18n/fr-FR.json b/i18n/fr-FR.json index f8309ae..f68ab7f 100644 --- a/i18n/fr-FR.json +++ b/i18n/fr-FR.json @@ -483,19 +483,24 @@ "faxing": { "title": "Faxbox", "headline": "Faxbox", - "text": "Cet utilisateur recevra les fax à l'adresse mail {{variable}} sous la forme d'une pièce jointe.", - "helpOne": "Pour les utilisateurs sur Windows, voici un lien pour ", - "helpTwo": "l'installeur de l'imprimante en ligne", - "form": { - "label": { - "callerId": "Numéro de Faxbox", - "linkToPrinter": "Lien de l'imprimante", - "smtpEmailAddress": "Adresse email SMTP" - } + "faxToEmail": { + "title": "Fax to Email", + "text1": "Les fax envoyés à", + "text2": "seront convertis en email et transférés à l'adresse" + }, + "emailToFax": { + "title": "Email to Fax", + "text1": "Les emails envoyés depuis", + "text2": "à", + "text3": " avec un pdf seront faxés au numéro spécifié dans le champ 'destinataire' de l'email.", + "default": "- Sélectionner un numéro -" }, - "defaultSettings": { - "nameExtension": "'s Faxbox", - "headerExtension": " Fax Printer" + + "googlePrinter": { + "title": "Google Imprimante", + "text1": "Cliquez ", + "text2": " pour activer l'imprimante Google Cloud. Récupérez l'intalleur de l'imprimante ", + "link": "ici" } }, "vm_to_email": { diff --git a/submodules/users/users.css b/submodules/users/users.css index 01acd04..39a8a3a 100644 --- a/submodules/users/users.css +++ b/submodules/users/users.css @@ -751,22 +751,35 @@ width: 220px; } -.feature-popup-container[data-feature="faxing"] { +/* Faxing Feature Popup */ +.feature-popup-container[data-feature='faxing'] { overflow: hidden; } -.feature-popup-container[data-feature="faxing"] #faxbox_form { +.feature-popup-container[data-feature='faxing'] #faxbox_form { margin-bottom: 0; } -.feature-popup-container[data-feature="faxing"] #printer_link, -.feature-popup-container[data-feature="faxing"] .controls span.text { - margin-left: 10px; - line-height: 30px; +.feature-popup-container[data-feature='faxing'] #faxbox_form a { + color: #22a5ff; + text-decoration: underline; } -.feature-popup-container[data-feature="faxing"] #fax_timezone_chosen { - margin-left: 10px; +.feature-popup-container[data-feature='faxing'] #faxbox_form a:hover { + text-decoration: none; +} + +.feature-popup-container[data-feature='faxing'] #faxbox_form p { + line-height: 40px; +} + +.feature-popup-container[data-feature='faxing'] #faxbox_form strong { + color: #22a5ff; +} + +.feature-popup-container[data-feature='faxing'] #faxbox_form .number-selector { + display: inline-block; + margin: 0 10px; } /* Change Password Popup */ diff --git a/submodules/users/users.js b/submodules/users/users.js index 35ad294..57a3cd6 100644 --- a/submodules/users/users.js +++ b/submodules/users/users.js @@ -1291,6 +1291,17 @@ define(function(require){ callback && callback(null, existingCallflow); } }); + }, + account: function(callback) { + self.callApi({ + resource: 'account.get', + data: { + accountId: self.accountId + }, + success: function(data, status) { + callback(null, data.data); + } + }); } }, function(err, results) { @@ -1578,6 +1589,7 @@ define(function(require){ var self = this, data = self.usersFormatFaxingData(data), featureTemplate = $(monster.template(self, 'users-feature-faxing', data)), + numberMirror = featureTemplate.find('.number-mirror'), switchFeature = featureTemplate.find('.switch-state'); if ( !_.isEmpty(data.extra.listNumbers) ) { @@ -1592,7 +1604,16 @@ define(function(require){ monster.pub('common.numberSelector.render', { container: featureTemplate.find('.number-select'), inputName: 'caller_id', - number: data.hasOwnProperty('faxbox') ? data.faxbox.caller_id : undefined + number: data.hasOwnProperty('faxbox') ? data.faxbox.caller_id : undefined, + removeCallback: function () { + numberMirror.text(self.i18n.active().users.faxing.emailToFax.default); + }, + spareCallback: function (number) { + numberMirror.text(number); + }, + buyCallback: function (number) { + numberMirror.text(number); + } }); featureTemplate.find('.cancel-link').on('click', function() { @@ -1612,12 +1633,18 @@ define(function(require){ } }; - if ( switchFeature.prop('checked') && newNumber ) { - self.usersUpdateFaxing(data, newNumber, function(results) { - args.userId = results.callflow.owner_id; + if ( switchFeature.prop('checked')) { + if (newNumber !== '') { + console.log('not empty'); + // self.usersUpdateFaxing(data, newNumber, function(results) { + // args.userId = results.callflow.owner_id; - self.usersRender(args); - }); + // self.usersRender(args); + // }); + } + else { + console.log('is empty'); + } } else { self.usersDeleteFaxing(data.user.id, function() { args.userId = data.user.id; diff --git a/views/users-feature-faxing.html b/views/users-feature-faxing.html index dbe283e..0402c5b 100644 --- a/views/users-feature-faxing.html +++ b/views/users-feature-faxing.html @@ -12,37 +12,34 @@
- {{#if faxbox}} -

{{replaceVar i18n.users.faxing.text this.faxbox.notifications.inbound.email.send_to}}

- {{else}} -

{{replaceVar i18n.users.faxing.text this.user.email }}

- {{/if}}
-
- -
-
- {{#compare faxbox.cloud_state '===' 'registered'}} -
- - -
- {{/compare}} - {{#if faxbox.smtp_email_address}} -
- -
- {{faxbox.smtp_email_address}} -
-
- {{/if}} +
+ {{i18n.users.faxing.faxToEmail.title}} +

+ {{i18n.users.faxing.faxToEmail.text1}} + + {{i18n.users.faxing.faxToEmail.text2}} {{user.email}}. +

+
+
+ {{i18n.users.faxing.emailToFax.title}} +

+ {{i18n.users.faxing.emailToFax.text1}} {{user.email}} {{i18n.users.faxing.emailToFax.text2}} + {{#if faxbox.caller_id}}{{faxbox.caller_id}}{{else}}{{i18n.users.faxing.emailToFax.default}}{{/if}}@{{account.realm}} {{i18n.users.faxing.emailToFax.text3}} +

+
+
+ {{#compare faxbox.cloud_state '===' 'registered'}} + {{i18n.users.faxing.googlePrinter.title}} +

+ {{i18n.users.faxing.googlePrinter.text1}} + {{i18n.users.faxing.googlePrinter.link}} + {{i18n.users.faxing.googlePrinter.text2}} + {{i18n.users.faxing.googlePrinter.link}}. +

+ {{/compare}} +
- - {{#monsterText}} -

{{ i18n.users.faxing.helpOne }}{{ i18n.users.faxing.helpTwo }}

- {{/monsterText}}