From 13fca448360f62700324fb83844296d6398ecf20 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 29 Sep 2008 19:00:20 -0500 Subject: [PATCH] Adding progress bar and some other visual enhancements to file upload interactions. Signed-off-by: Galen Charlton --- .../prog/en/css/staff-global.css | 10 ++-- .../prog/en/includes/background-job.inc | 6 ++- .../prog/en/includes/file-upload.inc | 9 +++- .../en/modules/offline_circ/process_koc.tmpl | 40 ++++++++++---- .../en/modules/tools/stage-marc-import.tmpl | 49 +++++++++++------- koha-tmpl/intranet-tmpl/prog/img/progress.png | Bin 0 -> 224 bytes 6 files changed, 77 insertions(+), 37 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/img/progress.png diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 5532ca2c0f..167ca81132 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1369,7 +1369,7 @@ input[type=submit], input[type=button] { color: #333333; } -input.submit { +input.submit,button.submit { border: 1px solid #999999; border-top-color: #666; border-left-color: #666; @@ -1386,11 +1386,7 @@ input[type=submit]:active, input[type=button]:active { border : 1px inset #999999; } -input.submit:active { - border : 1px inset #999999; -} - -input[type=reset], input[type=button], input.submit { +input[type=reset], input[type=button], input.submit, button.submit { border: 1px outset #999999; border-top-color: #666; border-left-color: #666; @@ -1399,7 +1395,7 @@ input[type=reset], input[type=button], input.submit { color: #333333; } -input[type=reset]:active, input[type=button]:active, input.submit:active { +input[type=reset]:active, input[type=button]:active, input.submit:active, button.submit:active { border : 1px inset #999999; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/background-job.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/background-job.inc index cfa9e94999..28b76a6997 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/background-job.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/background-job.inc @@ -15,7 +15,10 @@ if (json.job_status == 'completed') { percentage = 100; } - $("#jobprogress").text(percentage); + var bgproperty = (parseInt(percentage)-300)+"px 0px"; + $("#jobprogress").css("background-position",bgproperty); + $("#jobprogresspercent").text(percentage); + if (percentage == 100) { clearInterval(backgroundJobProgressTimer); // just in case form submission fails completeJob(); @@ -57,6 +60,7 @@ }); // and submit the request + $("#jobpanel").show(); $("#jobstatus").show(); $.ajax({ data: inputs.join('&'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/file-upload.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/file-upload.inc index cd18f0b118..8dd2c47af7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/file-upload.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/file-upload.inc @@ -14,7 +14,9 @@ inFileUploadProgressTimer = true; $.getJSON("/cgi-bin/koha/tools/upload-file-progress.pl", function(json) { if (!fileUploadProgressTimerCanceled) { - $("#fileuploadprogress").text(json.progress); + var bgproperty = (parseInt(json.progress)-300)+"px 0px"; + $("#fileuploadprogress").css("background-position",bgproperty); + $("#fileuploadpercent").text(json.progress); } inFileUploadProgressTimer = false; }); @@ -22,6 +24,7 @@ function ajaxFileUpload() { fileUploadProgressTimerCanceled = false; + $("#uploadpanel").show(); $("#fileuploadstatus").show(); fileUploadProgressTimer = setInterval("updateProgress()",500); $.ajaxFileUpload ( @@ -46,7 +49,9 @@ $("#fileuploadfailed").text("Upload failed -- database in maintenance state"); } else { $("#uploadedfileid").val(data.fileid); - $("#fileuploadprogress").text("100"); + $("#fileuploadprogress").css("background-position","0px 0px"); + $("#processfile").show(); + $("#fileuploadpercent").text("100"); } fileUploadProgressTimerCanceled = true; clearInterval(fileUploadProgressTimer); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tmpl index 0b233af1e9..4c1d2ea6b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tmpl @@ -5,11 +5,23 @@ + @@ -24,6 +40,10 @@ function CheckForm(f) { +
+ +
+

Koha Offline Circulation

Your data was processed. Here are the results.

@@ -34,23 +54,25 @@ function CheckForm(f) {

Upload Offline Circulation Data

" enctype="multipart/form-data"> - -
- +
+
  1. +
+
+
- +
-
+ - +
- - +
+ \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl index e2f448696e..9a768f287c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl @@ -3,11 +3,20 @@ +