Bug 20809: (follow-up) Corrections to CSS and JS
authorOwen Leonard <oleonard@myacpl.org>
Wed, 12 Sep 2018 16:33:48 +0000 (16:33 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 4 Feb 2019 15:54:34 +0000 (15:54 +0000)
This follow-up modifies JavaScript so that the confirmation dialog is
triggered when deleting a patron image from the modal window.

The CSS is modified to improve the alignment of patron image and edit
button.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt

index b790a07..e1c9d0a 100644 (file)
@@ -1737,15 +1737,16 @@ dd {
 }
 
 .patronimage {
+    border: 1px solid #EEE;
     display: block;
     max-width: 160px;
+    margin: auto;
     opacity: 1;
     transition: .2s ease;
 
-    .empty {
+    &.empty {
         background: transparent url( "../img/patron-blank.min.svg" ) center 5px no-repeat;
         height: 125px;
-        margin: .3em 0 .3em .3em;
         padding: 0;
         width: 80%;
     }
index 703930c..2d5ebfe 100644 (file)
@@ -2,7 +2,7 @@
 [% USE Koha %]
 [% USE Categories %]
 
-<script type="text/javascript">
+<script>
     var advsearch = "[% advsearch | html %]";
     var destination = "[% destination | html %]";
 
             number_of_adult_categories = [% number_of_adult_categories | html %]
         [% END %]
     [% END %]
+
+    [% IF ( patron.image ) %]
+        $("body").on("click", "#delpicture", function(){
+             return confirm(_("Are you sure you want to delete this patron image? This cannot be undone."));
+        });
+        $('#manage-patron-image').find("input[value*=Upload]").click(function(){
+            if($("#uploadfile").val() == ""){
+                alert(_("Please choose a file to upload"));
+                return false;
+            }
+            return confirm(_("Are you sure you want to replace the current patron image? This cannot be undone."));
+        });
+    [% END %]
 </script>
index 1dda5d0..376b31b 100644 (file)
                                         [% 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>
+                                                <div class="hint">To update the image for [% patron.title %] [% patron.firstname | 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 | html %] [% patron.firstname | html %] [% patron.surname | html %] does not currently have an image available. To import an image for [% patron.title | html %] [% patron.surname | html %], enter the name of an image file to upload.</div>
+                                                <div class="hint">[% patron.title | html %] [% patron.firstname | html %] [% patron.surname | html %] does not currently have an image available. To import an image for [% patron.title | html %] [% patron.firstname | html %] [% 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>
                 ],
                 "bPaginate": false
             }));
-            [% IF ( patron.image ) %]
-                $('#delpicture').click(function(){
-                     return confirm(_("Are you sure you want to delete this patron image? This cannot be undone."));
-                });
-                $('#manage-patron-image').find("input[value*=Upload]").click(function(){
-                    if($("#uploadfile").val() == ""){
-                        alert(_("Please choose a file to upload"));
-                        return false;
-                    }
-                    return confirm(_("Are you sure you want to replace the current patron image? This cannot be undone."));
-                });
-            [% END %]
 
             $("#suspend_until").datepicker({
                 onClose: function(dateText, inst) {