From 5d52a6a22b26d32ae105e5ae6f9121ae8d3b1b40 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sat, 29 Apr 2017 08:40:26 +0000 Subject: [PATCH] [SIGNED-OFF] Bug 18529 - Template cleanup of patron clubs pages This patch addresses template issues with the newly-added patron clubs pages. - Move Clubs tab out of second position in Circulation page tabs. - Link patron name in enrollments list to the patron record - Make page titles on some pages more specific - Correct label "for" attributes so that it matches input id - Correst style of buttons: Buttons in tables must be "btn-xs," all Bootstrap buttons must have "btn-default." - Correct "Edit" icons: Should be "fa-pencil" This patch also revises the club template editing form to make it more consistent with similar interfaces in Koha and (hopefully) make it more clear. To test, apply the patch and test adding clubs and club templates and enrolling patrons in clubs via the staff client and OPAC. Confirm that everything looks and work okay. Signed-off-by: Josef Moravec --- koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 10 +- .../prog/en/modules/circ/circulation.tt | 21 +- .../prog/en/modules/clubs/club-enrollments.tt | 9 +- .../prog/en/modules/clubs/clubs-add-modify.tt | 201 ++++++------ .../intranet-tmpl/prog/en/modules/clubs/clubs.tt | 51 +-- .../prog/en/modules/clubs/patron-clubs-tab.tt | 25 +- .../prog/en/modules/clubs/patron-enroll.tt | 4 +- .../prog/en/modules/clubs/templates-add-modify.tt | 348 +++++++++++---------- .../bootstrap/en/modules/clubs/clubs-tab.tt | 24 +- .../opac-tmpl/bootstrap/en/modules/clubs/enroll.tt | 2 +- 10 files changed, 366 insertions(+), 329 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css index 175fce8..fc5a854 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css @@ -585,8 +585,14 @@ fieldset.brief ol, fieldset.brief li { font-size : 95%; } -fieldset.brief div.hint, fieldset.rows div.hint, div.yui-u div.hint { - margin-bottom : .4em; +fieldset.brief div.hint, +fieldset.rows div.hint, +div.yui-u div.hint { + margin-bottom : .4em; +} + +fieldset.rows div.hint { + margin-left : 7.5em; } div.yui-b fieldset.brief { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index e133b95..d6f94fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -895,16 +895,6 @@ No patron matched [% message | html %] [% END %] - [% SET enrollments = patron.get_club_enrollments(1) %] - [% SET enrollable = patron.get_enrollable_clubs(0,1) %] - [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %] -
  • - - Clubs ([% enrollments.count %]/[% enrollable.count %]) - -
  • - [% END %] - [% IF relatives_issues_count %]
  • Relatives' checkouts
  • [% END %] @@ -924,6 +914,17 @@ No patron matched [% message | html %] [% END %]
  • [% debarments.count %] Restrictions
  • + + [% SET enrollments = patron.get_club_enrollments(1) %] + [% SET enrollable = patron.get_enrollable_clubs(0,1) %] + [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %] +
  • + + Clubs ([% enrollments.count %]/[% enrollable.count %]) + +
  • + [% END %] + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt index 738b05f..94e7148 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt @@ -40,7 +40,6 @@ Name Card number -   @@ -49,17 +48,11 @@ [% SET p = e.patron %] - [% p.firstname %] [% p.surname %] + [% p.surname %], [% p.firstname %] [% p.cardnumber %] - - - - View patron - - [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt index 51f4a59..ec76ded 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt @@ -3,7 +3,13 @@ [% USE AuthorisedValues %] [% SET AuthorisedValuesCategories = AuthorisedValues.GetCategories %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Tools › Patron clubs › Club +Koha › Tools › Patron clubs › + [% IF club %] + Modify club [% club.name %] + [% ELSE %] + Create a new [% club_template.name %] club + [% END %] + [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'calendar.inc' %] @@ -11,105 +17,112 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] - - -
    -
    -
    - - - -
    - - - [% IF club %] - Modify club [% club.name %] - [% ELSE %] - Create a new [% club_template.name %] club - [% END %] - - -
      -
    1. - - - Required -
    2. - -
    3. - - -
    4. - -
    5. - - -
    6. - -
    7. - - -
    8. - -
    9. - - -
    10. - - [% IF club %] - [% FOREACH f IN club.club_fields %] -
    11. - - - - - [% IF f.club_template_field.authorised_value_category %] - + + +
      + + + [% IF club %] + Modify club [% club.name %] + [% ELSE %] + Create a new [% club_template.name %] club + [% END %] + + +
        +
      1. + + + Required +
      2. + +
      3. + + +
      4. + +
      5. + + +
      6. + +
      7. + + +
      8. + +
      9. + + +
      10. + + [% IF club %] + [% FOREACH f IN club.club_fields %] +
      11. + + + + + [% IF f.club_template_field.authorised_value_category %] + + [% ELSE %] + + [% END %] +
      12. + [% END %] + [% ELSE %] + [% FOREACH f IN club_template.club_template_fields %] +
      13. + + + + [% IF f.authorised_value_category %] + - [% ELSE %] - - [% END %] -
      14. + + [% ELSE %] + + [% END %] + + [% END %] [% END %] - [% ELSE %] - [% FOREACH f IN club_template.club_template_fields %] -
      15. - - - - [% IF f.authorised_value_category %] - - [% ELSE %] - - [% END %] -
      16. - [% END %] - [% END %] -
      +
    -
    + -
    - - Cancel -
    -
    +
    + + Cancel +
    + +
    - [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt index 3727423..6c90814 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt @@ -15,7 +15,7 @@ "sPaginationType": "four_button", "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', "aoColumnDefs": [ - { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, + { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, ] } )); @@ -23,7 +23,7 @@ "sPaginationType": "four_button", "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', "aoColumnDefs": [ - { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, + { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false }, ] } )); }); @@ -102,7 +102,7 @@ [% IF CAN_user_clubs_edit_templates %] [% END %] @@ -143,14 +143,14 @@ [% Branches.GetName( t.branchcode ) %] [% IF CAN_user_clubs_edit_templates %] - - Edit + + Edit [% END %] [% IF CAN_user_clubs_edit_templates %] - + Delete [% END %] @@ -173,9 +173,9 @@
    [% IF club_templates %] - + [% ELSE %] - + [% END %]
    -
    + + +
    [% INCLUDE 'tools-menu.inc' %]
    - - + + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt index 30cb710..af078b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt @@ -1,14 +1,11 @@ [% USE KohaDates %] [% IF enrollments %] +

    Clubs currently enrolled in

    + - - - @@ -24,9 +21,9 @@ [% IF CAN_user_clubs_enroll %] [% END %] @@ -36,14 +33,12 @@ [% END %] [% IF clubs %] + +

    Clubs not enrolled in

    +
    - Clubs currently enrolled in -
    Name Description Date enrolled[% e.date_enrolled | $KohaDates %] - +
    - - - [% IF CAN_user_clubs_enroll %][% END %] @@ -56,10 +51,10 @@ [% IF CAN_user_clubs_enroll %] - [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt index 5b938d8..db3d544 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt @@ -28,8 +28,8 @@ [% END %]
  • - Finish enrollment - Cancel + Finish enrollment + Cancel
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt index 16d0106..e90a5dc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt @@ -1,165 +1,194 @@ [% USE Branches %] [% USE AuthorisedValues %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Tools › Patron clubs › Club template +Koha › Tools › Patron clubs › + [% IF club_template %] + Modify club template [% club_template.name %] + [% ELSE %] + Create a new club template + [% END %] + [% INCLUDE 'doc-head-close.inc' %] + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] - - -
    -
    -
    - + -
    +
    +
    +
    + + - +

    [% IF club_template %] Modify club template [% club_template.name %] [% ELSE %] Create a new club template [% END %] - - -
      -
    1. - - - Required -
    2. - -
    3. - - -
    4. - -
    5. - - [% IF club_template.is_enrollable_from_opac %] - - [% ELSE %] - +

    + + +
    +
      +
    1. + + + Required +
    2. + +
    3. + + +
    4. + +
    5. + + [% IF club_template.is_enrollable_from_opac %] + + [% ELSE %] + + [% END %] + If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog. +
    6. + +
    7. + + [% IF club_template.is_email_required %] + + [% ELSE %] + + [% END %] + If set, a club based on this template can only be enrolled in by patrons with a valid email address. +
    8. + +
    9. + + +
      If set, only librarians logged in with this branch will be able to modify this club template.
      +
    10. + +
    +
    + +
    + Club fields: +

    These fields will be used in the creation of clubs based on this template

    +
    + [% FOREACH f IN club_template.club_template_fields %] +
    +
      + +
    1. + + +
    2. + +
    3. + + +
    4. + +
    5. + + +
    6. + +
    7. + + +
    8. +
    +
    [% END %] - If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog. - - -
  • - - [% IF club_template.is_email_required %] - - [% ELSE %] - +
  • +
    + + Add new field + +
    +
    + +
    + Enrollment fields +

    These fields will be used when enrolling a patron in a club based on this template

    +
    + [% FOREACH f IN club_template.club_template_enrollment_fields %] +
    +
      +
    1. +   + Enrollment field +
    2. +
    3. + + + +
    4. + +
    5. + + +
    6. + +
    7. + + +
    8. + +
    9. + + +
    10. +
    +
    [% END %] - If set, a club based on this template can only be enrolled in by patrons with a valid email address. - - -
  • - - - If set, only librarians logged in with this branch will be able to modify this club template. -
  • - - - -

    Club fields:

    -

    These fields will be used in the creation of clubs based on this template

    - - [% FOREACH f IN club_template.club_template_fields %] -
      - -
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
      -
    - [% END %] -
    - - -

    Enrollment fields:

    -

    These fields will be used when enrolling a patron in a club based on this template

    - - [% FOREACH f IN club_template.club_template_enrollment_fields %] -
      - -
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
      -
    - [% END %] -
    - - -
    - -
    - - - Cancel -
    - -
    -
    - -
    +
    + + Add new field + +
    +
    + +
    + + + Cancel +
    + + +
    +
    + + + - Cancel - -
    - - - - + +
    Delete field
    + + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt index cc604b6..1c5580a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt @@ -1,14 +1,12 @@ [% USE KohaDates %] [% IF enrollments %] + +

    Clubs currently enrolled in

    +
    - Clubs not enrolled in -
    Name Description [% c.name %] [% c.description %] - + +
    - - - @@ -24,9 +22,9 @@ [% IF e.club.club_template.is_enrollable_from_opac %] [% END %] @@ -36,14 +34,12 @@ [% END %] [% IF clubs %] + +

    Clubs you can enroll in

    +
    - Clubs you are currently enrolled in -
    Name Description Date enrolled[% e.date_enrolled | $KohaDates %] - +
    - - - @@ -57,9 +53,9 @@
    - Clubs you can enroll in -
    Name Description  [% c.description %] [% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && borrower.first_valid_email_address ) %] - + [% ELSE %] You must have an email address to enroll [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt index 2c53918..3d9d684 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt @@ -28,7 +28,7 @@ [% END %]
  • - Finish enrollment + Cancel
  • -- 2.1.4