Bug 23438: Use Font Awesome icons in intranet search results browser

In intranet after a search you see a results browser top left of biblio record details.

Actually this uses text for links next and previous with a character for the arrows.
I propose to use Font Awesome icons arrows.

In fact the translated text is often too large for those buttons.
For example "Previous" is "Préédant" in french and it causes the next and previous buttons to display on two lines.
Using icons is more compact and easy to use.

This patch also adds the list icon to back to results link and changes for a minimal text "Results".

1) Go to intranet
2) Perform a search with a few results
3) Click on first record
4) Check browser displays well
5) Click on next icon, check you go to next search result
6) Click on revious icon, check you go to previous search result
7) Click on "Results", you come back to search results
8) Clik on "Last" and click on last record
9) Check browser displays well

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Fridolin Somers 2019-08-07 15:33:52 +02:00 committed by Martin Renvoize
parent b400309ae5
commit 2fade168c8
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
3 changed files with 6 additions and 7 deletions

View file

@ -95,16 +95,16 @@ KOHA.browser = function (searchid, biblionumber) {
var prevbutton;
var nextbutton;
if (me.curPos === 0 && current_search.offset === 1) {
prevbutton = '<span id="browse-previous" class="browse-button" ' + BROWSER_PREVIOUS + '</span>';
prevbutton = '<span id="browse-previous" class="browse-button" title="' + BROWSER_PREVIOUS + '"><i class="fa fa-arrow-left"></i></span>';
} else {
prevbutton = '<a href="#" id="browse-previous" class="browse-button" ' + BROWSER_PREVIOUS + '</a>';
prevbutton = '<a href="#" id="browse-previous" class="browse-button" title="' + BROWSER_PREVIOUS + '"><i class="fa fa-arrow-left"></i></a>';
}
if (current_search.offset + me.curPos == current_search.total) {
nextbutton = '<span id="browse-next" class="browse-button">' + BROWSER_NEXT + ' »</span>';
nextbutton = '<span id="browse-next" class="browse-button" title="' + BROWSER_NEXT + '"><i class="fa fa-arrow-right"></i></span>';
} else {
nextbutton = '<a href="#" id="browse-next" class="browse-button">' + BROWSER_NEXT + ' »</a>';
nextbutton = '<a href="#" id="browse-next" class="browse-button" title="' + BROWSER_NEXT + '"><i class="fa fa-arrow-right"></i></a>';
}
$('#menu').before('<div class="browse-controls"><div class="browse-controls-inner"><div class="browse-label"><a href="' + searchURL + '" id="browse-return-to-results" class="searchwithcontext">' + BROWSER_RETURN_TO_SEARCH + '</a></div><div class="browse-prev-next">' + prevbutton + nextbutton + '</div></div></div>');
$('#menu').before('<div class="browse-controls"><div class="browse-controls-inner"><div class="browse-label"><a href="' + searchURL + '" id="browse-return-to-results" class="searchwithcontext"><i class="fa fa-list"></i> ' + BROWSER_RETURN_TO_SEARCH + '</a></div><div class="browse-prev-next">' + prevbutton + nextbutton + '</div></div></div>');
$('a#browse-previous').click(function (ev) {
ev.preventDefault();
browseRecords(-1);

View file

@ -4555,6 +4555,5 @@ div#makechart ol li {
#browse-next {
border-bottom-left-radius: 0;
border-bottom-right-radius: 5px;
text-align: right;
}
}

View file

@ -1,5 +1,5 @@
<script>
var BROWSER_RETURN_TO_SEARCH = _("Return to results");
var BROWSER_RETURN_TO_SEARCH = _("Results");
var BROWSER_PREVIOUS = _("Previous");
var BROWSER_NEXT = _("Next");
</script>