Bugzilla – Attachment 75436 Details for
Bug 20779
Style refresh for patron detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20779 - Style refresh for patron detail page
Bug-20779---Style-refresh-for-patron-detail-page.patch (text/plain), 34.92 KB, created by
Owen Leonard
on 2018-05-18 14:18:47 UTC
(
hide
)
Description:
Bug 20779 - Style refresh for patron detail page
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-05-18 14:18:47 UTC
Size:
34.92 KB
patch
obsolete
>From ea8bbe97093f30c69e42b6aaa7a0748e757d1834 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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. >--- > .../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 daf7c5b..228ff37 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 @@ > </title> > [% INCLUDE 'doc-head-close.inc' %] > [% Asset.css("css/datatables.css") %] >+<style> >+ input[type="file"] { display: inline-block; } >+ .patroninfo-section { padding: .5em; margin: .5em; } >+ .patroninfo-section .action { background-color: rgba(237, 244, 246, .4); text-align: right; } >+</style> > </head> > > <body id="pat_moremember" class="pat"> >@@ -136,7 +141,7 @@ > </h3> > <div class="yui-u first"> > >- <div id="patron-information" style="padding : .5em;"> >+ <div id="patron-information" class="patroninfo-section"> > [% IF ( patron.othernames ) %]“[% patron.othernames | html %]”[% END %] > > <div class="address"> >@@ -232,114 +237,122 @@ > </div> [% # /div.rows %] > <div class="action"> > [% IF ( guarantor.borrowernumber ) %] >- <a href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=1&guarantorid=[% guarantor.borrowernumber %]">Edit</a> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=1&guarantorid=[% guarantor.borrowernumber %]"><i class="fa fa-pencil"></i> Edit</a> > [% ELSE %] >- <a href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=1">Edit</a> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=1"><i class="fa fa-pencil"></i> Edit</a> > [% END %] > </div> >- > </div> [% # /div#patron-information %] > > [% IF ( patronimages ) %] > [% IF ( CAN_user_tools_batch_upload_patron_images ) %] >- <div id="manage-patron-image"> >- <form method="post" action="/cgi-bin/koha/tools/picture-upload.pl" enctype="multipart/form-data"> >- <fieldset class="brief"> >- [% IF ( patron.image ) %] >- <legend>Manage patron image</legend> >- <div class="hint">To update the image for [% patron.title | html %] [% patron.surname | html %], select a new image file and click 'Upload.' <br />Click the 'Delete' button to remove the current image. >- [% ELSE %] >- <legend>Upload patron image</legend> >- <div class="hint">[% 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 %] >- <br />Only PNG, GIF, JPEG, XPM formats are supported. >- </div> >+ <div id="manage-patron-image" class="patroninfo-section"> >+ [% IF ( patron.image ) %] >+ <h3 class="inline">Manage patron image</h3> >+ <a class="btn btn-default btn-xs" id="show-picture-upload" href="#"><i class="fa fa-pencil"></i> Edit</a> >+ [% ELSE %] >+ <h3 class="inline">Upload patron image</h3> >+ <a class="btn btn-default btn-xs" id="show-picture-upload" href="#"><i class="fa fa-plus"></i> Add</a> >+ [% END %] >+ <form method="post" id="picture-upload" style="display:none;" action="/cgi-bin/koha/tools/picture-upload.pl" enctype="multipart/form-data"> >+ [% IF ( patron.image ) %] >+ <div class="hint">To update the image for [% patron.title | html %] [% patron.surname | html %], select a new image file and click 'Upload.' <br />Click the 'Delete' button to remove the current image.</div> >+ [% ELSE %] >+ <div class="hint">[% 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.</div> >+ [% END %] >+ <p>Only PNG, GIF, JPEG, XPM formats are supported.</p> >+ <label for="uploadfile">Select the file to upload: </label> >+ <input type="file" id="uploadfile" name="uploadfile" required="required" /> >+ <div class="action"> >+ <input type="hidden" name="csrf_token" value="[% csrf_token %]" /> > <input type="hidden" id="image" name="filetype" value="image" /> > <input type="hidden" id="cardnumber" name="cardnumber" value="[% patron.cardnumber | html %]" /> > <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" /> >- <ol> >- <li> >- <label for="uploadfile">Select the file to upload: </label> >- <input type="file" id="uploadfile" name="uploadfile" /> >- </li> >- </ol> >- <fieldset class="action"> >- <input type="hidden" name="csrf_token" value="[% csrf_token %]" /> >- <input type="submit" value="Upload" class="submit" /> >- <input name="op" type="hidden" value="Upload" /> >- [% IF ( patron.image ) %] >- <a id="delpicture" href="/cgi-bin/koha/tools/picture-upload.pl?op=Delete&borrowernumber=[% patron.borrowernumber %]&csrf_token=[% csrf_token %]" class="delete">Delete</a> >- [% END %] >- </fieldset> >- </fieldset> >+ <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-upload"></i> Upload</button> >+ <input name="op" type="hidden" value="Upload" /> >+ [% IF ( patron.image ) %] >+ <a id="delpicture" href="/cgi-bin/koha/tools/picture-upload.pl?op=Delete&borrowernumber=[% patron.borrowernumber %]&csrf_token=[% csrf_token %]" class="btn btn-default btn-xs delete"><i class="fa fa-trash"></i> Delete</a> >+ [% END %] >+ <a href="#" id="cancel-picture-upload" class="cancel">Cancel</a> >+ </div> > </form> > </div> [% # /div#manage-patron-image %] > [% END %] > [% END %] > > [% IF Koha.Preference('HouseboundModule') %] >- <div id="houseboundroles"> >- <h3>Housebound roles</h3> >- <div class="rows"> >- <ol> >- <li> >- <span class="label">Chooser:</span> >- [% IF ( housebound_role.housebound_chooser == 1 ) %] >- Yes >- [% ELSE %] >- No >- [% END %] >- </li> >- <li> >- <span class="label">Deliverer:</span> >- [% IF ( housebound_role.housebound_deliverer == 1 ) %] >- Yes >- [% ELSE %] >- No >- [% END %] >- </li> >- </ol> >+ <div id="houseboundroles" class="patroninfo-section"> >+ [% IF ( housebound_role.housebound_chooser == 1 OR housebound_role.housebound_deliverer == 1 ) %] >+ <h3>Housebound roles</h3> >+ <div class="rows"> >+ <ol> >+ <li> >+ <span class="label">Chooser:</span> >+ [% IF ( housebound_role.housebound_chooser == 1 ) %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </li> >+ <li> >+ <span class="label">Deliverer:</span> >+ [% IF ( housebound_role.housebound_deliverer == 1 ) %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </li> >+ </ol> >+ </div> >+ <div class="action"> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=4"><i class="fa fa-pencil"></i> Edit</a> > </div> >- </div> >- <div class="action"> >- <a href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=4">Edit</a> >- </div> >+ [% ELSE %] >+ <h3 class="inline">Housebound roles</h3> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=4"><i class="fa fa-plus"></i> Add</a> >+ [% END %] >+ </div> [% #/ div#houseboundroles %] > [% END %] > > [% IF ( ExtendedPatronAttributes ) %] > [% UNLESS ( no_patron_attribute_types ) %] >- <div id="patron-extended-attributes" style="padding-top: 1em;"> >- <h3>Additional attributes and identifiers</h3> >- [% FOREACH attribute IN attributes_loop %] >- [% IF attribute.class %] >- <div id="aai_[% attribute.class %]" class="rows"> >- [% ELSE %] >- <div id="aai" class="rows"> >+ <div id="patron-extended-attributes" class="patroninfo-section"> >+ [% IF ( attributes_loop ) %] >+ <h3>Additional attributes and identifiers</h3> >+ [% FOREACH attribute IN attributes_loop %] >+ [% IF attribute.class %] >+ <div id="aai_[% attribute.class %]" class="rows"> >+ [% ELSE %] >+ <div id="aai" class="rows"> >+ [% END %] >+ <h4>[% attribute.lib %]</h4> >+ <ol> >+ [% FOREACH item IN attribute.items %] >+ <li> >+ <span class="label">[% item.description %]: </span> >+ [% IF ( item.value_description ) %] >+ [% item.value_description %] >+ [% ELSE %] >+ [% item.value| html_line_break %] >+ [% END %] >+ </li> >+ [% END %] >+ </ol> >+ </div> > [% END %] >- <h4>[% attribute.lib %]</h4> >- <ol> >- [% FOREACH item IN attribute.items %] >- <li> >- <span class="label">[% item.description %]: </span> >- [% IF ( item.value_description ) %] >- [% item.value_description %] >- [% ELSE %] >- [% item.value| html_line_break %] >- [% END %] >- </li> >- [% END %] >- </ol> >+ <div class="action"> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=4"><i class="fa fa-pencil"></i> Edit</a> > </div> >+ [% ELSE %] >+ <h3 class="inline">Additional attributes and identifiers</h3> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=4"><i class="fa fa-plus"></i> Add</a> > [% END %] >- </div> >- <div class="action"> >- <a href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=4">Edit</a> >- </div> >+ </div> [% # /div#patron-extended-attributes %] > [% END %] > [% END %] > > [% IF ( EnhancedMessagingPreferences ) %] >- <div id="patron-messaging-prefs" style="padding-top: 1em;"> >+ <div id="patron-messaging-prefs" class="patroninfo-section"> > <h3>Patron messaging preferences</h3> > [% INCLUDE 'messaging-preference-form.inc' %] > [% IF ( SMSSendDriver ) %] >@@ -352,16 +365,16 @@ > </ol> > </div> > [% END %] >- </div> >- <div class="action"> >- <a href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=5">Edit</a> >- </div> >+ <div class="action"> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=5"><i class="fa fa-pencil"></i> Edit</a> >+ </div> >+ </div> [% # /div#patron-messaging-prefs %] > [% END %] > > </div> [% # /div.yui-u.first %] > > <div class="yui-u"> >- <div id="patron-library-details"> >+ <div id="patron-library-details" class="patroninfo-section"> > <h3>Library use</h3> > <div class="rows"> > <ol> >@@ -499,101 +512,124 @@ > [% END %] > </ol> > </div> [% # /div.rows %] >+ <div class="action"> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=3"><i class="fa fa-pencil"></i> Edit</a> >+ </div> > </div> [% # /div#patron-library-details %] >- <div class="action"> >- <a href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=3">Edit</a> >- </div> > >- <div id="patron-alternate-address" style="padding-top: 1em;"> >- <h3>Alternate address</h3> >+ <div id="patron-alternate-address" class="patroninfo-section"> >+ [% IF ( patron.B_phone || patron.B_email || patron.contactnote || patron.B_address || patron.B_address2 || patron.B_city || patron.B_zipcode || patron.B_country ) %] >+ <h3>Alternate address</h3> > >- [% 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 %] >+ >+ <div class="rows"> >+ <ol> >+ [% IF ( patron.B_phone ) %] >+ <li> >+ <span class="label">Phone: </span> >+ <a href="tel:[% patron.B_phone %]">[% patron.B_phone |html %]</a> >+ </li> >+ [% END %] >+ >+ [% IF ( patron.B_email ) %] >+ <li class="email"> >+ <span class="label">Email: </span> >+ <a title="[% patron.B_email %]" href="mailto:[% patron.B_email | url %]">[% B_email |html %]</a> >+ </li> >+ [% END %] >+ >+ [% IF ( patron.contactnote ) %] >+ <li> >+ <span class="label">Contact note: </span> >+ [% patron.contactnote |html %] >+ </li> >+ [% END %] >+ </ol> >+ </div> >+ <div class="action"> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=6"><i class="fa fa-pencil"></i> Edit</a> >+ </div> > [% ELSE %] >- [% INCLUDE 'member-display-alt-address-style-us.inc' %] >+ <h3 class="inline">Alternate address</h3> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=6"><i class="fa fa-plus"></i> Add</a> > [% END %] >- >- <div class="rows"> >- <ol> >- [% IF ( patron.B_phone ) %] >- <li> >- <span class="label">Phone: </span> >- <a href="tel:[% patron.B_phone %]">[% patron.B_phone |html %]</a> >- </li> >- [% END %] >- [% IF ( patron.B_email ) %] >- <li class="email"> >- <span class="label">Email: </span> >- <a title="[% patron.B_email %]" href="mailto:[% patron.B_email | url %]">[% B_email |html %]</a> >- </li> >- [% END %] >- [% IF ( patron.contactnote ) %] >- <li> >- <span class="label">Contact note: </span> >- [% patron.contactnote |html %] >- </li> >- [% END %] >- </ol> >- </div> > </div> [% # /div#patron-alternate-address %] >- <div class="action"> >- <a href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=6">Edit</a> >- </div> > >- <div id="patron-alternative-contact" style="padding-top: 1em;"> >- <h3>Alternative contact</h3> >- <div class="rows"> >- <ol> >- <li> >- <span class="label">Surname: </span> >- [% patron.altcontactsurname | html %] >- </li> >- <li> >- <span class="label">First name: </span> >- [% patron.altcontactfirstname | html %] >- </li> >- <li> >- <span class="label">Address: </span> >- [% patron.altcontactaddress1 | html %] >- </li> >- <li> >- <span class="label">Address 2: </span> >- [% patron.altcontactaddress2 | html %] >- </li> >- <li> >- <span class="label">City: </span> >- [% patron.altcontactaddress3 | html %] >- </li> >- >- [% IF ( patron.altcontactstate ) %] >- <li> >- <span class="label">State: </span> >- [% patron.altcontactstate | html %] >- </li> >- [% END %] >+ <div id="patron-alternative-contact" class="patroninfo-section"> >+ [% IF ( patron.altcontactsurname || patron.altcontactfirstname || patron.altcontactaddress1 || patron.altcontactaddress2 || patron.altcontactaddress3 || patron.altcontactstate || patron.altcontactzipcode || patron.altcontactcountry || patron.altcontactphone ) %] >+ <h3>Alternative contact</h3> >+ <div class="rows"> >+ <ol> >+ [% IF ( patron.altcontactsurname ) %] >+ <li> >+ <span class="label">Surname: </span> >+ [% patron.altcontactsurname | html %] >+ </li> >+ [% END %] >+ [% IF ( patron.altcontactfirstname ) %] >+ <li> >+ <span class="label">First name: </span> >+ [% patron.altcontactfirstname | html %] >+ </li> >+ [% END %] >+ [% IF ( patron.altcontactaddress1 ) %] >+ <li> >+ <span class="label">Address: </span> >+ [% patron.altcontactaddress1 | html %] >+ </li> >+ [% END %] >+ [% IF ( patron.altcontactaddress2 ) %] >+ <li> >+ <span class="label">Address 2: </span> >+ [% patron.altcontactaddress2 | html %] >+ </li> >+ [% END %] >+ [% IF ( patron.altcontactaddress3 ) %] >+ <li> >+ <span class="label">City: </span> >+ [% patron.altcontactaddress3 | html %] >+ </li> >+ [% END %] > >- <li> >- <span class="label">ZIP/Postal code: </span> >- [% patron.altcontactzipcode | html %] >- </li> >- [% IF ( patron.altcontactcountry ) %] >- <li> >- <span class="label">Country: </span> >- [% patron.altcontactcountry | html %] >- </li> >- [% END %] >- [% IF ( patron.altcontactphone ) %] >- <li> >- <span class="label">Phone: </span> >- <a href="tel:[% patron.altcontactphone | url %]">[% patron.altcontactphone | html %]</a> >- </li> >- [% END %] >- </ol> >- </div> [% # /div.rows %] >+ [% IF ( patron.altcontactstate ) %] >+ <li> >+ <span class="label">State: </span> >+ [% patron.altcontactstate | html %] >+ </li> >+ [% END %] >+ [% IF ( patron.altcontactzipcode ) %] >+ <li> >+ <span class="label">ZIP/Postal code: </span> >+ [% patron.altcontactzipcode | html %] >+ </li> >+ [% END %] >+ [% IF ( patron.altcontactcountry ) %] >+ <li> >+ <span class="label">Country: </span> >+ [% patron.altcontactcountry | html %] >+ </li> >+ [% END %] >+ [% IF ( patron.altcontactphone ) %] >+ <li> >+ <span class="label">Phone: </span> >+ <a href="tel:[% patron.altcontactphone | url %]">[% patron.altcontactphone | html %]</a> >+ </li> >+ [% END %] >+ </ol> >+ </div> [% # /div.rows %] >+ <div class="action"> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=2"><i class="fa fa-pencil"></i> Edit</a> >+ </div> >+ [% ELSE %] >+ <h3 class="inline">Alternative contact</h3> >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=2"><i class="fa fa-plus"></i> Add</a> >+ [% END %] > </div> [% # /div#patron-alternative-contact %] >- <div class="action"> >- <a href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber %]&step=2">Edit</a> >- </div> > </div> [% # /div.yui-u %] > </div> [% # /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.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20779
:
75434
|
75435
|
75436
|
75504
|
75628
|
75638
|
75780
|
75855
|
76968
|
77092