\n
\n\n
\n'),a.put("templates/translate-description.html",'
'),a.put("templates/translate-images.html",'
'),a.put("templates/translate-tariffs.html",'
'),a.put("templates/translate-title.html",'
'),a.put("templates/offer-translate.html",'
\n\n
\n\n \n\n
\n \n \n\n \n \n\n \n \n\n \n \n
\n\n
\n\n
\n'),a.put("templates/organizer-address.html",'
\n'),a.put("templates/organizer-contact.html",'
\n\n\n
\n
\n
\n - \n {{contact.value}}\n \n
\n
\n
\n
\n\n
\n\n
\n'),a.put("templates/organizer-detail.html",'
\n \n
\n\n
\n\n
\n
\n
\n \n \n \n \n \n \n \n \n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n | \n \n \n | \n
\n \n \n \n | \n \n \n | \n
\n \n \n \n | \n \n \n | \n
\n \n \n \n | \n \n \n \n \n | \n
\n \n \n \n \n \n | \n \n \n \n \n \n | \n
\n \n
\n
\n \n\n
\n \n
\n\n
\n \n
\n
\n
\n'),
-a.put("templates/organizer-form.html",'
\n\n
\n \n
\n\n
\n\n
\n
\n\n
\n
Annuleren\n\n
\n \n
\n'),a.put("templates/place-detail.html",'
\n\n
\n\n
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n \n \n \n \n \n \n | \n {{::place.name}} | \n
\n \n | \n {{::translateType(place.type.label)}} | \n
\n\n \n | \n \n \n | \n | \n
\n \n | \n {{::place.address.streetAddress}} \n {{::place.address.postalCode}} {{::place.address.addressLocality}} \n {{::place.address.addressCountry}} | \n
\n \n \n \n \n \n \n \n | \n \n \n \n \n \n \n \n \n \n \n \n \n | \n
\n \n | \n \n {{ageRange}}\n \n | \n
\n \n \n \n \n | \n \n \n | \n | \n
\n \n
\n
\n\n
\n
\n
\n \n
\n
\n
\n \n - \n \n
\n \n \n API: \n
\n \n API key: \n ()\n
\n \n
\n
\n
\n
\n\n
\n\n
\n
\n
\n'),a.put("templates/delete-search-modal.html",'
\n
Ben je zeker dat je deze zoekopdracht wil verwijderen?
\n
\n\n\n'),a.put("templates/save-search-modal.html",'
\n'),a.put("templates/save-search.directive.html",'
\n \n \n \n \n
\n'),a.put("templates/saved-searches-list.html",'
\n
\n
\n \n \n \n | \n \n Query\n | \n \n | \n
\n \n \n \n \n \n \n | \n \n \n | \n \n \n | \n
\n
\n
\n'),a.put("templates/event-link.directive.html",'
\n'),a.put("templates/label-select.html",'
\n\n
\n\n
\n\n
\n - \n {{label.name}} ×\n
\n
\n'),a.put("templates/offer-accessibility-info.component.html",'
\n
\n
\n \n voorziening(en)\n \n
\n
\n\n
\n
\n\n
\n \n
'),a.put("templates/query-editor-daterangepicker.directive.html",'
\n
\n \n \n \n \n
\n\n
tot\n\n
\n \n \n \n \n
\n
'),a.put("templates/query-editor-field.directive.html",'
\n
\n
\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n\n
\n \n
\n\n
\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n\n
\n\n
\n \n
\n
\n'),a.put("templates/query-editor-modal.html",'\n\n
\n\n
\n\n
\n
\n\n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n\n
\n
\n\n
\n \n \n \n
\n\n \n
\n
\n'),a.put("templates/query-editor.directive.html",'
\n
\n\n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n\n
\n
\n\n
\n
\n
\n'),a.put("templates/search-bar.directive.html",'
Zoeken
\n\n\n
\n\n
\n'),a.put("templates/event.directive.html",'
\n
\n \n\n
\n \n • \n \n
\n
\n
\n\n
\n\n
\n permanent\n \n \n \n \n \n \n \n \n \n \n ,…,\n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n
\n
\n Voer een {{ eventCtrl.activeLanguage.toUpperCase()+\'_ADJECTIVE\' | translate }} vertaling in\n
\n\n
\n Wijzig de {{ eventCtrl.activeLanguage.toUpperCase()+\'_ADJECTIVE\' | translate }} vertaling\n
\n
\n\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n\n\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
Basis-beschrijving\n
\n
\n
\n\n
\n \n \n
\n
\n\n\n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n\n
\n
Dit evenement is nog niet gelabeld.\n
\n
\n Het toevoegen van het label \'{{eventCtrl.addedLabel}}\' is niet gelukt.\n
\n
\n Het label \'{{eventCtrl.addedLabel}}\' werd succesvol toegevoegd.\n
\n
\n \n
\n
\n
\n
\n
\n
\n'),
+a.put("templates/organizer-form.html",'
\n\n
\n \n
\n\n
\n\n
\n
\n\n
\n
Annuleren\n\n
\n \n
\n'),a.put("templates/place-detail.html",'
\n\n
\n\n
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n \n \n \n \n \n \n | \n {{::place.name}} | \n
\n \n | \n {{::translateType(place.type.label)}} | \n
\n\n \n | \n \n \n | \n | \n
\n \n | \n {{::place.address.streetAddress}} \n {{::place.address.postalCode}} {{::place.address.addressLocality}} \n {{::place.address.addressCountry}} | \n
\n \n \n \n \n \n \n \n | \n \n \n \n \n \n \n \n \n \n \n \n \n | \n
\n \n | \n \n {{ageRange}}\n \n | \n
\n \n \n \n \n | \n \n \n | \n | \n
\n \n
\n
\n\n
\n
\n
\n \n
\n
\n
\n \n - \n \n
\n \n \n API: \n
\n \n API key: \n ()\n
\n \n
\n
\n
\n
\n\n
\n\n
\n
\n
\n'),a.put("templates/delete-search-modal.html",'
\n
Ben je zeker dat je deze zoekopdracht wil verwijderen?
\n
\n\n\n'),a.put("templates/save-search-modal.html",'
\n'),a.put("templates/save-search.directive.html",'
\n \n \n \n \n
\n'),a.put("templates/saved-searches-list.html",'
\n
\n
\n \n \n \n | \n \n Query\n | \n \n | \n
\n \n \n \n \n \n \n | \n \n \n | \n \n \n | \n
\n
\n
\n'),a.put("templates/event-link.directive.html",'
\n'),a.put("templates/label-select.html",'
\n\n
\n\n
\n\n
\n - \n {{label.name}} ×\n
\n
\n'),a.put("templates/offer-accessibility-info.component.html",'
\n
\n
\n \n voorziening(en)\n \n
\n
\n\n
\n
\n\n
\n \n
'),a.put("templates/query-editor-daterangepicker.directive.html",'
\n
\n \n \n \n \n
\n\n
tot\n\n
\n \n \n \n \n
\n
'),a.put("templates/query-editor-field.directive.html",'
\n
\n
\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n\n
\n \n
\n\n
\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n\n
\n\n
\n \n
\n
\n'),a.put("templates/query-editor-modal.html",'\n\n
\n\n
\n\n
\n
\n\n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n\n
\n
\n\n
\n \n \n \n
\n\n \n
\n
\n'),a.put("templates/query-editor.directive.html",'
\n
\n\n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n\n
\n
\n\n
\n
\n
\n'),a.put("templates/search-bar.directive.html",'
Zoeken
\n\n\n
\n\n
\n'),a.put("templates/event.directive.html",'
\n
\n \n\n
\n \n • \n \n
\n
\n
\n\n
\n\n
\n permanent\n \n \n \n \n \n \n \n \n \n \n ,…,\n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n
\n
\n Voer een {{ eventCtrl.activeLanguage.toUpperCase()+\'_ADJECTIVE\' | translate }} vertaling in\n
\n\n
\n Wijzig de {{ eventCtrl.activeLanguage.toUpperCase()+\'_ADJECTIVE\' | translate }} vertaling\n
\n
\n\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n\n\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
Basis-beschrijving\n
\n
\n
\n\n
\n \n \n
\n
\n\n\n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n\n
\n
Dit evenement is nog niet gelabeld.\n
\n
\n Het toevoegen van het label \'{{eventCtrl.addedLabel}}\' is niet gelukt.\n
\n
\n Het label \'{{eventCtrl.addedLabel}}\' werd succesvol toegevoegd.\n
\n
\n \n
\n
\n
\n
\n
\n
\n'),
a.put("templates/place.directive.html",'
\n
\n \n\n
\n \n • \n \n
\n
\n
\n\n
\n\n
\n permanent\n \n \n \n \n \n
\n\n
\n
\n\n
\n gratis\n \n \n \n niet ingevoerd\n
\n\n
\n \n
\n\n
\n \n
\n
\n\n
\n
\n\n
\n\n
\n
\n
\n Voer een {{ placeCtrl.activeLanguage.toUpperCase()+\'_ADJECTIVE\' | translate }} vertaling in\n
\n\n
\n Wijzig de {{ placeCtrl.activeLanguage.toUpperCase()+\'_ADJECTIVE\' | translate }} vertaling\n
\n
\n\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n\n\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
Basis-beschrijving\n
\n
\n
\n\n
\n \n \n
\n
\n\n\n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n\n
\n
Deze plaats is nog niet gelabeld.\n
\n
\n Het toevoegen van het label \'{{placeCtrl.labelsError.name}}\' is niet gelukt.\n
\n
\n Het label \'{{placeCtrl.addedLabel}}\' werd succesvol toegevoegd.\n
\n
\n \n
\n
\n
\n
\n
\n
\n'),a.put("templates/search-facilities-modal.html",'\n
\n\n
\n\n
\n Er ging iets fout tijdens het opslaan van de voorzieningen.\n
\n\n
\n\n'),a.put("templates/search.html",'
\n
\n\n
\n\n
\n Geen evenementen gevonden, probeer een andere zoekopdracht.\n
\n\n
\n
\n\n
\n
Wat
\n
Waar
\n
Wanneer
\n
\n
\n\n
\n
\n
\n \n\n
\n
\n
\n
\n
\n
\n\n \n
\n\n
\n \n \n\n \n \n
\n\n\n
\n\n
\n \n uitgevoerde query: {{realQuery}}\n \n
\n
\n
\n
\n Zoeken…\n
\n
\n'),a.put("templates/card-systems.html",'
'),a.put("templates/uitpasInfo.html",''),a.put("templates/organisation-suggestion.directive.html",'
\n
UiTPAS'),a.put("templates/organisation-uitpas-typeahead-template.html",'
\n \n UiTPAS\n')}])}();
\ No newline at end of file
diff --git a/src/core/translations/dutch-translations.constant.js b/src/core/translations/dutch-translations.constant.js
index 17ecbbf53..6a06016f8 100644
--- a/src/core/translations/dutch-translations.constant.js
+++ b/src/core/translations/dutch-translations.constant.js
@@ -1160,6 +1160,15 @@ angular.module('udb.core')
viewResults: 'Resultaten bekijken',
yourSearch: 'Jouw zoekopdracht',
save: 'Bewaren',
+ modal: {
+ mainTitle: 'Zoekopdracht opslaan',
+ newTab: 'Nieuwe zoekopdracht',
+ existingTab: 'Bestaande zoekopdracht',
+ giveName: 'Geef je zoekopdracht een naam',
+ selectSavedSearch: 'Kies een bewaarde zoekopdracht',
+ save: 'Bewaren',
+ cancel: 'Annuleren'
+ }
},
manage: 'Beheren',
oneResult: '1 resultaat',
diff --git a/src/core/translations/french-translations.constant.js b/src/core/translations/french-translations.constant.js
index f00b01526..38f2093b1 100644
--- a/src/core/translations/french-translations.constant.js
+++ b/src/core/translations/french-translations.constant.js
@@ -1153,6 +1153,15 @@ angular.module('udb.core')
viewResults: 'Consulter résultats',
yourSearch: 'Votre recherche',
save: 'Conserver',
+ modal: {
+ mainTitle: 'Enregistrer la recherche',
+ newTab: 'Nouvelle recherche',
+ existingTab: 'Recherche existante',
+ giveName: 'Donnez un nom à votre recherche',
+ selectSavedSearch: 'Choisissez une recherche existante',
+ save: 'Enregistrer',
+ cancel: 'Annuler'
+ }
},
manage: 'Gérer',
oneResult: '1 résultat',
diff --git a/src/core/translations/german-translations.constant.js b/src/core/translations/german-translations.constant.js
index 82f14a8f3..4cdac4eed 100644
--- a/src/core/translations/german-translations.constant.js
+++ b/src/core/translations/german-translations.constant.js
@@ -1243,6 +1243,15 @@ angular.module('udb.core').constant('udbGermanTranslations', {
'viewResults': 'Ergebnisse ansehen',
'yourSearch': 'Ihre Suchanfrage',
'save': 'Speichern',
+ 'modal': {
+ 'mainTitle': 'Suche speichern',
+ 'newTab': 'Neue Suche',
+ 'existingTab': 'Vorhandene Suche',
+ 'giveName': 'Gib deiner Suche einen Namen',
+ 'selectSavedSearch': 'Wähle eine vorhandene Suche',
+ 'save': 'Speichern',
+ 'cancel': 'Abbrechen'
+ }
},
'manage': 'Verwalten',
'oneResult': '1 Ergebnis',
diff --git a/src/core/udb-api.service.js b/src/core/udb-api.service.js
index 5e081e2fd..a100b3b0c 100644
--- a/src/core/udb-api.service.js
+++ b/src/core/udb-api.service.js
@@ -134,6 +134,12 @@ function UdbApi(
.then(returnUnwrappedData);
};
+ this.editSavedSearch = function (searchId, name, query) {
+ return $http
+ .put(appConfig.baseUrl + 'saved-searches/v3/' + searchId, {name: name, query: query}, defaultApiConfig)
+ .then(returnUnwrappedData);
+ };
+
/**
* @param {string} queryString - The query used to find offers.
* @param {number} [start] - From which offset the result set should start.
diff --git a/src/saved-searches/components/save-search-modal.controller.js b/src/saved-searches/components/save-search-modal.controller.js
index 3e1c12462..c6d25dd8c 100644
--- a/src/saved-searches/components/save-search-modal.controller.js
+++ b/src/saved-searches/components/save-search-modal.controller.js
@@ -12,23 +12,72 @@ angular
.controller('SaveSearchModalController', SaveSearchModalController);
/* @ngInject */
-function SaveSearchModalController($scope, $uibModalInstance) {
+function SaveSearchModalController($scope, udbApi, $q, $uibModalInstance, $translate) {
- var ok = function () {
+ var ok = function (type) {
var name = $scope.queryName;
+ var id = $scope.queryId;
$scope.wasSubmitted = true;
- if (name) {
- $uibModalInstance.close(name);
+ if (type === 'existing') {
+ $uibModalInstance.close({id: id, name: name, type: type});
}
+
+ if (type === 'new' && name) {
+ $uibModalInstance.close({name: name, type: type});
+ }
+
};
var cancel = function () {
$uibModalInstance.dismiss('cancel');
};
+ var isTabActive = function (tabId) {
+ return tabId === $scope.activeTabId;
+ };
+
+ var getSavedSearches = function () {
+ return udbApi.getSavedSearches().then(function (data) {
+ var withTranslation = data.map(function (savedSearch) {
+ var key = 'search.savedSearches.items.' + savedSearch.name.toString();
+ var translated = $translate.instant(key);
+ if (translated !== key) {
+ savedSearch.name = translated;
+ }
+ return savedSearch;
+ });
+ return $q.resolve(withTranslation);
+ });
+ };
+
+ var makeTabActive = function (tabId) {
+ $scope.activeTabId = tabId;
+ if (tabId === 'existing') {
+ getSavedSearches().then(function (savedSearches) {
+ $scope.savedSearches = savedSearches;
+ });
+ }
+ };
+
+ var setQueryName = function() {
+ var selectedSavedSearch = $scope.savedSearches.find(function(savedSearch) {
+ return savedSearch.id === $scope.queryId;
+ });
+
+ if (selectedSavedSearch) {
+ $scope.queryName = selectedSavedSearch.name;
+ }
+ };
+
+ $scope.savedSearches = [];
$scope.cancel = cancel;
$scope.ok = ok;
+ $scope.isTabActive = isTabActive;
+ $scope.makeTabActive = makeTabActive;
+ $scope.setQueryName = setQueryName;
$scope.queryName = '';
+ $scope.queryId = '';
+ $scope.activeTabId = 'new';
$scope.wasSubmitted = false;
}
diff --git a/src/saved-searches/components/save-search-modal.html b/src/saved-searches/components/save-search-modal.html
index a4f277ef8..1221c041b 100644
--- a/src/saved-searches/components/save-search-modal.html
+++ b/src/saved-searches/components/save-search-modal.html
@@ -1,18 +1,48 @@