From 585f71e71a2a8cfb47d0aa7bde8322b511091b59 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Sat, 26 Jun 2021 18:08:31 +0200
Subject: [PATCH] Merge from master

---
 .../document/item_document_comment.html       | 36 ++++++++++---------
 .../document/item_document_page.html          |  4 +--
 .../document/item_document_profile.html       |  4 +--
 .../templates/document/items_documents.html   |  5 ++-
 .../es/templates/document/lookup_form.html    |  8 +++++
 5 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/www/plugins/es/templates/document/item_document_comment.html b/www/plugins/es/templates/document/item_document_comment.html
index 48a46ae3f..e43576d44 100644
--- a/www/plugins/es/templates/document/item_document_comment.html
+++ b/www/plugins/es/templates/document/item_document_comment.html
@@ -1,36 +1,40 @@
 <ion-item id="doc-{{::doc.id}}"
-          class="item item-document item-document-comment item-icon-left ink {{::ionItemClass}} no-padding-top no-padding-bottom"
-          ng-class="{'compacted': compactMode}"
+          class="item item-document item-document-comment ink {{::ionItemClass}} no-padding-top no-padding-bottom"
+          ng-class=":rebind:{'compacted': compactMode, 'item-icon-left': !compactMode}"
           ng-click="selectDocument($event, doc)">
 
-  <i ng-show=":rebind:!compactMode" ng-if=":rebind:!doc.avatar" class="icon ion-ios-chatbubble-outline stable" ></i>
-  <i ng-show=":rebind:!compactMode" ng-if=":rebind:doc.avatar" class="avatar" style="background-image: url('{{:rebind:doc.avatar.src}}')"></i>
+  <i ng-if=":rebind:!compactMode && !doc.avatar" class="icon ion-ios-chatbubble-outline stable" ></i>
+  <i ng-if=":rebind:!compactMode && doc.avatar" class="avatar" style="background-image: url('{{:rebind:doc.avatar.src}}')"></i>
 
   <div class="row no-padding">
     <div class="col">
-      <h4 >
-        <i class="ion-ios-chatbubble-outline dark"></i>
+      <h4>
+        <i class="ion-ios-chatbubble-outline dark" ng-show=":rebind:compactMode"></i>
         <span class="gray" ng-if=":rebind:doc.name">
           <i class="ion-person" ng-show=":rebind:!compactMode"></i>
-          {{:rebind:doc.name}}:
+          {{:rebind:doc.name}}
         </span>
-        <span class="dark">
-          <i class="ion-quote" ng-if=":rebind:!compactMode"></i>
+        <span class="dark" ng-if=":rebind:compactMode">:
           {{:rebind:doc.message|truncText:50}}
         </span>
       </h4>
-      <h4 class="gray"> <i class="ion-clock"></i> {{:rebind:doc.time|formatDate}}</h4>
     </div>
 
-    <div class="col">
-      <h3>
-        <a ui-sref="app.wot_identity({pubkey: doc.pubkey, uid: doc.name})">
+    <div class="col" ng-if=":rebind:!compactMode">
+      <h4 class="gray"> <i class="ion-clock"></i> {{:rebind:doc.time|formatDate}}</h4>
+    </div>
 
-        </a>
-      </h3>
+    <div class="col col-50" ng-if=":rebind:!compactMode">
+      <h4 class="gray">
+        {{'DOCUMENT.LOOKUP.TYPE.' + (doc.index + '_' + doc.type | uppercase) | translate}}
+      </h4>
+      <h4 class="dark">
+        <i class="ion-quote" ng-if=":rebind:!compactMode"></i>
+        {{:rebind:doc.message|truncText:50}}
+      </h4>
     </div>
 
-    <div class="col" ng-if=":rebind:!compactMode">
+    <div class="col col-10" ng-if=":rebind:!compactMode">
       <a
         ng-if=":rebind:login && doc.pubkey==walletData.pubkey"
         ng-click="remove($event, $index)"
diff --git a/www/plugins/es/templates/document/item_document_page.html b/www/plugins/es/templates/document/item_document_page.html
index c1840d0c6..4a1d0c85f 100644
--- a/www/plugins/es/templates/document/item_document_page.html
+++ b/www/plugins/es/templates/document/item_document_page.html
@@ -3,8 +3,8 @@
           ng-class="{'positive-100-bg': doc.updated}"
           ng-click="selectDocument($event, doc)">
 
-  <i ng-if=":rebind:doc.thumbnail" class="avatar" style="background-image: url({{:rebind:doc.thumbnail.src}})"></i>
-  <i ng-if=":rebind:!doc.thumbnail" class="avatar icon dark cion-registry-{{doc.docType}}" ></i>
+  <i ng-if=":rebind:doc.avatar" class="avatar" style="background-image: url({{:rebind:doc.avatar.src}})"></i>
+  <i ng-if=":rebind:!doc.avatar" class="avatar icon dark cion-registry-{{doc.docType}}" ></i>
 
   <div class="row no-padding">
     <div class="col">
diff --git a/www/plugins/es/templates/document/item_document_profile.html b/www/plugins/es/templates/document/item_document_profile.html
index 2e06d7785..0ef631883 100644
--- a/www/plugins/es/templates/document/item_document_profile.html
+++ b/www/plugins/es/templates/document/item_document_profile.html
@@ -1,6 +1,6 @@
 <ion-item id="doc-{{::doc.id}}"
-          class="item item-document item-icon-left ink {{::ionItemClass}} no-padding-top no-padding-bottom"
-          ng-class="{'compacted': compactMode}"
+          class="item item-document ink {{::ionItemClass}} no-padding-top no-padding-bottom"
+          ng-class=":rebind:{'compacted': compactMode, 'item-icon-left': !compactMode}"
           ng-click="selectDocument($event, doc)">
 
   <i ng-show=":rebind:!compactMode" ng-if=":rebind:doc.avatar" class="avatar" style="background-image: url({{:rebind:doc.avatar.src}})"></i>
diff --git a/www/plugins/es/templates/document/items_documents.html b/www/plugins/es/templates/document/items_documents.html
index ea0b02f37..8bb38d2b0 100644
--- a/www/plugins/es/templates/document/items_documents.html
+++ b/www/plugins/es/templates/document/items_documents.html
@@ -35,7 +35,7 @@
 <ng-repeat ng-repeat="doc in :rebind:search.results track by doc.id"
            ng-switch on="doc.type">
   <div ng-switch-when="comment">
-    <ng-include  src="::'plugins/es/templates/document/item_document_comment.html'"></ng-include>
+    <ng-include src="::'plugins/es/templates/document/item_document_comment.html'"></ng-include>
   </div>
   <div ng-switch-when="profile">
     <ng-include src="::'plugins/es/templates/document/item_document_profile.html'"></ng-include>
@@ -44,8 +44,7 @@
     <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>
+    <ng-include src="::doc.index === 'page' ? 'plugins/es/templates/document/item_document_page.html' : 'plugins/es/templates/document/item_document.html'"></ng-include>
   </div>
   <div ng-switch-default>
     <ng-include src="::'plugins/es/templates/document/item_document.html'"></ng-include>
diff --git a/www/plugins/es/templates/document/lookup_form.html b/www/plugins/es/templates/document/lookup_form.html
index dbb5279aa..c52ed56af 100644
--- a/www/plugins/es/templates/document/lookup_form.html
+++ b/www/plugins/es/templates/document/lookup_form.html
@@ -66,6 +66,14 @@
     </div>
 
     <div class=" pull-right hidden-xs hidden-sm">
+      <a class="button button-text button-small ink"
+         ng-class="{'button-text-positive': compactMode, 'button-text-stable': !compactMode}"
+         ng-click="toggleCompactMode()" >
+        <i class="icon ion-navicon"></i>
+        <b class="icon-secondary ion-arrow-down-b" style="top: -8px; left: 5px; font-size: 8px;"></b>
+        <b class="icon-secondary ion-arrow-up-b" style="top: 6px; left: 5px; font-size: 8px;"></b>
+        <span>{{'DOCUMENT.LOOKUP.BTN_COMPACT'|translate}}</span>
+      </a>
       <a class="button button-text button-small ink"
          ng-if="login"
          ng-click="showActionsPopover($event)">
-- 
GitLab