From bc5e8a88b863f2fef7c656415211bed3681075dc Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Fri, 20 Apr 2012 16:12:26 -0400 Subject: [PATCH 6/7] Beginning work on QOTD uploader Content-Type: text/plain; charset="utf-8" This series will add a DataTable's based upload/editor with which to upload csv files containing quotes to be used by the QOTD feature. The file should be formatted thusly: "source","text-of-quote" "source","text-of-quote" ... Note: This work serves as a good example of potential improvements in all other "editor" and file upload areas of Koha. This patch is a squash of the following work: Adding code to parse CSV file contents and push it into a DataTable Adding in jEditable to enable table editing Adding ajax to post data back to the server to be saved Fixing edit and adding delete functionality Adding some missing css as well as server feedback on save Fixing a bug which limited the number of quotes which could be uploaded Also fixing a minor bug with fnCSVToArray and doing some style cleanup. --- koha-tmpl/intranet-tmpl/prog/en/css/uploader.css | 38 +++ .../prog/en/modules/tools/quotes-upload.tt | 300 ++++++++++++++++++++ .../intranet-tmpl/prog/en/modules/tools/quotes.tt | 10 +- koha-tmpl/intranet-tmpl/prog/img/x_alt_16x16.png | Bin 0 -> 215 bytes tools/quotes-upload.pl | 44 +++ tools/quotes/quotes-upload_ajax.pl | 68 +++++ 6 files changed, 455 insertions(+), 5 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/css/uploader.css create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/img/x_alt_16x16.png create mode 100755 tools/quotes-upload.pl create mode 100755 tools/quotes/quotes-upload_ajax.pl diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/uploader.css b/koha-tmpl/intranet-tmpl/prog/en/css/uploader.css new file mode 100644 index 0000000..eca87b9 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/css/uploader.css @@ -0,0 +1,38 @@ +#progress_bar { + margin: 10px 0; + padding: 3px; + border: 1px solid #000; + font-size: 14px; + clear: both; + opacity: 0; + -moz-transition: opacity 1s linear; + -o-transition: opacity 1s linear; + -webkit-transition: opacity 1s linear; +} +#progress_bar.loading { + opacity: 1.0; +} +#progress_bar .percent { + background-color: #99ccff; + height: auto; + width: 0; +} +#server_response { + background-color: white; + background-image: url("../../img/x_alt_16x16.png"); + background-repeat: no-repeat; + background-origin: padding-box; + background-position: right top; + border: 1px solid #DDDDDD; + color: #999999; + font-size: 14px; + height: 30px; + left: 50%; + margin-left: -125px; + margin-top: -15px; + padding: 14px 0 2px; + position: fixed; + text-align: center; + top: 50%; + width: 250px; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt new file mode 100644 index 0000000..05fac8b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt @@ -0,0 +1,300 @@ + [% INCLUDE 'doc-head-open.inc' %] + Koha › Tools › Quote Uploader + [% INCLUDE 'doc-head-close.inc' %] + + + + [% INCLUDE 'datatables-strings.inc' %] + + + + + + +[% INCLUDE 'header.inc' %] +[% INCLUDE 'cat-search.inc' %] + + + +
+
+
+
+ +
+ + +
0%
+
+
Server Response
+ + + + + + + + + + + + + + + + + + + + +
+
+
+ [% INCLUDE 'tools-menu.inc' %] +
+
+[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt index 49df31d..a5c87e4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt @@ -1,12 +1,12 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Quote Editor [% INCLUDE 'doc-head-close.inc' %] - - + + [% INCLUDE 'datatables-strings.inc' %] - - + +