support timeline
This commit is contained in:
parent
26f4f42ec3
commit
f44d8a6e77
5 changed files with 90 additions and 32 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
<ion-modal-view ng-controller="txDetailsController">
|
<ion-modal-view ng-controller="txDetailsController" ng-init="init()" id="tx-details">
|
||||||
<ion-header-bar align-title="center" class="bar-royal" ng-style="{'background-color':color}">
|
<ion-header-bar align-title="center" class="bar-royal" ng-style="{'background-color':color}">
|
||||||
<button class="button button-clear" ng-click="cancel()">
|
<button class="button button-clear" ng-click="cancel()">
|
||||||
{{'Close' | translate}}
|
{{'Close' | translate}}
|
||||||
|
|
@ -76,9 +76,9 @@
|
||||||
|
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div translate>Created by</div>
|
<div translate>Created by</div>
|
||||||
<span>{{wallet.credentials.copayerName}}</span>
|
<span>{{btx.creatorName}}</span>
|
||||||
<span class="item-note">
|
<span class="item-note">
|
||||||
<time>{{ btx.time * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}}</time>
|
<time>{{ btx.createdOn * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}}</time>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -143,18 +143,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item item-divider" ng-show="btx.action == 'sent'" translate>Timeline</div>
|
<div ng-if="actionList[0]">
|
||||||
|
<div class="item item-divider" translate>Timeline</div>
|
||||||
|
|
||||||
</div>
|
<div class="item" ng-class="{'action-created' : a.type == 'created' || a.type == 'accept', 'action-rejected' : a.type == 'reject'}" ng-repeat="a in actionList track by $index">
|
||||||
|
<div class="row">
|
||||||
<div class="list" ng-if="btx.actions[0] && isShared">
|
<div class="col col-10">
|
||||||
<div class="item item-divider" translate>Participants</div>
|
<span id="timeline-icon">{{$index + 1}}</span>
|
||||||
<div class="item" ng-repeat="c in btx.actions">
|
</div>
|
||||||
<span class="item-note">
|
<div class="col">
|
||||||
<i ng-if="c.type == 'reject'" class="fi-x icon-sign x db"></i>
|
<div>{{a.description}}</div>
|
||||||
<i ng-if="c.type == 'accept'" class="fi-check icon-sign check db"></i>
|
<div>
|
||||||
</span>
|
<span>{{a.by}}</span>
|
||||||
{{c.copayerName}} <span ng-if="c.copayerId == copayerId">({{'Me'|translate}})</span>
|
<span class="item-note">
|
||||||
|
<time>{{ a.time * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}}</time>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,66 @@
|
||||||
'use strict';
|
'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 self = $scope.self;
|
||||||
var wallet = profileService.getWallet($stateParams.walletId);
|
var wallet = profileService.getWallet($stateParams.walletId);
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
var configWallet = config.wallet;
|
var configWallet = config.wallet;
|
||||||
var walletSettings = configWallet.settings;
|
var walletSettings = configWallet.settings;
|
||||||
|
|
||||||
$scope.alternativeIsoCode = walletSettings.alternativeIsoCode;
|
$scope.init = function() {
|
||||||
$scope.color = wallet.color;
|
$scope.alternativeIsoCode = walletSettings.alternativeIsoCode;
|
||||||
$scope.copayerId = wallet.credentials.copayerId;
|
$scope.color = wallet.color;
|
||||||
$scope.isShared = wallet.credentials.n > 1;
|
$scope.copayerId = wallet.credentials.copayerId;
|
||||||
|
$scope.isShared = wallet.credentials.n > 1;
|
||||||
|
|
||||||
$scope.btx.amountStr = txFormatService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName;
|
$scope.btx.amountStr = txFormatService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName;
|
||||||
$scope.btx.feeStr = txFormatService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName;
|
$scope.btx.feeStr = txFormatService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName;
|
||||||
$scope.btx.feeLevel = walletSettings.feeLevel;
|
$scope.btx.feeLevel = walletSettings.feeLevel;
|
||||||
|
|
||||||
if ($scope.btx.action != 'invalid') {
|
if ($scope.btx.action != 'invalid') {
|
||||||
if ($scope.btx.action == 'sent') $scope.title = gettextCatalog.getString('Sent Funds');
|
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 == 'received') $scope.title = gettextCatalog.getString('Received Funds');
|
||||||
if ($scope.btx.action == 'moved') $scope.title = gettextCatalog.getString('Moved 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() {
|
$scope.showCommentPopup = function() {
|
||||||
popupService.showPrompt(gettextCatalog.getString('Memo'), null, null, function(res) {
|
popupService.showPrompt(gettextCatalog.getString('Memo'), ' ', {}, function(res) {
|
||||||
$log.debug('Saving memo');
|
$log.debug('Saving memo');
|
||||||
|
|
||||||
var args = {
|
var args = {
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
$ionicPopup.prompt({
|
$ionicPopup.prompt({
|
||||||
title: title,
|
title: title,
|
||||||
subTitle: message || ' ',
|
subTitle: message,
|
||||||
inputType: opts.inputType || 'text',
|
inputType: opts.inputType,
|
||||||
inputPlaceholder: opts.inputPlaceholder || '',
|
inputPlaceholder: opts.inputPlaceholder,
|
||||||
defaultText: opts.defaultText
|
defaultText: opts.defaultText
|
||||||
}).then(function(res) {
|
}).then(function(res) {
|
||||||
return cb(res)
|
return cb(res)
|
||||||
|
|
|
||||||
|
|
@ -994,3 +994,4 @@ input[type=number] {
|
||||||
@import "views/includes/walletActivity";
|
@import "views/includes/walletActivity";
|
||||||
@import "views/includes/wallets";
|
@import "views/includes/wallets";
|
||||||
@import "views/includes/modals/modals";
|
@import "views/includes/modals/modals";
|
||||||
|
@import "views/includes/tx-details";
|
||||||
|
|
|
||||||
13
src/sass/views/includes/tx-details.scss
Normal file
13
src/sass/views/includes/tx-details.scss
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#tx-details {
|
||||||
|
.action-created.action-accepted {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-rejected {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue