Browse Source

Bug 25941: Reindent Upload local cover image page

This patch reindents the "Upload local cover image" template to make
indentation consistent. Some lines have been split up. Some markup
inconsistencies have been corrected.

To test, apply the patch and enable the LocalCoverImages system
preference.

- Go to Tools -> Upload local cover image.
- Test uploading single images or ZIP files of images.
- Confirm that everything works as expected.

Use your preferred method for checking the differences between files
while ignoring whitespace. I use diff with the  "-w" flag, but I'm not
some kind of diff deity. The only changes you see should be split lines.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Owen Leonard 4 years ago
committed by Jonathan Druart
parent
commit
f010b8fd16
  1. 95
      koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt

95
koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt

@ -13,50 +13,69 @@
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% IF ( uploadimage ) %]<a href="/cgi-bin/koha/tools/upload-cover-image.pl">Upload local cover image</a> &rsaquo; Upload results[% ELSE %]Upload local cover image[% END %]</div>
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
[% IF ( uploadimage ) %]
<a href="/cgi-bin/koha/tools/upload-cover-image.pl">Upload local cover image</a> &rsaquo; Upload results
[% ELSE %]
Upload local cover image
[% END %]
</div>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
<h1>Upload local cover image</h1>
[% IF ( uploadimage ) %]
<p>Image upload results :</p>
<ul>
<h1>Upload local cover image</h1>
[% IF ( uploadimage ) %]
<p>Image upload results :</p>
<ul>
<li>[% total | html %] images found</li>
[% IF ( error ) %]
<li>
<div class="dialog alert">
[% IF ( error == 'UZIPFAIL' ) %]<p><strong>Failed to unzip archive.<br />Please ensure you are uploading a valid zip file and try again.</strong></p>
[% ELSIF ( error == 'OPNLINK' ) %]<p><strong>Cannot open folder index (idlink.txt or datalink.txt) to read.<br />Please verify that it exists.</strong></p>
[% ELSIF ( error == 'OPNIMG' ) %]<p><strong>Cannot process file as an image.<br />Please ensure you only upload GIF, JPEG, PNG, or XPM images.</strong></p>
[% ELSIF ( error == 'DELERR' ) %]<p><strong>Unrecognized or missing field delimiter.<br />Please verify that you are using either a single quote or a tab.</strong></p>
[% ELSIF ( error == 'DBERR' ) %]<p><strong>Unable to save image to database.</strong></p>
[% ELSE %]<p><strong>An unknown error has occurred.<br />Please review the error log for more details.</strong></p>[% END %]
[% IF ( error == 'UZIPFAIL' ) %]
<p><strong>Failed to unzip archive.<br />Please ensure you are uploading a valid zip file and try again.</strong></p>
[% ELSIF ( error == 'OPNLINK' ) %]
<p><strong>Cannot open folder index (idlink.txt or datalink.txt) to read.<br />Please verify that it exists.</strong></p>
[% ELSIF ( error == 'OPNIMG' ) %]
<p><strong>Cannot process file as an image.<br />Please ensure you only upload GIF, JPEG, PNG, or XPM images.</strong></p>
[% ELSIF ( error == 'DELERR' ) %]
<p><strong>Unrecognized or missing field delimiter.<br />Please verify that you are using either a single quote or a tab.</strong></p>
[% ELSIF ( error == 'DBERR' ) %]
<p><strong>Unable to save image to database.</strong></p>
[% ELSE %]
<p><strong>An unknown error has occurred.<br />Please review the error log for more details.</strong></p>
[% END %]
</div>
</li>
[% END %]
<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">View final record</a></li>
<li><a href="/cgi-bin/koha/tools/tools-home.pl">Back</a></li>
</ul>
<hr />
[% END %]
<ul>
</ul>
<hr />
[% END %]
<ul>
<li>Select an image file or ZIP file to upload. The tool will accept images in GIF, JPEG, PNG, and XPM formats.</li>
</ul>
<form method="post" action="/cgi-bin/koha/tools/upload-cover-image.pl" id="uploadfile" enctype="multipart/form-data">
<fieldset class="rows" >
<legend>Upload images</legend>
<ol>
</ul>
<form method="post" action="/cgi-bin/koha/tools/upload-cover-image.pl" id="uploadfile" enctype="multipart/form-data">
<fieldset class="rows" >
<legend>Upload images</legend>
<ol>
<li>
<div id="fileuploadform">
<label for="fileToUpload" class="required">Select the file to upload: </label>
<input type="file" id="fileToUpload" name="fileToUpload" required="required" class="required" />
<span class="required">Required</span>
</div> </li>
</ol>
</div>
</li>
</ol>
<fieldset class="action"><button class="submit btn btn-default">Upload file</button></fieldset>
</fieldset>
</fieldset>
<div id="uploadpanel">
<div id="fileuploadstatus" class="progress_panel">Upload progress:
@ -66,10 +85,10 @@
</div>
<div id="fileuploadfailed"></div>
</div>
</form>
</form>
<form method="post" id="processfile" action="/cgi-bin/koha/tools/upload-cover-image.pl" enctype="multipart/form-data">
<fieldset class="rows">
<fieldset class="rows">
<input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
<input type="hidden" name="runinbackground" id="runinbackground" value="" />
<input type="hidden" name="completedJobID" id="completedJobID" value="" />
@ -79,15 +98,29 @@
<ol>
[% UNLESS itemnumber %]
<li class="radio">
[% IF (filetype != 'image' ) %]<input type="radio" id="zipfile" name="filetype" value="zip" checked="checked" />[% ELSE %]<input type="radio" id="zipfile" name="filetype" value="zip" />[% END %]
[% IF (filetype != 'image' ) %]
<input type="radio" id="zipfile" name="filetype" value="zip" checked="checked" />
[% ELSE %]
<input type="radio" id="zipfile" name="filetype" value="zip" />
[% END %]
<label for="zipfile">ZIP file</label>
</li>
<li class="radio">
[% IF (filetype == 'image' ) %]<input type="radio" id="image" name="filetype" value="image" checked="checked" />[% ELSE %]<input type="radio" id="image" name="filetype" value="image" />[% END %]
[% IF (filetype == 'image' ) %]
<input type="radio" id="image" name="filetype" value="image" checked="checked" />
[% ELSE %]
<input type="radio" id="image" name="filetype" value="image" />
[% END %]
<label for="image">Image file</label>
</li>
<li class="radio">
[% IF ( filetype == 'image' ) %]<span id="bibnum">[% ELSE %]<span id="bibnum" style="display: none">[% END %]<label for="biblionumber">Enter cover biblionumber: </label><input type="text" id="biblionumber" name="biblionumber" value="[% biblionumber | html %]" size="15" /></span>
[% IF ( filetype == 'image' ) %]
<span id="bibnum">
[% ELSE %]
<span id="bibnum" style="display: none">
[% END %]
<label for="biblionumber">Enter cover biblionumber: </label>
<input type="text" id="biblionumber" name="biblionumber" value="[% biblionumber | html %]" size="15" /></span>
</li>
[% ELSE %]
<label for="itemnumber">Cover itemnumber: </label>
@ -109,8 +142,10 @@
</li>
</ol>
</fieldset>
<fieldset class="action"><button type="submit" class="btn btn-default btn-sm">Process images</button></fieldset>
</form>
<fieldset class="action">
<button type="submit" class="btn btn-default btn-sm">Process images</button>
</fieldset>
</form>
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->

Loading…
Cancel
Save