# HG changeset patch # User nowmad@23.1.168.192.in-addr.arpa # Date 1449076062 -3600 # Node ID 8b87432acffca749e39c0e6440d802e63bf2dc73 # Parent e3d3cd7a676ab8656faa39a6ba4584afb6d93f7f Update search to match the new response from exalead diff -r e3d3cd7a676a -r 8b87432acffc client/app/components/app_service.js --- a/client/app/components/app_service.js Wed Dec 02 11:41:53 2015 +0100 +++ b/client/app/components/app_service.js Wed Dec 02 18:07:42 2015 +0100 @@ -1,7 +1,7 @@ (function(){ 'use strict'; - + angular.module('ammicoCommon', ['ngRoute']) .factory('Book', function($resource, context) { var books = $resource(context.urls.ammicoUrl+'books/:idBook', {idBook:'@id', idExpo: context.idExpo}, {update: { method: 'PUT'}}); @@ -9,7 +9,7 @@ }) .factory('Slide', function($resource, context, $modal) { var slides = $resource(context.urls.ammicoUrl+'slides/:idSlide', {idSlide:'@id'}, {update: { method: 'PUT'}}); - + angular.extend(slides.prototype, { toggleFavorite: function () { @@ -51,7 +51,7 @@ } } }); - + return slides; }) .factory('Order', function($resource, context) { @@ -74,7 +74,7 @@ }) .service('searchApi', function($resource, context) { this.searchResource = function(params){ - return $resource(context.urls.searchUrl, + return $resource(context.urls.searchUrl, { callback: 'JSON_CALLBACK' }, @@ -84,35 +84,20 @@ params: params, isArray: false, transformResponse: function(data){ - var i, j; - // Transform meta list into meta dict - if (typeof data.hits !== 'undefined'){ - var nb = data.hits.length; - for(i=0;i Recherche : {{ q }} -

{{ results.nhits }} résultat(s)

+

{{ results.count }} résultat(s)

-
-
-
- +
+
+
+

- Nom : {{ h.metas_dict.name }} + Nom : {{ h.name }}

- Description : {{ h.metas_dict.description }} + Description : {{ h.description }}

-
-

- Classification : {{ h.metas_dict.classification }} -

-

- Propriétaire actuel : {{ h.metas_dict.currentcustody }} +

+ Url : {{ h.url }} +

+
+

+ Date : {{ h.date }}

-

- Ancien propriétaire : {{ h.metas_dict.formercustody }} +

+ Numéro d'inventaire : {{ h.inventorynumber }}

-

- Mesures : {{ h.metas_dict.measures }} +

+ Classification : {{ h.classification }}

-

- Acteurs : {{ h.metas_dict.actors }} +

+ Pays : {{ h.country }}

-

- Lieux : {{ h.metas_dict.places }} +

+ Mots Clefs : {{ h.tags }}

- -
+ +
diff -r e3d3cd7a676a -r 8b87432acffc client/app/search/search_controller.js --- a/client/app/search/search_controller.js Wed Dec 02 11:41:53 2015 +0100 +++ b/client/app/search/search_controller.js Wed Dec 02 18:07:42 2015 +0100 @@ -12,9 +12,9 @@ .controller('searchCtrl', function($scope, $location, $routeParams, searchApi, $modal, Slide){ $scope.q = $routeParams.q || ''; if ($scope.q !== ''){ - $scope.results_ = searchApi.searchResource({q:$scope.q, of: 'json', synthesis: 'false', nresults:'10', callback: 'JSON_CALLBACK'}).getJsonp(); + $scope.results = searchApi.searchResource({q:$scope.q, of: 'json', synthesis: 'false', nresults:'10', callback: 'JSON_CALLBACK'}).getJsonp(); } - + $scope.toggleModal = function (index) { var modalInstance = $modal.open({ @@ -34,7 +34,7 @@ }) .controller('ModalInstanceCtrl', function ($scope, $modalInstance, Book) { $scope.books = Book.query({format:'json'}); - + $scope.addToBook = function(idBook){ $modalInstance.close(idBook); };