diff --git a/public/views/modals/tx-details.html b/public/views/modals/tx-details.html index 42b765940..d7145f679 100644 --- a/public/views/modals/tx-details.html +++ b/public/views/modals/tx-details.html @@ -1,4 +1,4 @@ - + {{'Close' | translate}} @@ -76,9 +76,9 @@ Created by - {{wallet.credentials.copayerName}} + {{btx.creatorName}} - {{ btx.time * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}} + {{ btx.createdOn * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}} @@ -143,18 +143,25 @@ - Timeline + + Timeline - - - - Participants - - - - - - {{c.copayerName}} ({{'Me'|translate}}) + + + + {{$index + 1}} + + + {{a.description}} + + {{a.by}} + + {{ a.time * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}} + + + + + diff --git a/src/js/controllers/modals/txDetails.js b/src/js/controllers/modals/txDetails.js index 2b79f6e88..2324ac4b9 100644 --- a/src/js/controllers/modals/txDetails.js +++ b/src/js/controllers/modals/txDetails.js @@ -1,29 +1,66 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) { +angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, lodash, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) { var self = $scope.self; var wallet = profileService.getWallet($stateParams.walletId); var config = configService.getSync(); var configWallet = config.wallet; var walletSettings = configWallet.settings; - $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; - $scope.color = wallet.color; - $scope.copayerId = wallet.credentials.copayerId; - $scope.isShared = wallet.credentials.n > 1; + $scope.init = function() { + $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; + $scope.color = wallet.color; + $scope.copayerId = wallet.credentials.copayerId; + $scope.isShared = wallet.credentials.n > 1; - $scope.btx.amountStr = txFormatService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName; - $scope.btx.feeStr = txFormatService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName; - $scope.btx.feeLevel = walletSettings.feeLevel; + $scope.btx.amountStr = txFormatService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName; + $scope.btx.feeStr = txFormatService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName; + $scope.btx.feeLevel = walletSettings.feeLevel; - if ($scope.btx.action != 'invalid') { - if ($scope.btx.action == 'sent') $scope.title = gettextCatalog.getString('Sent Funds'); - if ($scope.btx.action == 'received') $scope.title = gettextCatalog.getString('Received Funds'); - if ($scope.btx.action == 'moved') $scope.title = gettextCatalog.getString('Moved Funds'); - } + if ($scope.btx.action != 'invalid') { + if ($scope.btx.action == 'sent') $scope.title = gettextCatalog.getString('Sent Funds'); + if ($scope.btx.action == 'received') $scope.title = gettextCatalog.getString('Received Funds'); + if ($scope.btx.action == 'moved') $scope.title = gettextCatalog.getString('Moved Funds'); + } + initActionList(); + }; + + function initActionList() { + $scope.actionList = []; + if ($scope.btx.action != 'sent' || !$scope.isShared) return; + + var actionDescriptions = { + created: gettextCatalog.getString('Proposal Created'), + accept: gettextCatalog.getString('Accepted'), + reject: gettextCatalog.getString('Rejected'), + broadcasted: gettextCatalog.getString('Broadcasted'), + }; + + $scope.actionList.push({ + type: 'created', + time: $scope.btx.createdOn, + description: actionDescriptions['created'], + by: $scope.btx.creatorName + }); + + lodash.each($scope.btx.actions, function(action) { + $scope.actionList.push({ + type: action.type, + time: action.createdOn, + description: actionDescriptions[action.type], + by: action.copayerName + }); + }); + + $scope.actionList.push({ + type: 'broadcasted', + time: $scope.btx.time, + description: actionDescriptions['broadcasted'], + }); + }; $scope.showCommentPopup = function() { - popupService.showPrompt(gettextCatalog.getString('Memo'), null, null, function(res) { + popupService.showPrompt(gettextCatalog.getString('Memo'), ' ', {}, function(res) { $log.debug('Saving memo'); var args = { diff --git a/src/js/services/popupService.js b/src/js/services/popupService.js index c22b32041..c8979ca1c 100644 --- a/src/js/services/popupService.js +++ b/src/js/services/popupService.js @@ -32,9 +32,9 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni opts = opts || {}; $ionicPopup.prompt({ title: title, - subTitle: message || ' ', - inputType: opts.inputType || 'text', - inputPlaceholder: opts.inputPlaceholder || '', + subTitle: message, + inputType: opts.inputType, + inputPlaceholder: opts.inputPlaceholder, defaultText: opts.defaultText }).then(function(res) { return cb(res) diff --git a/src/sass/main.scss b/src/sass/main.scss index 28823794d..1fa71938e 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -994,3 +994,4 @@ input[type=number] { @import "views/includes/walletActivity"; @import "views/includes/wallets"; @import "views/includes/modals/modals"; +@import "views/includes/tx-details"; diff --git a/src/sass/views/includes/tx-details.scss b/src/sass/views/includes/tx-details.scss new file mode 100644 index 000000000..5248dcab8 --- /dev/null +++ b/src/sass/views/includes/tx-details.scss @@ -0,0 +1,13 @@ +#tx-details { + .action-created.action-accepted { + color: green; + } + + .action-rejected { + color: red; + } +} + + + +