Bug 20809: (follow-up) Corrections to CSS and JS

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>
This commit is contained in:
Owen Leonard 2018-09-12 16:33:48 +00:00 committed by Nick Clemens
parent 24ffe470ff
commit 2578b94691
3 changed files with 19 additions and 17 deletions

View 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%;
}

View File

@ -2,7 +2,7 @@
[% USE Koha %]
[% USE Categories %]
<script type="text/javascript">
<script>
var advsearch = "[% advsearch | html %]";
var destination = "[% destination | html %]";
@ -20,4 +20,17 @@
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>

View File

@ -286,9 +286,9 @@
[% 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>
@ -884,18 +884,6 @@
],
"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) {