From 10faf56c8eac5d9e9c1c8bddd267460f72116284 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 25 Feb 2019 16:28:10 +0000 Subject: [PATCH] Bug 22408: Subscription entry form cleanup This patch makes a number of changes to the subscription entry form: - Make the default layout single-column. - Switch the layout to two-column only when testing prediction pattern. - Add a button to hide the prediction pattern test pane. - Change the style of some buttons and links. Add Font Awesome icons to some. - Clean up some issues with capitalization and spacing. - Make it clearer when form fields are read-only: Move "locked" form field style from addbiblio.css to staff-global.css and improve it with regard to mouse interactions To test, apply the patch and regenerate the staff client CSS. Clear your browser cache if necessary. - Go to Serials -> New subscription. - Readonly fields under "Vendor" and "Record" should show a small padlock icon. - Test the process of adding a subscription, paying special attention to the advanced pattern controls: Showing, hiding, modifying, canceling. - Test the process of editing a subscription in the same way. Signed-off-by: Michal Denar Signed-off-by: Nick Clemens --- .../intranet-tmpl/prog/css/addbiblio.css | 1 - .../prog/css/src/staff-global.scss | 28 +++- .../modules/serials/showpredictionpattern.tt | 4 + .../en/modules/serials/subscription-add.tt | 126 ++++++++++-------- .../intranet-tmpl/prog/js/subscription-add.js | 19 ++- 5 files changed, 112 insertions(+), 66 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css index 03dd04bb8f..c31b7aa9a7 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css +++ b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css @@ -135,7 +135,6 @@ a.tagnum { .linktools a:first-child { border-bottom: 1px solid #DDD; } .linktools a:hover { background-color: #FFC; } .subfield_controls { margin : 0 .5em; } -.readonly { border-width : 1px; border-style: inset; padding-left : 15px; background: #EEE url(../img/locked.png) center left no-repeat; width:29em; } #cataloguing_additem_itemlist { margin-bottom : 1em; diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 7327eb3e7d..c0f13aed81 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -343,6 +343,10 @@ th { font-weight: bold; text-align: center; + &[scope="row"] { + text-align: right; + } + &.data { font-family: $font-monospace; text-align: right; @@ -1019,7 +1023,7 @@ fieldset { div { &.hint { - margin-bottom: .4em; + margin: .5em 0; margin-left: 10.5em; } } @@ -1074,6 +1078,7 @@ fieldset { } &.radio { + margin: 0; padding-left: 9em; width: auto; @@ -1893,6 +1898,21 @@ dd { } } +.readonly, +input[type='text']:read-only { + background: #EEE url("../img/locked.png") center left no-repeat; + border-style: inset; + border-width: 1px; + cursor: default; + padding-left: 15px; +} + +.readonly:focus, +input[type='text']:read-only:focus { + border-color: unset; + border-radius: unset; +} + .checkedout { color: #999999; font-style: italic; @@ -2439,12 +2459,6 @@ li { font-style: italic; } -#displayexample { - background-color: #CCCCCC; - margin-bottom: 10px; - padding: 5px; -} - #irregularity_summary { vertical-align: top; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt index d99b946b31..c684348deb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt @@ -84,4 +84,8 @@ +
+ +
+ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index 0f056f0bd1..eff55ae7da 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -14,6 +14,7 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ /* Prevents Bootstrap menus from being hidden inside modal */ #mana_search_result .modal { overflow: visible; } #mana_search_result .modal-body { overflow-y: visible; } +fieldset.rows table { clear: none; margin: 0; } @@ -32,35 +33,36 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
-
-

[% IF ( modify ) %] Modify subscription for [% bibliotitle | html %][% ELSE %]Add a new subscription[% END %] (1/2)

-
-
- [% IF ( modify ) %] - - - [% ELSE %] - - [% END %] - - - -
-
+
+

[% IF ( modify ) %] Modify subscription for [% bibliotitle | html %][% ELSE %]Add a new subscription[% END %] (1/2)

+
+
+ +
+
+ [% IF ( modify ) %] + + + [% ELSE %] + + [% END %] + +
Subscription details
    [% IF ( subscriptionid ) %] -
  1. Subscription # [% subscriptionid | html %]
  2. +
  3. Subscription number: [% subscriptionid | html %]
  4. [% END %]
  5. () Search for a vendor
  6. - + () Required +
    Subscriptions must be associated with a bibliographic record
    Search for record [% IF ( CAN_user_editcatalogue ) %] [% IF ( modify ) %] @@ -73,11 +75,11 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
  7. [% IF ( serialsadditems ) %] -

    -

    +

    +

    [% ELSE %] -

    -

    +

    +

    [% END %]
  8. @@ -116,7 +118,7 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
  9. - [% UNLESS ( Independentbranches ) %] [% END %] @@ -125,7 +127,7 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ [% ELSE %] [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %] [% END %] - (select a library) +
  10. @@ -210,13 +212,12 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
- +
-
-
- -
-
+
+
+
+
[% IF ( Koha.Preference('Mana') == 1) && !mana_url %]

The Mana Knowledge Base can be used to import subscription patterns submitted by other libraries and save you extra work. Ask your system administrator to configure this service and complete the configuration, or remove this message by disabling the system preference @@ -235,8 +236,9 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ [% ELSE %] [% firstacquidate | $KohaDates %] - + [% END %] + Required [% IF (more_than_one_serial) %]
  • @@ -315,6 +317,7 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ [% END %] + Required
  • @@ -328,9 +331,10 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ [% END %] [% END %] - If empty, English is used +
    If empty, English is used
  • +   @@ -342,19 +346,19 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ - - + @@ -363,23 +367,27 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
    + [% IF (more_than_one_serial) %] - Last value + Last value: [% ELSE %] - Begins with + Begins with: [% END %] - +
    Inner counterInner counter:
  • +   Show advanced pattern
  • + + - + +
  • +   + Modify pattern + + +
  • + +
    +
    +
    [% IF additional_fields %] @@ -469,16 +484,15 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
    - - +
    -
  • +
    -
    +
    diff --git a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js index d82b875dbf..4c6bf22c29 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js +++ b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js @@ -210,7 +210,7 @@ function displaymoreoptions() { } function modifyAdvancedPattern() { - $("#patternname").prop('readOnly', false).val(''); + $("#patternname").prop('readOnly', false).val('').focus(); $("#numberingmethod").prop('readOnly', false); $("#advancedpredictionpatternt input").each(function() { @@ -318,7 +318,7 @@ function testPredictionPattern() { url:"/cgi-bin/koha/serials/showpredictionpattern.pl", data: ajaxData, success: function(data) { - $("#displayexample").html(data).show(); + showPredictionPatternTest( data ); patternneedtobetested = 0; } }); @@ -519,6 +519,16 @@ function mana_comment_close(){ $("#new_mana_comment").hide(); } +function showPredictionPatternTest( data ){ + $("#displayexample").html(data).show(); + $("#page_2 > div").attr("class","col-xs-6"); +} + +function hidePredcitionPatternTest(){ + $("#displayexample").hide(); + $("#page_2 > div").attr("class","col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2"); +} + $(document).ready(function() { if ( mana_enabled == 1 ) { mana_search(); @@ -679,4 +689,9 @@ $(document).ready(function() { var subscription_id = $(this).data("subscription_id"); mana_use( subscription_id ); }); + + $("#displayexample").on("click", "#hidepredictionpattern", function(e){ + e.preventDefault(); + hidePredcitionPatternTest(); + }); }); -- 2.39.5