client/app/search/search.html
changeset 197 8b87432acffc
parent 96 3542155549e4
--- a/client/app/search/search.html	Wed Dec 02 11:41:53 2015 +0100
+++ b/client/app/search/search.html	Wed Dec 02 18:07:42 2015 +0100
@@ -1,45 +1,45 @@
 <h1>
     Recherche <span ng-if="q !='' "> : {{ q }}</span>
 </h1>
-<h4 class="subtitle" ng-if="results.nhits>0">{{ results.nhits }} résultat(s)</h4>
+<h4 class="subtitle" ng-if="results.count>0">{{ results.count }} résultat(s)</h4>
 
-<div ng-if="results.nhits>0">
-    <div class="row search-item" ng-repeat="h in results.hits"
-        ng-init="h.imgbig=false">
-        <div ng-class="{'col-md-5': h.imgbig, 'col-md-3': !h.imgbig}">
-            <img ng-src="{{ h.metas_dict.images }}" ng-class="{'search-img-max': !h.imgbig}" ng-click="h.imgbig=!h.imgbig" />
+<div ng-if="results.count>0">
+    <div class="row search-item" ng-repeat="h in results.collect"
+        ng-init="h.imgbig=false; h.seemore=false">
+        <div ng-class="{'col-md-5': h.imgbig, 'col-md-3': !h.imgbig, 'img-wrap': true }">
+            <img ng-src="{{ h.images[0] || 'img/no_img.jpg' }}" ng-class="{'search-img-max': (h.images[0] && !h.imgbig), 'no-img': !h.images[0]}" ng-click="h.imgbig=(h.images[0] && !h.imgbig)" />
         </div>
         <div ng-class="{'col-md-5': h.imgbig, 'col-md-7': !h.imgbig}">
             <p>
-                <strong>Nom&nbsp;:</strong> {{ h.metas_dict.name }}
+                <strong>Nom&nbsp;:</strong> {{ h.name }}
             </p>
             <p>
-                <strong>Description&nbsp;:</strong> {{ h.metas_dict.description }}
+                <strong>Description&nbsp;:</strong> {{ h.description }}
             </p>
-            <div ng-show="h.imgbig">
-                <p>
-                    <small><strong>Classification&nbsp;:</strong> {{ h.metas_dict.classification }}</small>
-                </p>
-                <p>
-                    <small><strong>Propriétaire actuel&nbsp;:</strong> {{ h.metas_dict.currentcustody }}</small>
+            <p ng-if="h.url">
+                <strong>Url&nbsp;:</strong> <a href="{{ h.url }}" target="_blank">{{ h.url }}</a>
+            </p>
+            <div ng-show="h.seemore">
+                <p ng-if="h.date">
+                    <small><strong>Date&nbsp;:</strong> {{ h.date }}</small>
                 </p>
-                <p>
-                    <small><strong>Ancien propriétaire&nbsp;:</strong> {{ h.metas_dict.formercustody }}</small>
+                <p ng-if="h.inventorynumber">
+                    <small><strong>Numéro d'inventaire&nbsp;:</strong> {{ h.inventorynumber }}</small>
                 </p>
-                <p>
-                    <small><strong>Mesures&nbsp;:</strong> {{ h.metas_dict.measures }}</small>
+                <p ng-if="h.classification">
+                    <small><strong>Classification&nbsp;:</strong> {{ h.classification }}</small>
                 </p>
-                <p>
-                    <small><strong>Acteurs&nbsp;:</strong> {{ h.metas_dict.actors }}</small>
+                <p ng-if="h.country">
+                    <small><strong>Pays&nbsp;:</strong> {{ h.country }}</small>
                 </p>
-                <p>
-                    <small><strong>Lieux&nbsp;:</strong> {{ h.metas_dict.places }}</small>
+                <p ng-if="h.tags.length>0">
+                    <small><strong>Mots Clefs&nbsp;:</strong> {{ h.tags }}</small>
                 </p>
             </div>
         </div>
         <div class="col-md-1">
             <a class="btn btn-default" ng-click="toggleModal($index)"><span class="glyphicon glyphicon-plus"></span></a>
-            <a class="btn btn-default" ng-click="h.imgbig=!h.imgbig"><span class="glyphicon glyphicon-eye-open"></span></a>
-        </div>         
+            <a class="btn btn-default" ng-click="h.imgbig=(h.images[0] && !h.imgbig); h.seemore=!h.seemore"><span class="glyphicon glyphicon-eye-open"></span></a>
+        </div>
     </div>
 </div>