Bug 23438: Use Font Awesome icons in intranet search results browser
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 7 Aug 2019 13:33:52 +0000 (15:33 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 13 Aug 2019 10:39:57 +0000 (11:39 +0100)
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>

koha-tmpl/intranet-tmpl/js/browser.js
koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
koha-tmpl/intranet-tmpl/prog/en/includes/browser-strings.inc

index e706833..3b9ca87 100644 (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);
index 0c8a375..c9bc9a7 100644 (file)
@@ -4555,6 +4555,5 @@ div#makechart ol li {
     #browse-next {
         border-bottom-left-radius: 0;
         border-bottom-right-radius: 5px;
-        text-align: right;
     }
 }
index 68c544c..d7a1879 100644 (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>