Commit 7efcadcf authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[enh] In block search, add a button to show TX

[enh] Movement search: add column amount. display time and bloc
parent 1bb11545
Pipeline #9580 failed
......@@ -220,6 +220,7 @@
"HEADER_BLOCK": "Block #",
"HEADER_ISSUER": "Peer owner",
"BTN_LAST": "Last blocks",
"BTN_TX": "Transactions",
"DISPLAY_QUERY": "View query",
"HIDE_QUERY": "Hide query",
"TX_SEARCH_FILTER": {
......@@ -438,6 +439,7 @@
"HEADER_TIME": "Time/Hour",
"HEADER_ISSUER": "Issuer",
"HEADER_RECIPIENT": "Recipient",
"HEADER_AMOUNT": "Amount",
"READ": "Read",
"BTN_REMOVE": "Delete this document",
"BTN_COMPACT": "Compact",
......
......@@ -220,6 +220,7 @@
"HEADER_BLOCK": "Block #",
"HEADER_ISSUER": "Peer owner",
"BTN_LAST": "Last blocks",
"BTN_TX": "Transactions",
"DISPLAY_QUERY": "View query",
"HIDE_QUERY": "Hide query",
"TX_SEARCH_FILTER": {
......@@ -438,6 +439,7 @@
"HEADER_TIME": "Time/Hour",
"HEADER_ISSUER": "Issuer",
"HEADER_RECIPIENT": "Recipient",
"HEADER_AMOUNT": "Amount",
"READ": "Read",
"BTN_REMOVE": "Delete this document",
"BTN_COMPACT": "Compact",
......
......@@ -54,6 +54,7 @@
"HEADER_TIME": "Fecha/Hora",
"HEADER_ISSUER": "Emisor",
"HEADER_RECIPIENT": "Destinatario",
"HEADER_AMOUNT": "Importe",
"READ": "Leído",
"BTN_REMOVE": "Sumprimer este documento",
"POPOVER_ACTIONS": {
......
......@@ -220,6 +220,7 @@
"HEADER_BLOCK": "Bloc #",
"HEADER_ISSUER": "Noeud émetteur",
"BTN_LAST": "Derniers blocs",
"BTN_TX": "Transactions",
"DISPLAY_QUERY": "Afficher la requête",
"HIDE_QUERY": "Masquer la requête",
"TX_SEARCH_FILTER": {
......@@ -491,6 +492,7 @@
"HEADER_TIME": "Date/Heure",
"HEADER_ISSUER": "Emetteur",
"HEADER_RECIPIENT": "Destinataire",
"HEADER_AMOUNT": "Montant",
"READ": "Lu",
"BTN_REMOVE": "Supprimer ce document",
"BTN_COMPACT": "Compacter",
......
......@@ -46,7 +46,10 @@ function ESDocumentLookupController($scope, $ionicPopover, $location, $timeout,
$scope.defaultSizeLimit = $scope.defaultSizeLimit || (UIUtils.screen.isSmall() ? 50 : 100);
$scope.helptipPrefix = 'helptip-document';
$scope.compactMode = angular.isDefined($scope.compactMode) ? $scope.compactMode : true;
$scope._source = $scope._source || ["issuer", "hash", "time", "creationTime", "title", "message"];
$scope._source = $scope._source || ["issuer", "hash", "time", "creationTime", "title", "message", "recipient",
// Movement field:
"medianTime", "amount", "currency", "reference"
];
$scope.showHeaders = angular.isDefined($scope.showHeaders) ? $scope.showHeaders : true;
/**
......@@ -394,6 +397,7 @@ function ESLastDocumentsController($scope, $controller, $timeout, $state, $filte
}
options._source = options._source || $scope._source;
options.getTimeFunction = function(doc) {
doc.time = doc.creationTime || doc.time;
return doc.time;
......
......@@ -66,6 +66,7 @@ angular.module('cesium.es.document.services', ['ngResource', 'cesium.platform',
function _readSearchHits(res, options) {
options.issuerField = options.issuerField || 'pubkey';
console.log("TODO: ", res);
var hits = (res && res.hits && res.hits.hits || []).reduce(function(res, hit) {
var doc = hit._source || {};
doc.docType = doc.type; // Save source.type, before replacement
......
......@@ -66,13 +66,18 @@
</div>
<div class=" pull-right hidden-xs hidden-sm">
<a ng-if="enableFilter"
class="button button-text button-small ink icon ion-card"
ui-sref="app.document_search({index: currency, type: 'movement', q: search.text })">
{{'BLOCKCHAIN.LOOKUP.BTN_TX' | translate}}
</a>
<a ng-if="enableFilter"
class="button button-text button-small ink icon ion-clock"
ng-class="{'button-text-positive': search.type=='last'}"
ng-click="doSearchLast()">
{{'BLOCKCHAIN.LOOKUP.BTN_LAST' | translate}}
</a>
<!--<a class="button button-text button-small ink icon icon-help" ng-click="showHelpModal('join-salt')">
{{'BLOCKCHAIN.LOOKUP.HELP' | translate}}
</a>-->
......
<ion-item id="doc-{{::doc.id}}"
class="item item-document item-icon-left ink {{::ionItemClass}} no-padding-top no-padding-bottom"
ng-click="selectDocument($event, doc)">
<i class="icon ion-document stable" ng-if=":rebind:!doc.avatar"></i>
<i class="avatar" ng-if=":rebind:doc.avatar" style="background-image: url('{{:rebind:doc.avatar.src}}')"></i>
<div class="row no-padding">
<div class="col">
<h3 class="dark">
{{:rebind:doc.medianTime|formatDate}}</h3>
<h4 class="gray" ng-if="doc.reference">
<span translate>COMMON.BLOCK</span> #{{doc.reference.id | formatInteger}}
</h4>
</div>
<div class="col">
<h3>
<a ui-sref="app.wot_identity({pubkey: doc.pubkey, uid: doc.uid})">
<span class="gray">
<i class="ion-key"></i> {{:rebind:doc.pubkey|formatPubkey}}
</span>
<span class="positive" ng-if=":rebind:doc.uid">
<i class="ion-person"></i> {{:rebind:doc.name||doc.uid}}
</span>
</a>
</h3>
</div>
<!-- recipient -->
<div class="col">
<h3 ng-if=":rebind:doc.recipient">
<a ui-sref="app.wot_identity({pubkey: doc.recipient.pubkey, uid: doc.recipient.uid})">
<span class="gray">
<i class="ion-key"></i> {{:rebind:doc.recipient.pubkey|formatPubkey}}
</span>
<span class="positive" ng-if=":rebind:doc.recipient.uid">
<i class="ion-person"></i> {{:rebind:doc.recipient.name||doc.recipient.uid}}
</span>
</a>
</h3>
</div>
<!-- amount -->
<div class="col col-10">
<div class="badge item-note" ng-class=":rebind:{'badge-calm': doc.amount > 0, 'badge-white': doc.amount < 0}">
{{:rebind:doc.amount|formatAmount: {currency: doc.currency} }}
</div>
</div>
</div>
</ion-item>
......@@ -19,6 +19,12 @@
<cs-sort-icon asc="search.asc" sort="search.sort" toggle="'recipient'"></cs-sort-icon>
{{'DOCUMENT.LOOKUP.HEADER_RECIPIENT' | translate}}
</a>
<a class="no-padding dark col col-10 col-header"
ng-if=":rebind:expertMode && search.type==='movement'"
ng-click="toggleSort('amount')">
<cs-sort-icon asc="search.asc" sort="search.sort" toggle="'amount'"></cs-sort-icon>
{{'DOCUMENT.LOOKUP.HEADER_AMOUNT' | translate}}
</a>
</div>
<div class="padding gray" ng-if=":rebind:!search.loading && !search.results.length" translate>
......@@ -34,6 +40,9 @@
<div ng-switch-when="profile">
<ng-include src="::'plugins/es/templates/document/item_document_profile.html'"></ng-include>
</div>
<div ng-switch-when="movement">
<ng-include src="::'plugins/es/templates/document/item_document_movement.html'"></ng-include>
</div>
<div ng-switch-when="record">
<ng-include ng-if="doc.index === 'page'" src="::'plugins/es/templates/document/item_document_page.html'"></ng-include>
<ng-include ng-if="doc.index !== 'page'" src="::'plugins/es/templates/document/item_document.html'"></ng-include>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment