diff --git a/themes/fid_adlr/js/lightbox.js b/themes/fid_adlr/js/lightbox.js index 143c6bb720c57f7be24e6ba140d112d6e0be665a..c0fb1c8c97a270cbe595a55d06f2dcb23d719d7e 100644 --- a/themes/fid_adlr/js/lightbox.js +++ b/themes/fid_adlr/js/lightbox.js @@ -189,6 +189,13 @@ VuFind.register('lightbox', function Lightbox() { VuFind.refreshPage(); return; } + + /* remove save search icon by disabled one if save request succeeded */ + if (_originalUrl.match(/SaveSearch\?save=/)) { + $("#save-search").toggleClass("hidden"); + $("#saved-search").toggleClass("hidden"); + } + render(content); }) .fail(function lbAjaxFail(deferred, errorType, msg) { diff --git a/themes/fid_adlr/languages/de.ini b/themes/fid_adlr/languages/de.ini index da5d3236add9307ba42f62039dcbd1912d61e86d..7a2e7bd072fd3f20b09e694e0f4216bb9371f7b2 100644 --- a/themes/fid_adlr/languages/de.ini +++ b/themes/fid_adlr/languages/de.ini @@ -90,4 +90,6 @@ email_search_information = "Sie können hier die aktuelle Suche per E-Mail verse #16750 SwitchTab recommendation nohit_change_tab = Sie haben nur in der Kategorie <b>%%activeTab%%</b> gesucht. Wählen Sie bei Bedarf eine andere Kategorie oder nutzen Sie die Facettierung: -switchtab_headline = "Kategorie" \ No newline at end of file +switchtab_headline = "Kategorie" + +save_search_saved_in_account = Diese Suchanfrage ist bereits in Ihrem Konto gespeichert. \ No newline at end of file diff --git a/themes/fid_adlr/languages/en.ini b/themes/fid_adlr/languages/en.ini index 66ba6dd89e39ea7910ae8e919d0fe32e005822ac..c4b081b5461dc7bd36f8ade009d1991d94dbabfc 100644 --- a/themes/fid_adlr/languages/en.ini +++ b/themes/fid_adlr/languages/en.ini @@ -92,4 +92,6 @@ email_search_information = "Here you can send the current search by e-mail. Opti #16750 SwitchTab recommendation nohit_change_tab = You have searched only in the category <b>%%activeTab%%</b>. If necessary, choose another category or use the faceting: -switchtab_headline = "Category" \ No newline at end of file +switchtab_headline = "Category" + +save_search_saved_in_account = This search request is already saved in your account. \ No newline at end of file diff --git a/themes/fid_adlr/scss/compiled.scss b/themes/fid_adlr/scss/compiled.scss index f7d074068a30a5028347c7600fe88a2931d31b02..2a967e1bccfaf68670315fce44271497c32c388e 100644 --- a/themes/fid_adlr/scss/compiled.scss +++ b/themes/fid_adlr/scss/compiled.scss @@ -427,6 +427,10 @@ a { float: right; font-size: calc(#{$font-size-base} * 1.5); } + + &.disabled { + color: $asphalt-dark; + } } // ICONS - END diff --git a/themes/fid_adlr/templates/search/results.phtml b/themes/fid_adlr/templates/search/results.phtml index 0973736e4bf784442031b00fdd49095f9a98429e..267ac43e0556989d65523d94097ab7484a56619e 100644 --- a/themes/fid_adlr/templates/search/results.phtml +++ b/themes/fid_adlr/templates/search/results.phtml @@ -98,13 +98,18 @@ $this->headScript()->appendFile("check_save_statuses_adlr.js"); </span> <span> <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> - <?php if (is_numeric($this->results->getSearchId())): ?> - <?php if ($this->results->isSavedSearch()): ?> - <a data-lightbox href="<?=$this->url('myresearch-savesearch')?>?delete=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-remove" aria-hidden="true"></i></a> - <?php else: ?> + <?php if (is_numeric($this->results->getSearchId())): ?> + <?php if($this->auth()->isLoggedIn()): ?> + <?php if ($this->results->isSavedSearch()): ?> + <i class="icon icon-download icon-1.5x disabled" title="<?=$this->transEsc('save_search_saved_in_account')?>" aria-hidden="true"></i> + <?php else: ?> + <a id="save-search" data-lightbox href="<?=$this->url('myresearch-savesearch')?>?save=<?=urlencode($this->results->getSearchId())?>"><i class="icon icon-download icon-1.5x" aria-hidden="true"></i></a> + <i id="saved-search" class="icon icon-download icon-1.5x disabled hidden" title="<?=$this->transEsc('save_search_saved_in_account')?>" aria-hidden="true"></i> + <?php endif; ?> + <?php else: ?> <a data-lightbox href="<?=$this->url('myresearch-savesearch')?>?save=<?=urlencode($this->results->getSearchId())?>"><i class="icon icon-download icon-1.5x" aria-hidden="true"></i></a> - <?php endif; ?> <?php endif; ?> + <?php endif; ?> <?php endif; ?> </span> <span>