diff --git a/themes/fid_adlr/js/check_save_statuses_adlr.js b/themes/fid_adlr/js/check_save_statuses_adlr.js new file mode 100644 index 0000000000000000000000000000000000000000..91091bc2a9d4032b720514f1e79c6d3f7e5a7650 --- /dev/null +++ b/themes/fid_adlr/js/check_save_statuses_adlr.js @@ -0,0 +1,16 @@ +function displaySaveStatus(itemLists, $item) { + if (itemLists.length > 0) { + // If we got lists back, display them! + var html = '<ul>' + itemLists.map(function convertToLi(l) { + return '<li><a href="' + l.list_url + '">' + htmlEncode(l.list_title) + '</a></li>'; + }).join('') + '</ul>'; + $item.find('.savedLists').addClass('loaded'); + $item.find('.js-load').replaceWith(html); + $item.find('.icon-star').removeClass('icon-star').addClass('icon-star-filled'); + } else { + // If we got nothing back, remove the pending status: + $item.find('.js-load').remove(); + } + // No matter what, clear the flag that we have a pending save: + $item.removeClass('js-save-pending'); +} diff --git a/themes/fid_adlr/scss/compiled.scss b/themes/fid_adlr/scss/compiled.scss index d5be0a89d2808728c970105a005e46ed917abedb..1444a811f45ecfa7b69a94cb098ee901cc1244b4 100644 --- a/themes/fid_adlr/scss/compiled.scss +++ b/themes/fid_adlr/scss/compiled.scss @@ -1707,9 +1707,16 @@ input.searchForm_lookfor { } .result-links { + .save-record, #toolbar-menu { color: $violet; } + + // #16706 dont show loaded favorites in result list + .savedLists.loaded { + display: none; + } + // move favorites and other icons to the right text-align: right; diff --git a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/core.phtml b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/core.phtml index 62a57b7e884ed782f3cf16b5741114522bfa8984..a57af5b8dcd6f1f514eec1f01dbf6f5d056c4911 100644 --- a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/core.phtml +++ b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/core.phtml @@ -81,10 +81,6 @@ <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> <?=$block?> <?php endif; ?> - <?php /* Saved lists */ ?> - <div class="savedLists alert alert-info hidden"> - <strong><?=$this->transEsc("Saved in")?>:</strong> - </div> <?php endif; ?> </div> </div> diff --git a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/result-list.phtml index 12ae7ab2823e762a4a583a4015fea311b1b79965..c13841cdad3c9be29c82bcb5e88b4ba9349fc9ff 100644 --- a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/result-list.phtml +++ b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/result-list.phtml @@ -189,7 +189,7 @@ $i = 0; <?php if ($this->permission()->allowDisplay('feature.Favorites')): ?> <?php /* Add to favorites; finc: keep Icon inside link - CK */ ?> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" data-lightbox class="save-record result-link-label" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" title="<?=$this->transEsc('Add to favorites')?>"> - <i class="fa fa-fw fa-star-o fa-2x" aria-hidden="true"></i> <span class="hidden-xs hidden-sm"><?/* =$this->transEsc('Add to favorites') */?></span> + <i class="icon icon-star icon-1.5x" aria-hidden="true"></i> <span class="hidden-xs hidden-sm"><?/* =$this->transEsc('Add to favorites') */?></span> </a><br/> <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> <?=$block?> diff --git a/themes/fid_adlr/templates/RecordDriver/SolrAI/core.phtml b/themes/fid_adlr/templates/RecordDriver/SolrAI/core.phtml index e651e7d060524c8a5a03c936122db6cbff73d47a..2037a043c589ccde5cda4d51891241fcf4e74e6e 100644 --- a/themes/fid_adlr/templates/RecordDriver/SolrAI/core.phtml +++ b/themes/fid_adlr/templates/RecordDriver/SolrAI/core.phtml @@ -84,10 +84,6 @@ <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> <?=$block?> <?php endif; ?> - <?php /* Saved lists */ ?> - <div class="savedLists alert alert-info hidden"> - <strong><?=$this->transEsc("Saved in")?>:</strong> - </div> <?php endif; ?> </div> </div> diff --git a/themes/fid_adlr/templates/RecordDriver/SolrAI/result-list.phtml b/themes/fid_adlr/templates/RecordDriver/SolrAI/result-list.phtml index 2f2b27d7b45babefb7429337674747047f062f4b..fc9ca125b076016d40dece0756f84ecc589a1007 100644 --- a/themes/fid_adlr/templates/RecordDriver/SolrAI/result-list.phtml +++ b/themes/fid_adlr/templates/RecordDriver/SolrAI/result-list.phtml @@ -159,7 +159,7 @@ if ($cover): <?php /* Add to favorites; finc: keep Icon inside link - CK */ ?> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" data-lightbox class="save-record result-link-label" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" title="<?=$this->transEsc('Add to favorites')?>"> - <i class="result-link-icon fa fa-fw fa-star-o fa-2x" aria-hidden="true"></i> <?/* =$this->transEsc('Add to favorites') */?> + <i class="result-link-icon icon icon-star icon-1.5x" aria-hidden="true"></i> <?/* =$this->transEsc('Add to favorites') */?> </a><br/> <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> <?=$block?> diff --git a/themes/fid_adlr/templates/RecordDriver/SolrMarc/core.phtml b/themes/fid_adlr/templates/RecordDriver/SolrMarc/core.phtml index e2e43d8b62ebf40630110a7b92e3a25db67e05a5..2d2eb4cacad67d4805f51bd4a64d06bf558b87e2 100644 --- a/themes/fid_adlr/templates/RecordDriver/SolrMarc/core.phtml +++ b/themes/fid_adlr/templates/RecordDriver/SolrMarc/core.phtml @@ -83,10 +83,6 @@ <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> <?=$block?> <?php endif; ?> - <?php /* Saved lists */ ?> - <div class="savedLists alert alert-info hidden"> - <strong><?=$this->transEsc("Saved in")?>:</strong> - </div> <?php endif; ?> </div> </div> diff --git a/themes/fid_adlr/templates/record/view.phtml b/themes/fid_adlr/templates/record/view.phtml index bde5f9e3857cfc08a812fbe7ea540818e81655b8..e256d75a228897fcdcc73f16c6ae29a75f197bd8 100644 --- a/themes/fid_adlr/templates/record/view.phtml +++ b/themes/fid_adlr/templates/record/view.phtml @@ -3,6 +3,7 @@ // Set up standard record scripts: $this->headScript()->appendFile("record.js"); $this->headScript()->appendFile("check_save_statuses.js"); +$this->headScript()->appendFile("check_save_statuses_adlr.js"); // Activate Syndetics Plus if necessary: if ($this->syndeticsPlus()->isActive()) { $this->headScript()->appendFile($this->syndeticsPlus()->getScript()); diff --git a/themes/fid_adlr/templates/search/results.phtml b/themes/fid_adlr/templates/search/results.phtml index 780ef91a5147fd01e6643e66bf7b95788f1e7178..0973736e4bf784442031b00fdd49095f9a98429e 100644 --- a/themes/fid_adlr/templates/search/results.phtml +++ b/themes/fid_adlr/templates/search/results.phtml @@ -48,6 +48,7 @@ if ($this->params->getOptions()->getListViewOption() != "full") { $this->headScript()->appendFile("vendor/hunt.min.js"); $this->headScript()->appendFile("check_item_statuses.js"); $this->headScript()->appendFile("check_save_statuses.js"); +$this->headScript()->appendFile("check_save_statuses_adlr.js"); ?> <?php /* finc: we need search-results-col to pull content to full width, also used in print styles! - CK */?>