From 660d7bbd5e97de320d539bd6bd0e1b0334562b07 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 13 Feb 2019 20:00:17 +0000 Subject: [PATCH] Bug 22337: Make it clearer that language preferences can be re-ordered This patch makes markup and CSS changes to the system preference interface so that it is visually clearer that language preferences (language and opaclanguages) can be re-ordered by the user to control the sequence of their appearance in language-selection menus. This patch makes some minor markup changes (including some whitespace fixes -- diff accordingly) in order to make it easier to apply these CSS changes. To test you should have more than one translation installed. Apply the patch and clear your browser cache if necessary. - Go to Administration -> System preferences -> I18N/L10N - The 'language' and 'opaclanguages' system preferences should show the new style. - Each language should show a "move" cursor when the mouse hovers over the "box." - Dragging and dropping the languages should work correctly, and changes should be reflected in language menus. Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- .../intranet-tmpl/prog/css/preferences.css | 40 +++++++++++ .../prog/en/modules/admin/preferences.tt | 66 ++++++++++--------- .../prog/js/pages/preferences.js | 4 +- 3 files changed, 78 insertions(+), 32 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/preferences.css b/koha-tmpl/intranet-tmpl/prog/css/preferences.css index b004267789..a1efc7c5de 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/preferences.css +++ b/koha-tmpl/intranet-tmpl/prog/css/preferences.css @@ -89,3 +89,43 @@ span.overridden { font-weight: bold; color: red; } + +.sortable { + margin-left: 0; + max-width: 20em; + padding: .5em 0; +} + +.sortable label { + font-weight: bold; +} + +.sortable li { + background: #FCFCFC url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMAQMAAABoTh6ZAAAABlBMVEVMaXHExMQ/ZYtiAAAAAXRSTlMAQObYZgAAABNJREFUeNpjYGBgMDYAIQjAxgYAKfECU0ml038AAAAASUVORK5CYII=") repeat-y; + border: 1px solid #EEE; + cursor: move; + font-weight: bold; + list-style-type: none; + margin: .5em 0; + padding: .1em .5em; + padding-left: 20px; +} + +.sortable li:hover { + background-color: #FFC; +} + +.sortable li li { + background: transparent none; + border: 0; + font-weight: normal; + padding-left: 0; +} + +.sortable li li label { + font-weight: normal; +} + +.sortable li.ui-sortable-helper { + background-color: #FFC; +} \ No newline at end of file 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 c6ea46b1bb..43e892ff0c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -104,36 +104,42 @@ [% END %] [% ELSIF ( CHUNK.type_languages ) %] -
- [% FOREACH language IN CHUNK.languages %] -
- [% IF ( language.plural ) %] -
- [% IF ( language.native_description ) %][% language.native_description | html %][% ELSE %][% language.rfc4646_subtag | html %][% END %] -
- [% FOREACH sublanguages_loo IN language.sublanguages_loop %] -
- - [% IF ( sublanguages_loo.enabled ) %] - - [% ELSE %] - - [% END %] -
- [% END %] - [% ELSE %] -
- - [% IF ( language.group_enabled ) %] - - [% ELSE %] - - [% END %] -
- [% END %] -
- [% END %] -
+
    + [% FOREACH language IN CHUNK.languages %] + [% IF ( language.plural ) %] +
  • + [% IF ( language.native_description ) %] + [% language.native_description | html %] + [% ELSE %] + [% language.rfc4646_subtag | html %] + [% END %] + [% IF language.sublanguages_loop.size > 0 %] +
      + [% FOREACH sublanguages_loo IN language.sublanguages_loop %] +
    • + + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] +
    • + [% END # FOREACH sublanguages %] +
    + [% END %] +
  • + [% ELSE %] +
  • + + [% IF ( language.group_enabled ) %] + + [% ELSE %] + + [% END %] +
  • + [% END # IF language.plural %] + [% END # FOREACH language %] +
[% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js index f7ed5e1121..97b564c260 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js @@ -82,8 +82,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(); } ); -- 2.39.5