Bug 23602: (follow-up) Improve tooltip formatting
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 27 Sep 2019 12:13:05 +0000 (13:13 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 27 Sep 2019 13:08:19 +0000 (14:08 +0100)
This follow-up changes the formatting of the tooltip to add a newline for
library limit.

To test, apply the patch and go to Administration -> Item types.

In the table of item types, find one with library limitations. Hovering
over the "# library limitations" test should trigger a Bootstrap-styled
tooltip showing the library name and code, one per line.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt

index a1b4f1f..666701f 100644 (file)
@@ -416,7 +416,11 @@ Item types administration
                 [% IF itemtype.branches.size > 0 %]
                     [% branches_str = "" %]
                     [% FOREACH branch IN itemtype.branches %]
-                        [% branches_str = branches_str _ " " _ branch.branchname _ " (" _ branch.branchcode _ ")" %]
+                        [%- IF loop.first -%]
+                        [% branches_str = branch.branchname _ " (" _ branch.branchcode _ ")" %]
+                        [% ELSE %]
+                        [% branches_str = branches_str _ "\n" _ branch.branchname _ " (" _ branch.branchcode _ ")" %]
+                        [% END %]
                     [% END %]
                     <span class="library_limitation" title="[% branches_str | html %]">
                         [% IF itemtype.branches.size > 1 %]