Permalink
Browse files

[FEATURE] KYC: Added top banner when profile is not filled out

  • Loading branch information...
1 parent 99c1216 commit df7bd98627241cc1064f5fd1123947acdc8dad13 @kevinejohn kevinejohn committed Jun 20, 2014
Showing with 46 additions and 5 deletions.
  1. +7 −1 src/jade/client/index.jade
  2. +1 −1 src/jade/tabs/account.jade
  3. +3 −1 src/js/config-example.js
  4. +35 −2 src/js/controllers/app.js
@@ -39,6 +39,12 @@ div#wrapper
h1(ng-show="$route.current.tabClass == 't-register'", l10n) Welcome to {{productName}}
!= require("./navbar.jade")()
.container
+ .alert.alert-warning(ng-show="numberOfDaysLeftKyc", l10n) In
+ strong(l10n)  {{numberOfDaysLeftKyc}}, 
+ | you will need a
+ a.alert-link(href="", ng-click="completeKycProfile()", l10n)  complete profile 
+ | to use all Ripple Trade features. Profile information is stored encrypted, and is not viewable by anybody other than yourself
+
// Main
.row.main(role="main", id="{{$route.current.tabClass}}", ng-view)
@@ -95,4 +101,4 @@ div#wrapper
.col-sm-6
a(href="#/lang/ja") 日本の
.col-sm-6
- a(href="#/lang/tr") Türkçe
+ a(href="#/lang/tr") Türkçe
@@ -82,7 +82,7 @@ section.col-xs-12.content(ng-controller="AccountCtrl")
input.form-control(
name='name', id="name", type='text'
ng-model='profile.name'
- required)
+ )
.row
.col-xs-9.col-sm-8.col-md-4
button.btn.btn-block.btn-primary.submit(type='submit', l10n) Update name
View
@@ -55,7 +55,9 @@ var Options = {
b2rAddress: 'rhxULAn1xW9T4V2u67FX9pQjSz4Tay2zjZ',
// Number of ledgers ahead of the current ledger index where a tx is valid
- tx_last_ledger: 3
+ tx_last_ledger: 3,
+
+ kyc_profile_deadline: 'July 19, 2014'
};
// Load client-side overrides
View
@@ -12,9 +12,9 @@ var util = require('util'),
var module = angular.module('app', []);
module.controller('AppCtrl', ['$rootScope', '$compile', 'rpId', 'rpNetwork',
- 'rpKeychain', 'rpTxQueue', 'rpAppManager',
+ 'rpKeychain', 'rpTxQueue', 'rpAppManager', '$location',
function ($scope, $compile, $id, $net,
- keychain, txQueue, appManager)
+ keychain, txQueue, appManager, $location)
{
reset();
@@ -607,6 +607,39 @@ module.controller('AppCtrl', ['$rootScope', '$compile', 'rpId', 'rpNetwork',
$id.init();
appManager.init();
+
+
+ // Start of KYC code
+ $scope.$watch('userBlob', function() {
+ var blob = $scope.userBlob;
+ if (Options.kyc_profile_deadline && // Only check if the deadline is set
+ blob && typeof(blob.identity) !== 'undefined') {
+ var key = blob.key;
+
+ var profile = blob.identity.getAll(key);
+
+ if (profile.name &&
+ profile.name.value.length > 0) {
+ $scope.numberOfDaysLeftKyc = undefined;
+ }
+ else {
+ var end = new Date(Options.kyc_profile_deadline);
+ var now = new Date();
+ var diff = end - now;
+ var days = Math.round(diff / (24 * 60 * 60 * 1000));
+ var str = days > 1 ? days + ' days': days + ' day';
+ $scope.numberOfDaysLeftKyc = str;
+ }
+ }
+ }, true);
+ $scope.completeKycProfile = function() {
+ $scope.redirectURL = $location.url();
+ $location.path('/kyc');
+ }
+ // End of KYC code
+
+
+
/**
* Testing hooks
*/

0 comments on commit df7bd98

Please sign in to comment.