diff --git a/www/plugins/es/css/style.css b/www/plugins/es/css/style.css index 84c986d42ff6b4d87455404c2740dad700ed5ad5..1845a1d8602f9d2d580dee206b73e82714f744b5 100644 --- a/www/plugins/es/css/style.css +++ b/www/plugins/es/css/style.css @@ -176,3 +176,31 @@ padding-top: 8px; padding-bottom: 8px; } + +/** +* Add specific Icons +*/ + +/* Association */ +.cion-page-association:before { + font-family: "Ionicons"; + content: "\f212"; +} + +/* institution */ +.cion-page-company:before { + font-family: "Cesiumicons"; + content: "\e903"; +} + +/* institution */ +.cion-page-institution:before { + font-family: "Cesiumicons"; + content: "\e921"; +} + +/* shop */ +.cion-page-shop:before { + font-family: "Ionicons"; + content: "\f110"; +} diff --git a/www/plugins/es/js/controllers/common-controllers.js b/www/plugins/es/js/controllers/common-controllers.js index a6af511a0f67af8cc1be3a0f9ac5bdad1479d90c..a9d7e77990e33ec9cd850fdd2a922e4fa2dc8a07 100644 --- a/www/plugins/es/js/controllers/common-controllers.js +++ b/www/plugins/es/js/controllers/common-controllers.js @@ -206,7 +206,7 @@ function ESCommentsController($scope, $timeout, $filter, $state, $focus, UIUtils $scope.save = function() { if (!$scope.formData.message || !$scope.formData.message.length) return; - $scope.loadWallet({minData: true}) + $scope.loadWallet({minData: true, auth: true}) .then(function() { UIUtils.loading.hide(); var comment = $scope.formData; diff --git a/www/plugins/es/js/controllers/registry-controllers.js b/www/plugins/es/js/controllers/registry-controllers.js index f43e87cc05deccaf6229e7c67ecbd4b71267b56d..55257a9ad561830d6b5a0faecb266fe174083ff0 100644 --- a/www/plugins/es/js/controllers/registry-controllers.js +++ b/www/plugins/es/js/controllers/registry-controllers.js @@ -438,16 +438,24 @@ function ESRegistryRecordViewController($scope, $state, $q, $timeout, $ionicPopo // Load pictures esRegistry.record.picture.all({id: id}) .then(function(hit) { + var pictures; if (hit._source.pictures) { - $scope.pictures = hit._source.pictures.reduce(function(res, pic) { + pictures = hit._source.pictures.reduce(function(res, pic) { return res.concat(esHttp.image.fromAttachment(pic.file)); }, []); + if (pictures.length > 0) { + pictures.splice(0,1); // Remove the avatar + } } + $scope.pictures = pictures; + // Set Motion - $scope.motion.show({ - selector: '.lazy-load .item.card-gallery, .lazy-load .item', - startVelocity: 3000 - }); + if (pictures.length > 0) { + $scope.motion.show({ + selector: '.lazy-load .item.card-gallery, .lazy-load .item', + startVelocity: 3000 + }); + } }) .catch(function() { $scope.pictures = []; @@ -543,7 +551,7 @@ function ESRegistryRecordViewController($scope, $state, $q, $timeout, $ionicPopo } function ESRegistryRecordEditController($scope, esRegistry, UIUtils, $state, $q, Device, - $ionicHistory, ModalUtils, $focus, $timeout, esHttp) { + $ionicHistory, ModalUtils, $focus, esHttp) { 'ngInject'; $scope.walletData = {}; @@ -579,7 +587,7 @@ function ESRegistryRecordEditController($scope, esRegistry, UIUtils, $state, $q, $scope.load = function(id) { esRegistry.record.load(id, { - fetchPictures: true + raw: true }) .then(function (data) { $scope.formData = data.record; diff --git a/www/plugins/es/js/services/comment-services.js b/www/plugins/es/js/services/comment-services.js index 13d23c7288a8bf5c50e64292349c4e56d35ac572..d22e9e9184ca5608b5df9d91a567e1f527889a05 100644 --- a/www/plugins/es/js/services/comment-services.js +++ b/www/plugins/es/js/services/comment-services.js @@ -125,7 +125,10 @@ angular.module('cesium.es.comment.services', ['ngResource', 'cesium.services', data.total = res.hits.total; data.result = res.hits.hits.reduce(function (result, hit) { var comment = new Comment(hit._id, hit._source); - data.mapById[comment.id] = comment; // fill map by id + // Parse URL and hashtags + comment.html = esHttp.util.trustAsHtml(comment.message); + // fill map by id + data.mapById[comment.id] = comment; return result.concat(comment); }, data.result); @@ -278,6 +281,7 @@ angular.module('cesium.es.comment.services', ['ngResource', 'cesium.services', entity = data.mapById[id]; entity.copy(comment); } + entity.html = esHttp.util.trustAsHtml(entity.message); // Send add request if (!id) { diff --git a/www/plugins/es/js/services/registry-services.js b/www/plugins/es/js/services/registry-services.js index 8df998c0dbf5f74e5de0982b15723740d34875a4..8acd1f5baf0c2a5058d4960d8574484eabb9b541 100644 --- a/www/plugins/es/js/services/registry-services.js +++ b/www/plugins/es/js/services/registry-services.js @@ -128,7 +128,8 @@ angular.module('cesium.es.registry.services', ['ngResource', 'cesium.services', function loadData(id, options) { options = options || {}; - options.fecthPictures = options.fetchPictures || false; + options.raw = angular.isDefined(options.raw) ? options.raw : false; + options.fecthPictures = angular.isDefined(options.fetchPictures) ? options.fetchPictures : options.raw; return $q.all([ @@ -145,6 +146,11 @@ angular.module('cesium.es.registry.services', ['ngResource', 'cesium.services', var hit = res[1]; var record = readRecordFromHit(hit, categories); + // parse description as Html + if (!options.raw) { + record.description = esHttp.util.trustAsHtml(record.description); + } + // Load issuer (avatar, name, uid, etc.) return csWot.extend({pubkey: record.issuer}) .then(function(issuer) { @@ -173,7 +179,7 @@ angular.module('cesium.es.registry.services', ['ngResource', 'cesium.services', picture: { all: esHttp.get('/page/record/:id?_source=pictures') }, - comment: esComment.instance('registry') + comment: esComment.instance('page') }; exports.currency = { all: esHttp.get('/currency/record/_search?_source=currencyName,peers.host,peers.port'), diff --git a/www/plugins/es/templates/common/item_comment_content.html b/www/plugins/es/templates/common/item_comment_content.html index 015e58ceffa27cbf664cb98620af31377d667633..50b9cb2b95154d3ad7e9e18a8cffee851e39b6c9 100644 --- a/www/plugins/es/templates/common/item_comment_content.html +++ b/www/plugins/es/templates/common/item_comment_content.html @@ -17,5 +17,5 @@ {{::comment.issuer|formatPubkey}} </span> </a> - <span class="text-keep-lines" ng-bind-html="::comment.message"></span> + <span class="text-keep-lines" ng-bind-html="comment.html"></span> </div> diff --git a/www/plugins/es/templates/registry/lookup.html b/www/plugins/es/templates/registry/lookup.html index a21a9ab064809b13104519c7387f8856fb9c57fe..0c0f58934bf0f19d927a3cd1a9b4601e9645c3ee 100644 --- a/www/plugins/es/templates/registry/lookup.html +++ b/www/plugins/es/templates/registry/lookup.html @@ -50,7 +50,7 @@ <div class="item-text-wrap item-thumbnail-left-padding" ng-class="{'item-thumbnail-left': rec.thumbnail || rec.type}"> - <i class="item-image icon cion-registry-{{::rec.type}}" ng-if="!rec.thumbnail"></i> + <i class="item-image icon cion-page-{{::rec.type}}" ng-if="!rec.thumbnail"></i> <i class="item-image" style="background-image: url({{::rec.thumbnail.src}})" ng-if="rec.thumbnail"></i> <h2 ng-bind-html="rec.title"></h2> <h4 class="gray"> diff --git a/www/plugins/es/templates/registry/lookup_lg.html b/www/plugins/es/templates/registry/lookup_lg.html index 1e3eeba6251d32cdd15c98cc67fe399d00b58bd0..b700ec85a4ee4c34fb9be293fb61ef0050c77394 100644 --- a/www/plugins/es/templates/registry/lookup_lg.html +++ b/www/plugins/es/templates/registry/lookup_lg.html @@ -72,7 +72,7 @@ <div class="row row-record "> <div class="col item-text-wrap item-thumbnail-left-padding" ng-class="{'item-thumbnail-left': rec.thumbnail || rec.type}"> - <i class="item-image icon cion-registry-{{::rec.type}}" ng-if="!rec.thumbnail"></i> + <i class="item-image icon cion-page-{{::rec.type}}" ng-if="!rec.thumbnail"></i> <i class="item-image avatar" style="background-image: url({{::rec.thumbnail.src}})" ng-if="rec.thumbnail"></i> <h2 ng-bind-html="rec.title"></h2> <h4 class="gray"> diff --git a/www/plugins/es/templates/registry/modal_record_type.html b/www/plugins/es/templates/registry/modal_record_type.html index 3f5bf7ab98678ab78ee6136915f5dfdefe4c7cde..c265e63619ed833cb324b4a8482cad3909d5c8d6 100644 --- a/www/plugins/es/templates/registry/modal_record_type.html +++ b/www/plugins/es/templates/registry/modal_record_type.html @@ -7,19 +7,19 @@ <ion-content class="lookupForm"> <div class="list padding"> <h3 translate>REGISTRY.TYPE.SELECT_TYPE</h3> - <button class="button button-block button-stable icon-left cion-registry-shop" + <button class="button button-block button-stable icon-left cion-page-shop" ng-click="closeModal('shop')" translate>REGISTRY.TYPE.ENUM.SHOP</button> - <button class="button button-block button-stable icon-left cion-registry-association" + <button class="button button-block button-stable icon-left cion-page-association" ng-click="closeModal('association')" translate>REGISTRY.TYPE.ENUM.ASSOCIATION</button> - <button class="button button-block button-stable icon-left cion-registry-company" + <button class="button button-block button-stable icon-left cion-page-company" ng-click="closeModal('company')" translate>REGISTRY.TYPE.ENUM.COMPANY</button> - <button class="button button-block button-stable icon-left cion-registry-institution" + <button class="button button-block button-stable icon-left cion-page-institution" ng-click="closeModal('institution')" translate>REGISTRY.TYPE.ENUM.INSTITUTION</button> </div> diff --git a/www/plugins/es/templates/registry/view_record.html b/www/plugins/es/templates/registry/view_record.html index cce4a49ae88929b2423c663f1b8a34562310e427..353ddcbf106a299ead347b5f6d00635ce4d83c7b 100644 --- a/www/plugins/es/templates/registry/view_record.html +++ b/www/plugins/es/templates/registry/view_record.html @@ -15,7 +15,7 @@ <ion-content scroll="true"> <div class="positive-900-bg hero"> <div class="content" ng-if="!loading"> - <i class="avatar cion-registry-{{formData.type}}" ng-if="!formData.thumbnail"></i> + <i class="avatar cion-page-{{formData.type}}" ng-if="!formData.thumbnail"></i> <i class="avatar" style="background-image: url({{::formData.thumbnail.src}})" ng-if="formData.thumbnail"></i> <h3 ng-bind-html="formData.title"></h3> <h4> </h4> @@ -91,9 +91,7 @@ </div> <ion-item> - <h2> - <span class="text-keep-lines" ng-bind-html="formData.description"></span> - </h2> + <h2 ng-bind-html="formData.description"></h2> </ion-item> <ion-item> diff --git a/www/plugins/es/templates/user/items_profile.html b/www/plugins/es/templates/user/items_profile.html index 7ed0ae5d777fd2360ecc93faada9f731c1aff8ef..10ae9417d9d352afb3ad6ba92ce30246d8d7f066 100644 --- a/www/plugins/es/templates/user/items_profile.html +++ b/www/plugins/es/templates/user/items_profile.html @@ -10,7 +10,7 @@ <!-- About me --> <div class="item" ng-if="formData.profile.description"> <span class="gray" translate>PROFILE.DESCRIPTION</span> - <h3 class=" text-keep-lines" ng-bind-html="formData.profile.description"></h3> + <h3 class="text-keep-lines" ng-bind-html="formData.profile.description"></h3> </div> <!-- Localisation -->