From df36beeffd1be584478cc85764b55959ccf75da7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 16 May 2016 10:52:17 -0400 Subject: [PATCH] Bug 16529 - Clean up and improve upload template MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch makes some fixes and improvements to the template for Tools -> Upload, including markup corrections, removal of 'onclick,' and conversion of some links to styled buttons. To test, apply the patch and go to Tools -> Upload. - Confirm that uploading a file works correctly. - Confirm that clicking 'Cancel' during a file upload works correctly. - Search existing uploads. - Confirm that the 'Download' and 'Delete' buttons look correct and work correctly. - In Administration -> MARC bibliographic framework, choose a framework and configure a tag subfield to use the upload plugin. - Create or edit a bibliographic record using the framework you modified. - Click the tag editor icon next to your modified subfield to trigger the pop-up window with the upload form. - Confirm that this window has a layout which is adjusted for the size of the window. - Confirm that uploading and selecting files from this window works correctly. Signed-off-by: Rocio Dressler Signed-off-by: Marcel de Rooy Signed-off-by: Brendan Gallagher (cherry picked from commit 6cd592ba3b18236a3c0f82873d4444c1f884f37c) Signed-off-by: Frédéric Demians --- .../prog/en/modules/tools/upload.tt | 105 +++++++++++------- 1 file changed, 65 insertions(+), 40 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt index dc26484597..b185206551 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt @@ -33,7 +33,7 @@ [% END %] [% BLOCK form_new %] -
+ [% PROCESS plugin_pars %]
Upload new files @@ -49,7 +49,7 @@ [% ELSE %] - - + [% END %]
- - + +
Upload progress: - + 0%
@@ -93,22 +92,20 @@ [% END %] [% BLOCK form_search %] - + [% PROCESS plugin_pars %]
Search uploads by name or hashvalue
  1. - +
  2. -
  3. -
    - -
    -
+
+ +
[% END %] @@ -124,11 +121,7 @@ [% BLOCK closer %] [% IF plugin %] -
-
- -
-
+ [% END %] [% END %] @@ -146,24 +139,24 @@
- [% IF plugin %] - - [% END %]
+ [% IF plugin %] + + [% END %] [% END %] [% BLOCK table_results %] - + + + + [% IF !plugin %][% END %] + [% IF !plugin %][% END %] + @@ -177,13 +170,13 @@ [% END %] - @@ -318,22 +311,54 @@ $(document).ready(function() { $("#public_cb").click(function() { $("#public").click(); }); + $("#fileuploadbutton").on("click",function(e){ + e.preventDefault(); + StartUpload(); + }); + $("#fileuploadcancel").on("click",function(e){ + e.preventDefault(); + CancelUpload(); + }); + $("#searchbutton").on("click",function(){ + return CheckSearch(); + }); + $(".choose_entry").on("click",function(e){ + e.preventDefault(); + var record_hashvalue = $(this).data("record-hashvalue"); + Choose( record_hashvalue ); + }); + $(".download_entry").on("click",function(e){ + e.preventDefault(); + var record_id = $(this).data("record-id"); + SubmitMe( 'download', record_id ); + }); + $(".delete_entry").on("click",function(e){ + e.preventDefault(); + var record_id = $(this).data("record-id"); + DeleteEntry( record_id ); + }); }); //]]> - -[% IF !plugin %] +[% IF ( plugin ) %] + +
+
+
+[% ELSE %] + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] [% PROCESS breadcrumbs %] +
+
+
+
[% END %] -
-
-
-
+

Upload

@@ -355,10 +380,10 @@ $(document).ready(function() { [% END %] [% END %] -
[% IF !plugin %] +
[% INCLUDE 'tools-menu.inc' %]
-- 2.39.5
Filename - Size - Hashvalue - Category - [% IF !plugin %]Public[% END %] - [% IF !plugin %]Temporary[% END %] - Actions + FilenameSizeHashvalueCategoryPublicTemporaryActions
[% IF record.public %]Yes[% ELSE %]No[% END %] [% IF record.permanent %]No[% ELSE %]Yes[% END %] + [% IF plugin %] - Choose  + [% END %] - Download  + [% IF record.owner == owner || CAN_user_tools_upload_manage %] - Delete + [% END %]