From 5f8e539ddcd2f40ad46d79db6d90664265de0d73 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 1 Aug 2019 11:49:59 +0000 Subject: [PATCH] Bug 23410: Add submenus to system preferences sidebar menu This patch adds a submenu to the sidebar menu in the system preferences interface. Submenu links let you jump to the sub-sections in each preference category. In the search results view, a link is added to allow the user to jump directly to the section from which those results came. For instance, if your search returns the "SuspendHoldsOpac" preference, the link will take you to to the Circulation preferences page and jump the page to the "Holds policy" section. This patch also converts the expand/collapse arrows to Font Awesome icons. The obsolete image files are removed. If you click a submenu link for a section on the current page which has been collapsed, the section will expand. To test, apply the patch and rebuild the staff client CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Go to Administration -> System preferences. - Test the various preference categories and confirm that the submenus appear correctly and jump you to the right section. - Test that if you click a section heading to collapse it that clicking the corresponding submenu link in the sidebar causes it to expand again. - Do a search for system preferences and confirm that the sidebar menu displays correctly. - Confirm that the "View all..." links take you to the correct page and section. --- koha-tmpl/intranet-tmpl/prog/css/preferences.css | 49 ++++- koha-tmpl/intranet-tmpl/prog/css/right-to-left.css | 12 -- .../intranet-tmpl/prog/en/includes/prefs-menu.inc | 202 +++++++++++++++++++-- .../prog/en/modules/admin/preferences.tt | 14 +- koha-tmpl/intranet-tmpl/prog/img/collapse.gif | Bin 57 -> 0 bytes koha-tmpl/intranet-tmpl/prog/img/expand.gif | Bin 57 -> 0 bytes .../intranet-tmpl/prog/js/pages/preferences.js | 15 +- 7 files changed, 249 insertions(+), 43 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/img/collapse.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/img/expand.gif diff --git a/koha-tmpl/intranet-tmpl/prog/css/preferences.css b/koha-tmpl/intranet-tmpl/prog/css/preferences.css index 7ecce1be4d..1855af15fd 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/preferences.css +++ b/koha-tmpl/intranet-tmpl/prog/css/preferences.css @@ -47,19 +47,35 @@ caption { h3 { color : #003366; margin : .4em 0; - width : 40%; } -h3.expanded { - background: transparent url("../img/collapse.gif") 0 6px no-repeat; - cursor : pointer; - padding-left : 12px; +/* https://css-tricks.com/hash-tag-links-padding/#article-header-id-4 */ +h3:target { + margin-top: -12px; + padding-top: 50px; } +h3:target::before { + padding: 0 5px; + position: absolute; + top: 25px; +} + +h3 i { + color: #336699; +} + +h3.expanded, h3.collapsed { - background: transparent url("../img/expand.gif") 0 6px no-repeat; - cursor : pointer; - padding-left : 12px; + cursor: pointer; +} + +h3.expanded i.fa.fa-caret-down::before { + content: "\f0d7"; +} + +h3.collapsed i.fa.fa-caret-down::before { + content: "\f0da"; } .humanMsg strong { @@ -134,4 +150,19 @@ span.overridden { border: 1px solid #EEE; margin: 1em 1em 1em 0; resize: vertical; -} \ No newline at end of file +} + +#menu ul li.active a.pref_sublink { + background: #FFF none; + border: 0; + color: #004D99; + font-size: 100%; + hyphens: auto; + margin: 0; + padding: .2em .5em; + text-align: right; +} + +#menu ul ul { + padding-left: 0; +} diff --git a/koha-tmpl/intranet-tmpl/prog/css/right-to-left.css b/koha-tmpl/intranet-tmpl/prog/css/right-to-left.css index 8117fee551..3a70812f4e 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/right-to-left.css +++ b/koha-tmpl/intranet-tmpl/prog/css/right-to-left.css @@ -377,18 +377,6 @@ p label, { float: left; } -/*the arrwos in pref.*/ -h3.expanded { - background: url("../img/collapse.gif") no-repeat scroll right 6px transparent; - cursor: pointer; - padding-right: 12px; -} -h3.collapsed { - background: url("../img/expand.gif") no-repeat scroll right 6px transparent; - cursor: pointer; - padding-right: 12px; - -} .dropdown-menu { position: absolute; top: 100%; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc index 542cf1f19e..d7486c3a68 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc @@ -1,21 +1,185 @@ + +[% BLOCK subtabs %] + [% UNLESS ( searchfield ) %] + [% FOREACH TAB IN TABS %] + + [% END %] + [% END %] +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt index eaad2155e3..ccdb6211fa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -47,8 +47,18 @@ [% FOREACH LINE IN TAB.LINES %] [% IF ( LINE.is_group_title ) %] [% UNLESS ( loop.first ) %][% END %] -

[% LINE.title | html %]

- +
+
+

[% LINE.title | html %]

+
+
+ [% IF ( searchfield ) %] + + [% END %] +
+
+ +
[% UNLESS ( loop.last ) %][% END %] [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/img/collapse.gif b/koha-tmpl/intranet-tmpl/prog/img/collapse.gif deleted file mode 100644 index 4457a95c05c3e014838ee7fe0544e17b6661d0a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57 zcmZ?wbhEHb
PreferenceValue