From 17352ff89e308bc6636ba31550fb537c8961f5b2 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 5 Dec 2018 18:34:42 +0000 Subject: [PATCH] Bug 20935: Add in-page links to the sidebar This patch adds links to the sidebar menu which allow the user to jump to a section within the page. --- koha-tmpl/intranet-tmpl/prog/css/preferences.css | 42 +++-- .../intranet-tmpl/prog/en/includes/prefs-menu.inc | 191 +++++++++++++++++++-- .../prog/en/modules/admin/preferences.tt | 13 +- .../intranet-tmpl/prog/js/pages/preferences.js | 25 +-- 4 files changed, 218 insertions(+), 53 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/preferences.css b/koha-tmpl/intranet-tmpl/prog/css/preferences.css index da27393..76b7531 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/preferences.css +++ b/koha-tmpl/intranet-tmpl/prog/css/preferences.css @@ -27,13 +27,6 @@ a.collapse-textarea { font-weight: bold; } -dl { - margin-left : 1em; -} -dt { - padding : .1em; -} - h2 { background-color: #e6f0f2; font-size: 150%; @@ -80,28 +73,45 @@ span.overridden { background: #FFF none; border: 0; color: #004D99; - font-weight: normal; font-size: 100%; + hyphens: auto; margin: 0; padding: .2em .5em; text-align: right; - text-decoration: underline; } -dl.name-row { - border-bottom: 1px solid #EEE; - margin: .3em 0; - margin-left: 1em; - padding: .3em 0; +#menu ul ul { + padding-left: 0; } -.name-cell label { +.name-row label { font-weight: bold; font-size: 130%; color: #336699; } +dl { + margin-left : 1em; +} + +dt { + padding : .1em; +} + + dd { + border-bottom: 1px solid #EEE; + line-height: 2em; + margin-bottom: 1em; + max-width: 75em; + padding: 0 0 1em 3em; text-indent: 0; - margin-left: 3em; +} + +dd li { + line-height: 1.5em; +} + +.modified-warning { + color: #006600; } \ No newline at end of file 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 3b2e2f7..413c389 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc @@ -1,20 +1,175 @@ + +[% BLOCK subtabs %] + [% FOREACH TAB IN TABS %] + + [% 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 d27b39d..435bb64 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -36,15 +36,14 @@

You searched for: [% searchfield | html %]

[% END %] [% IF ( searchfield && !search_not_found ) %] -

+

Results in sections: [% FOREACH TAB IN TABS %] [% TAB.tab_title %][% UNLESS ( loop.last ) %] • [% END %] [% END %] -

- [% END %] - [% IF ( searchfield ) %] - + • +
+ [% END %] [% FOREACH TAB IN TABS %]
@@ -54,7 +53,7 @@ [% UNLESS ( searchfield ) %]
- + •
[% END %] @@ -62,7 +61,7 @@ [% FOREACH LINE IN TAB.LINES %] [% IF ( LINE.is_group_title ) %] [% UNLESS ( loop.first ) %][% END %] -

[% LINE.title | html %]

+

[% LINE.title | html %]

[% UNLESS ( loop.last ) %][% END %] [% ELSE %] [% IF ( loop.first ) %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js index 2cb1ac1..ae4c2c7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js @@ -1,5 +1,6 @@ -// We can assume 'KOHA' exists, as we depend on KOHA.AJAX +/* global KOHA to_highlight search_jumped MSG_NOTHING_TO_SAVE MSG_SAVING MSG_SAVED_PREFERENCE MSG_MODIFIED MSG_MADE_CHANGES MSG_FILTER_NOT_FOUND humanMsg */ +// We can assume 'KOHA' exists, as we depend on KOHA.AJAX KOHA.Preferences = { Save: function ( form ) { modified_prefs = $( form ).find( '.modified' ); @@ -11,7 +12,7 @@ KOHA.Preferences = { unserialized.push($(this)); } }); - data = modified_prefs.serialize(); + var data = modified_prefs.serialize(); $(unserialized).each(function(){ data += '&' + $(this).attr('name') + '='; }); @@ -23,8 +24,8 @@ KOHA.Preferences = { KOHA.AJAX.Submit( { data: data, url: '/cgi-bin/koha/svc/config/systempreferences/', - success: function ( data ) { KOHA.Preferences.Success( form ) }, - complete: function () { KOHA.AJAX.MarkDone( $( form ).find( '.save-all' ) ) } + success: function () { KOHA.Preferences.Success( form ); }, + complete: function () { KOHA.AJAX.MarkDone( $( form ).find( '.save-all' ) ); } } ); }, Success: function ( form ) { @@ -48,7 +49,7 @@ $( document ).ready( function () { function mark_modified() { $( this.form ).find( '.save-all' ).prop('disabled', false); $( this ).addClass( 'modified' ); - var name_cell = $( this ).parents( '.name-row' ).find( '.name-cell' ); + var name_cell = $( this ).parent(); if ( !name_cell.find( '.modified-warning' ).length ) name_cell.append( '('+MSG_MODIFIED+')' ); KOHA.Preferences.Modified = true; @@ -74,8 +75,8 @@ $( document ).ready( function () { return false; }); - $("dl.sortable").sortable(); - $("dl.sortable").on( "sortchange", function( event, ui ) { + $(".sortable").sortable(); + $(".sortable").on( "sortchange", function( event, ui ) { // This is not exact but we just need to trigger a change $(ui.item.find('input:first')).change(); } ); @@ -84,9 +85,9 @@ $( document ).ready( function () { if ( KOHA.Preferences.Modified ) { return MSG_MADE_CHANGES; } - } + }; - $( '.prefs-tab .action .cancel' ).click( function () { KOHA.Preferences.Modified = false } ); + $( '.prefs-tab .action .cancel' ).click( function () { KOHA.Preferences.Modified = false; } ); $( '.prefs-tab .save-all' ).prop('disabled', true).click( function () { KOHA.Preferences.Save( this.form ); @@ -118,8 +119,8 @@ $( document ).ready( function () { // Filtering by mark.js - var keyword_filter = $("#keyword_filter"), - context = $(".name-row"); + var keyword_filter = $("#keyword_filter"); + var context = $(".name-row"); $("#clear_filter").on("click", function(e){ e.preventDefault(); keyword_filter.val("").trigger("input"); @@ -136,7 +137,7 @@ $( document ).ready( function () { $("#filter_empty").remove(); } }, - noMatch: function(term){ + noMatch: function(){ if( $("#filter_empty").length < 1 ){ $("main").prepend("
" + MSG_FILTER_NOT_FOUND + "
"); } -- 2.1.4