Bug 17942 [Follow-up] Update style of the web installer with Bootstrap 3
authorOwen Leonard <oleonard@myacpl.org>
Sat, 29 Apr 2017 09:27:01 +0000 (09:27 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 9 May 2017 20:54:31 +0000 (20:54 +0000)
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 <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/css/installer.css
koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt
koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt
koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt
koha-tmpl/intranet-tmpl/prog/js/onboarding.js

index 7fe08a9..7d5d3d9 100644 (file)
@@ -131,7 +131,7 @@ fieldset.rows span.label {
 
 fieldset.rows fieldset {
     background-color: transparent;
-    border-width: 1px;
+    font-size: 100%;
     margin: 1em;
     padding: .3em;
 }
index b9e93e3..41d2494 100644 (file)
                 <h1 id="logo"><a href="#">Koha</a></h1>
 
                 [% IF ( nopermission ) %]
-                    <div id="login_error"><strong>Error: </strong>Unauthorized user <a href="/cgi-bin/koha/mainpage.pl?logout.x=1">click to log out</a></div>
+                    <div id="login_error" class="alert alert-danger"><strong>Error: </strong>Unauthorized user <a href="/cgi-bin/koha/mainpage.pl?logout.x=1">click to log out</a></div>
                 [% END %]
 
                 [% IF ( timed_out ) %]
-                <div id="login_error"><strong>Error: </strong>Session timed out, please log in again</div>
+                <div id="login_error" class="alert alert-danger"><strong>Error: </strong>Session timed out, please log in again</div>
                 [% END %]
 
                 [% IF ( different_ip ) %]
-                <div id="login_error"><strong>Error: </strong>IP address has changed, please log in again </div>
+                <div id="login_error" class="alert alert-danger"><strong>Error: </strong>IP address has changed, please log in again </div>
                 [% END %]
 
                 [% IF ( invalid_username_or_password ) %]
-                <div id="login_error"><strong>Error: </strong>Invalid username or password</div>
+                <div id="login_error" class="alert alert-danger"><strong>Error: </strong>Invalid username or password</div>
                 [% END %]
 
                 [% IF ( loginprompt ) %]
index f499521..34d5e7d 100644 (file)
@@ -92,8 +92,8 @@
                                 <div class="checkboxes">
 
                                     <p>
-                                        <a class="selectall [% frameworksloo.label FILTER lower %]" href="#">Select all [% frameworksloo.label FILTER lower %] data</a>
-                                        <a class="deselectall [% frameworksloo.label FILTER lower %]" href="#">Select no [% frameworksloo.label FILTER lower %] data</a>
+                                        <a class="selectall [% frameworksloo.label FILTER lower %]" href="#">Select all</a>
+                                        <a class="deselectall [% frameworksloo.label FILTER lower %]" href="#">Select none</a>
                                     </p>
 
                                     [% FOREACH framework IN frameworksloo.frameworks %]
                             <div class="checkboxes">
 
                                 <p>
-                                    <a class="selectall [% levelloo.label FILTER lower %]" href="#">Select all [% levelloo.label FILTER lower %] data</a>
-                                    <a class="deselectall [% levelloo.label FILTER lower %]" href="#">Select no [% levelloo.label FILTER lower %] data</a>
+                                    <a class="selectall [% levelloo.label FILTER lower %]" href="#">Select all</a>
+                                    <a class="deselectall [% levelloo.label FILTER lower %]" href="#">Select none</a>
                                 </p>
 
                                 [% FOREACH framework IN levelloo.frameworks %]
index 8025415..e58616a 100644 (file)
@@ -89,7 +89,7 @@
                                     [% END %]
                                 </select>
                                 <div class="hint">
-                                        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 <code>batch_anonymise.pl</code> 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 <code>batch_anonymise.pl</code> which should be set up by your system administrator.
                                 </div>
                             </li>
                             <li>
                                 <fieldset class="rows">
                                     <ol>
                                         <li>
-                                                <span class="label"> </span><strong>Choose one</strong>
-                                            </li>
-                                            <li>
+                                            <span class="label"></span><strong>Choose one</strong>
+                                        </li>
+                                        <li>
                                             <label for="enrolmentperiod">In months: </label>
                                             <input type="number" class="enrolmentperiod" name="enrolmentperiod" id="enrolmentperiod" min="0" size="3" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" />
                                         </li>
                                         <li>
-                                             <label for="enrolmentperioddate">Until date: </label>
-                                              <input type="text" class="enrolmentperioddate datepicker" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
-                                             <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
+                                            <label for="enrolmentperioddate">Until date: </label>
+                                            <input type="text" class="enrolmentperioddate datepicker" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
+                                             <div class="hint">[% INCLUDE 'date-format.inc' dateformat = Koha.Preference('dateformat') %]</div>
                                         </li>
                                     </ol>
                                 </fieldset>
                             </li>
                         </ol>
 
-                        <p> To add another patron category and for more settings go to:
+                        <p>
+                            To add another patron category and for more settings go to:
                             <span class="breadcrumbs"> Administration <b>&rsaquo;</b> Patron categories</span>
                         </p>
 
index 9b1d13d..4816dfd 100644 (file)
@@ -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
             }
         }
     });