--- 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 :</strong> {{ h.metas_dict.name }}
+ <strong>Nom :</strong> {{ h.name }}
</p>
<p>
- <strong>Description :</strong> {{ h.metas_dict.description }}
+ <strong>Description :</strong> {{ h.description }}
</p>
- <div ng-show="h.imgbig">
- <p>
- <small><strong>Classification :</strong> {{ h.metas_dict.classification }}</small>
- </p>
- <p>
- <small><strong>Propriétaire actuel :</strong> {{ h.metas_dict.currentcustody }}</small>
+ <p ng-if="h.url">
+ <strong>Url :</strong> <a href="{{ h.url }}" target="_blank">{{ h.url }}</a>
+ </p>
+ <div ng-show="h.seemore">
+ <p ng-if="h.date">
+ <small><strong>Date :</strong> {{ h.date }}</small>
</p>
- <p>
- <small><strong>Ancien propriétaire :</strong> {{ h.metas_dict.formercustody }}</small>
+ <p ng-if="h.inventorynumber">
+ <small><strong>Numéro d'inventaire :</strong> {{ h.inventorynumber }}</small>
</p>
- <p>
- <small><strong>Mesures :</strong> {{ h.metas_dict.measures }}</small>
+ <p ng-if="h.classification">
+ <small><strong>Classification :</strong> {{ h.classification }}</small>
</p>
- <p>
- <small><strong>Acteurs :</strong> {{ h.metas_dict.actors }}</small>
+ <p ng-if="h.country">
+ <small><strong>Pays :</strong> {{ h.country }}</small>
</p>
- <p>
- <small><strong>Lieux :</strong> {{ h.metas_dict.places }}</small>
+ <p ng-if="h.tags.length>0">
+ <small><strong>Mots Clefs :</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>