From db8fec33805a13b4e3435b6d29e7ad84a198dcee Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 5 Apr 2018 11:53:07 +0000 Subject: [PATCH] Bug 20779: Style refresh for patron detail page This patch makes style and markup changes to the patron detail page template in order to make the display of information somewhat more compact and to increase the visibility of the edit controls. To test you should enable the patronimages system preference. Apply the patch and view the detail page for a patron. - Check that the page looks correct and that sections like "Alternate address" and "Alternative contact" are empty when there is no data. - Check that the "Manage patron image" tool works correctly. Signed-off-by: Mark Tompsett --- .../prog/en/modules/members/moremember.tt | 392 ++++++++++++--------- 1 file changed, 220 insertions(+), 172 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 4e748f6bbb..3692a204e0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -13,6 +13,11 @@ [% INCLUDE 'doc-head-close.inc' %] [% Asset.css("css/datatables.css") %] + @@ -136,7 +141,7 @@
-
+
[% IF ( patron.othernames ) %]“[% patron.othernames | html %]”[% END %]
@@ -232,114 +237,122 @@
[% # /div.rows %]
[% IF ( guarantor.borrowernumber ) %] - Edit + Edit [% ELSE %] - Edit + Edit [% END %]
-
[% # /div#patron-information %] [% IF ( patronimages ) %] [% IF ( CAN_user_tools_batch_upload_patron_images ) %] -
-
-
- [% IF ( patron.image ) %] - Manage patron image -
To update the image for [% patron.title | html %] [% patron.surname | html %], select a new image file and click 'Upload.'
Click the 'Delete' button to remove the current image. - [% ELSE %] - Upload patron image -
[% patron.title %] [% patron.firstname | html %] [% patron.surname | html %] does not currently have an image available. To import an image for [% patron.title %] [% patron.surname | html %], enter the name of an image file to upload. - [% END %] -
Only PNG, GIF, JPEG, XPM formats are supported. -
+
+ [% IF ( patron.image ) %] +

Manage patron image

+ Edit + [% ELSE %] +

Upload patron image

+ Add + [% END %] + + [% IF ( patron.image ) %] +
To update the image for [% patron.title | html %] [% patron.surname | html %], select a new image file and click 'Upload.'
Click the 'Delete' button to remove the current image.
+ [% ELSE %] +
[% patron.title %] [% patron.firstname | html %] [% patron.surname | html %] does not currently have an image available. To import an image for [% patron.title %] [% patron.surname | html %], enter the name of an image file to upload.
+ [% END %] +

Only PNG, GIF, JPEG, XPM formats are supported.

+ + +
+ -
    -
  1. - - -
  2. -
-
- - - - [% IF ( patron.image ) %] - Delete - [% END %] -
-
+ + + [% IF ( patron.image ) %] + Delete + [% END %] + Cancel +
[% # /div#manage-patron-image %] [% END %] [% END %] [% IF Koha.Preference('HouseboundModule') %] -
-

Housebound roles

-
-
    -
  1. - Chooser: - [% IF ( housebound_role.housebound_chooser == 1 ) %] - Yes - [% ELSE %] - No - [% END %] -
  2. -
  3. - Deliverer: - [% IF ( housebound_role.housebound_deliverer == 1 ) %] - Yes - [% ELSE %] - No - [% END %] -
  4. -
+
+ [% IF ( housebound_role.housebound_chooser == 1 OR housebound_role.housebound_deliverer == 1 ) %] +

Housebound roles

+
+
    +
  1. + Chooser: + [% IF ( housebound_role.housebound_chooser == 1 ) %] + Yes + [% ELSE %] + No + [% END %] +
  2. +
  3. + Deliverer: + [% IF ( housebound_role.housebound_deliverer == 1 ) %] + Yes + [% ELSE %] + No + [% END %] +
  4. +
+
+ -
-
- Edit -
+ [% ELSE %] +

Housebound roles

+ Add + [% END %] +
[% #/ div#houseboundroles %] [% END %] [% IF ( ExtendedPatronAttributes ) %] [% UNLESS ( no_patron_attribute_types ) %] -
-

Additional attributes and identifiers

- [% FOREACH attribute IN attributes_loop %] - [% IF attribute.class %] -
- [% ELSE %] -
+
+ [% IF ( attributes_loop ) %] +

Additional attributes and identifiers

+ [% FOREACH attribute IN attributes_loop %] + [% IF attribute.class %] +
+ [% ELSE %] +
+ [% END %] +

[% attribute.lib %]

+
    + [% FOREACH item IN attribute.items %] +
  1. + [% item.description %]: + [% IF ( item.value_description ) %] + [% item.value_description %] + [% ELSE %] + [% item.value| html_line_break %] + [% END %] +
  2. + [% END %] +
+
[% END %] -

[% attribute.lib %]

-
    - [% FOREACH item IN attribute.items %] -
  1. - [% item.description %]: - [% IF ( item.value_description ) %] - [% item.value_description %] - [% ELSE %] - [% item.value| html_line_break %] - [% END %] -
  2. - [% END %] -
+ + [% ELSE %] +

Additional attributes and identifiers

+ Add [% END %] -
-
- Edit -
+
[% # /div#patron-extended-attributes %] [% END %] [% END %] [% IF ( EnhancedMessagingPreferences ) %] -
+

Patron messaging preferences

[% INCLUDE 'messaging-preference-form.inc' %] [% IF ( SMSSendDriver ) %] @@ -352,16 +365,16 @@
[% END %] -
-
- Edit -
+
+ Edit +
+
[% # /div#patron-messaging-prefs %] [% END %]
[% # /div.yui-u.first %]
-
+

Library use

    @@ -499,101 +512,124 @@ [% END %]
[% # /div.rows %] +
+ Edit +
[% # /div#patron-library-details %] -
- Edit -
-
-

Alternate address

+
+ [% IF ( patron.B_phone || patron.B_email || patron.contactnote || patron.B_address || patron.B_address2 || patron.B_city || patron.B_zipcode || patron.B_country ) %] +

Alternate address

- [% IF Koha.Preference( 'AddressFormat' ) %] - [% INCLUDE "member-display-alt-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] + [% IF Koha.Preference( 'AddressFormat' ) %] + [% INCLUDE "member-display-alt-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] + [% ELSE %] + [% INCLUDE 'member-display-alt-address-style-us.inc' %] + [% END %] + +
+
    + [% IF ( patron.B_phone ) %] +
  1. + Phone: + [% patron.B_phone |html %] +
  2. + [% END %] + + [% IF ( patron.B_email ) %] + + [% END %] + + [% IF ( patron.contactnote ) %] +
  3. + Contact note: + [% patron.contactnote |html %] +
  4. + [% END %] +
+
+
+ Edit +
[% ELSE %] - [% INCLUDE 'member-display-alt-address-style-us.inc' %] +

Alternate address

+ Add [% END %] - -
-
    - [% IF ( patron.B_phone ) %] -
  1. - Phone: - [% patron.B_phone |html %] -
  2. - [% END %] - [% IF ( patron.B_email ) %] - - [% END %] - [% IF ( patron.contactnote ) %] -
  3. - Contact note: - [% patron.contactnote |html %] -
  4. - [% END %] -
-
[% # /div#patron-alternate-address %] -
- Edit -
-
-

Alternative contact

-
-
    -
  1. - Surname: - [% patron.altcontactsurname | html %] -
  2. -
  3. - First name: - [% patron.altcontactfirstname | html %] -
  4. -
  5. - Address: - [% patron.altcontactaddress1 | html %] -
  6. -
  7. - Address 2: - [% patron.altcontactaddress2 | html %] -
  8. -
  9. - City: - [% patron.altcontactaddress3 | html %] -
  10. - - [% IF ( patron.altcontactstate ) %] -
  11. - State: - [% patron.altcontactstate | html %] -
  12. - [% END %] +
    + [% IF ( patron.altcontactsurname || patron.altcontactfirstname || patron.altcontactaddress1 || patron.altcontactaddress2 || patron.altcontactaddress3 || patron.altcontactstate || patron.altcontactzipcode || patron.altcontactcountry || patron.altcontactphone ) %] +

    Alternative contact

    +
    +
      + [% IF ( patron.altcontactsurname ) %] +
    1. + Surname: + [% patron.altcontactsurname | html %] +
    2. + [% END %] + [% IF ( patron.altcontactfirstname ) %] +
    3. + First name: + [% patron.altcontactfirstname | html %] +
    4. + [% END %] + [% IF ( patron.altcontactaddress1 ) %] +
    5. + Address: + [% patron.altcontactaddress1 | html %] +
    6. + [% END %] + [% IF ( patron.altcontactaddress2 ) %] +
    7. + Address 2: + [% patron.altcontactaddress2 | html %] +
    8. + [% END %] + [% IF ( patron.altcontactaddress3 ) %] +
    9. + City: + [% patron.altcontactaddress3 | html %] +
    10. + [% END %] -
    11. - ZIP/Postal code: - [% patron.altcontactzipcode | html %] -
    12. - [% IF ( patron.altcontactcountry ) %] -
    13. - Country: - [% patron.altcontactcountry | html %] -
    14. - [% END %] - [% IF ( patron.altcontactphone ) %] -
    15. - Phone: - [% patron.altcontactphone | html %] -
    16. - [% END %] -
    -
    [% # /div.rows %] + [% IF ( patron.altcontactstate ) %] +
  13. + State: + [% patron.altcontactstate | html %] +
  14. + [% END %] + [% IF ( patron.altcontactzipcode ) %] +
  15. + ZIP/Postal code: + [% patron.altcontactzipcode | html %] +
  16. + [% END %] + [% IF ( patron.altcontactcountry ) %] +
  17. + Country: + [% patron.altcontactcountry | html %] +
  18. + [% END %] + [% IF ( patron.altcontactphone ) %] +
  19. + Phone: + [% patron.altcontactphone | html %] +
  20. + [% END %] +
+
[% # /div.rows %] +
+ Edit +
+ [% ELSE %] +

Alternative contact

+ Add + [% END %]
[% # /div#patron-alternative-contact %] -
- Edit -
[% # /div.yui-u %]
[% # /div.yui-g %] @@ -835,6 +871,18 @@ $("#view_restrictions").on("click",function(){ $('#debarments-tab-link').click(); }); + + $("#show-picture-upload").on("click", function(e){ + e.preventDefault(); + $(this).toggle(); + $("#picture-upload").toggle(); + }); + + $("#cancel-picture-upload").on("click", function(e){ + e.preventDefault(); + $("#picture-upload, #show-picture-upload").toggle(); + }); + }); function uncheck_sibling(me){ nodename=me.getAttribute("name"); -- 2.11.0