From 1832b315e7dc35a755975d0bd635430ba865c84b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sat, 29 Apr 2017 09:27:01 +0000 Subject: [PATCH] Bug 17942 [Follow-up] Update style of the web installer with Bootstrap 3 This patch makes changes following QA comments: - Login error messages now have a style - Select all/Select none links should now be translatable - Date format hint now correctly detects date format preference - Unused JS is removed from onboarding.js This patch also modifies the 'category_code_check' validation method to allow numbers as well as letters. Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- .../intranet-tmpl/prog/css/installer.css | 2 +- .../prog/en/modules/installer/auth.tt | 8 +-- .../prog/en/modules/installer/step3.tt | 8 +-- .../en/modules/onboarding/onboardingstep2.tt | 17 ++--- koha-tmpl/intranet-tmpl/prog/js/onboarding.js | 62 +++++++------------ 5 files changed, 39 insertions(+), 58 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/installer.css b/koha-tmpl/intranet-tmpl/prog/css/installer.css index 7fe08a9c40..7d5d3d9fb7 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/installer.css +++ b/koha-tmpl/intranet-tmpl/prog/css/installer.css @@ -131,7 +131,7 @@ fieldset.rows span.label { fieldset.rows fieldset { background-color: transparent; - border-width: 1px; + font-size: 100%; margin: 1em; padding: .3em; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt index b9e93e32f3..41d2494a0e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt @@ -18,19 +18,19 @@

Koha

[% IF ( nopermission ) %] -
Error: Unauthorized user click to log out
+
Error: Unauthorized user click to log out
[% END %] [% IF ( timed_out ) %] -
Error: Session timed out, please log in again
+
Error: Session timed out, please log in again
[% END %] [% IF ( different_ip ) %] -
Error: IP address has changed, please log in again
+
Error: IP address has changed, please log in again
[% END %] [% IF ( invalid_username_or_password ) %] -
Error: Invalid username or password
+
Error: Invalid username or password
[% END %] [% IF ( loginprompt ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt index f499521bc9..34d5e7dd7e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -92,8 +92,8 @@

- Select all [% frameworksloo.label FILTER lower %] data - Select no [% frameworksloo.label FILTER lower %] data + Select all + Select none

[% FOREACH framework IN frameworksloo.frameworks %] @@ -127,8 +127,8 @@

- Select all [% levelloo.label FILTER lower %] data - Select no [% levelloo.label FILTER lower %] data + Select all + Select none

[% FOREACH framework IN levelloo.frameworks %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt index 8025415515..e58616aa75 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt @@ -89,7 +89,7 @@ [% END %]
- Controls how long a patrons checkout history is kept for new patrons of this category. "Never" anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob batch_anonymise.pl which should be set up by your system administrator. + Controls how long a patrons checkout history is kept for new patrons of this category. "Never" anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob batch_anonymise.pl which should be set up by your system administrator.
  • @@ -97,23 +97,24 @@
    1. - Choose one -
    2. -
    3. + Choose one +
    4. +
    5. - - -
      [% INCLUDE 'date-format.inc' %]
      + + +
      [% INCLUDE 'date-format.inc' dateformat = Koha.Preference('dateformat') %]
  • -

    To add another patron category and for more settings go to: +

    + To add another patron category and for more settings go to: Administration Patron categories

    diff --git a/koha-tmpl/intranet-tmpl/prog/js/onboarding.js b/koha-tmpl/intranet-tmpl/prog/js/onboarding.js index 9b1d13d0be..4816dfdfd7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/onboarding.js +++ b/koha-tmpl/intranet-tmpl/prog/js/onboarding.js @@ -1,23 +1,13 @@ function _(s) { return s; } // dummy function for gettext jQuery.validator.addMethod( "category_code_check", function(value,element){ - var patt = /^[A-Za-z]{0,10}$/g; + var patt = /^[A-Za-z0-9]{0,10}$/g; if (patt.test(element.value)) { return true; } else { return false; } - }, MSG_LETTERS_ONLY -); - -jQuery.validator.addMethod( "letters_only", function(value,element){ - var patt =/^[A-Za-z ]{0,30}$/g; - if (patt.test(element.value)){ - return true; - } else { - return false; - } - }, MSG_LETTERS_ONLY + }, MSG_LETTERS_NUMBERS_ONLY ); jQuery.validator.addMethod( "enrollment_period", function(){ @@ -45,16 +35,6 @@ jQuery.validator.addMethod( "password_match", function(value,element){ }, MSG_PASSWORD_MISMATCH ); -jQuery.validator.addMethod( "cardnumber_check", function(value,element){ - var patt =/[A-Za-z1-9 ]+$/g; - if (patt.test(element.value)){ - return true; - } else { - return false; - } - }, MSG_LETTERS_NUMBERS_ONLY -); - function toUC(f) { var x=f.value.toUpperCase(); f.value=x; @@ -76,48 +56,48 @@ $(document).ready(function() { $("#category_form").validate({ rules: { categorycode: { - required: true, - category_code_check: true + required: true, + category_code_check: true }, description: { required:true }, enrolmentperiod: { - required: function(element){ - return $("#enrolmentperioddate").val() === ""; - }, - digits: true, - enrollment_period: true, + required: function(element){ + return $("#enrolmentperioddate").val() === ""; + }, + digits: true, + enrollment_period: true, }, enrolmentperioddate: { - required: function(element){ - return $("#enrolmentperiod").val() === ""; - }, - enrollment_period: true, - // is_valid_date ($(#"enrolementperioddate").val()); + required: function(element){ + return $("#enrolmentperiod").val() === ""; + }, + enrollment_period: true, + // is_valid_date ($(#"enrolementperioddate").val()); }, dateofbirthrequired: { - digits: true + digits: true }, upperagelimit: { - digits: true + digits: true }, enrolmentfee: { - number: true + number: true }, reservefee: { - number: true + number: true }, category_type: { - required: true + required: true } }, messages: { enrolmentperiod: { - required: MSG_ONE_ENROLLMENTPERIOD + required: MSG_ONE_ENROLLMENTPERIOD }, enrolmentperioddate: { - required: MSG_ONE_ENROLLMENTPERIOD + required: MSG_ONE_ENROLLMENTPERIOD } } }); -- 2.39.5