Bugzilla – Attachment 9378 Details for
Bug 7977
Add a "Quote-of-the-day" feature to the OPAC homepage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Misc UI improvements to both the QOTD editor and uploader including a number suggested by jcamins
Misc-UI-improvements-to-both-the-QOTD-editor-and-u.patch (text/plain), 11.75 KB, created by
Chris Nighswonger
on 2012-04-30 19:35:28 UTC
(
hide
)
Description:
Misc UI improvements to both the QOTD editor and uploader including a number suggested by jcamins
Filename:
MIME Type:
Creator:
Chris Nighswonger
Created:
2012-04-30 19:35:28 UTC
Size:
11.75 KB
patch
obsolete
>From 9ac4207c5879f73a2b93c698e51c4acc899cc720 Mon Sep 17 00:00:00 2001 >From: Chris Nighswonger <cnighswonger@foundations.edu> >Date: Thu, 26 Apr 2012 16:26:09 -0400 >Subject: [PATCH] Misc UI improvements to both the QOTD editor and uploader including a number suggested by jcamins >Content-Type: text/plain; charset="utf-8" > >Also removing a debug warn > >http://bugs.koha-community.org/show_bug.cgi?id=7977 >--- > koha-tmpl/intranet-tmpl/prog/en/css/datatables.css | 9 +++++ > koha-tmpl/intranet-tmpl/prog/en/css/uploader.css | 19 +++++++++-- > .../prog/en/modules/tools/quotes-upload.tt | 33 +++++++++++-------- > .../intranet-tmpl/prog/en/modules/tools/quotes.tt | 19 ++++++++--- > .../prog/en/modules/tools/tools-home.tt | 2 +- > koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt | 2 +- > tools/quotes/quotes_ajax.pl | 2 - > 7 files changed, 59 insertions(+), 27 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css b/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css >index 2a78678..ad97a48 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css >@@ -191,6 +191,15 @@ div.dataTables_paginate.paging_four_button { > width: 250px; > } > >+.delete, .save, .cancel { >+ border-radius: 5px; >+ margin: 1px; >+} >+ >+input { >+ border-radius: 5px; >+} >+ > /* > table.display { > width: 100%; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/uploader.css b/koha-tmpl/intranet-tmpl/prog/en/css/uploader.css >index eca87b9..e747255 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/uploader.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/uploader.css >@@ -10,12 +10,13 @@ > -webkit-transition: opacity 1s linear; > } > #progress_bar.loading { >- opacity: 1.0; >+ opacity: 1.0; > } > #progress_bar .percent { >- background-color: #99ccff; >- height: auto; >- width: 0; >+ color: #E6F0F2; >+ background-color: #004D99; >+ height: auto; >+ width: 0; > } > #server_response { > background-color: white; >@@ -36,3 +37,13 @@ > top: 50%; > width: 250px; > } >+ >+#file_uploader { >+ position: relative; >+ top: -24px; >+} >+ >+#file_upload { >+ position: relative; >+ top: -1px; >+} >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 >index 969e04c..0ac5ae1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >@@ -134,14 +134,14 @@ > for(var i=0; i<aaData.length; i++) { > aaData[i].push('Delete'); //this is hackish FIXME > } >- document.getElementById('quotes_editor').style.visibility="visible"; >+ document.getElementById('save_quotes').style.visibility="visible"; > document.getElementById('file_uploader').style.visibility="hidden"; >+ document.getElementById('quotes_editor').style.visibility="visible"; > oTable = $('#quotes_editor').dataTable( { > "bAutoWidth" : false, > "bPaginate" : true, > "bSort" : false, > "sPaginationType" : "full_numbers", >- "sDom" : '<"save_quotes">frtip', > "aaData" : aaData, > "aoColumns" : [ > { >@@ -162,7 +162,6 @@ > }, > "fnRowCallback": function( nRow, aData, iDisplayIndex ) { > noEditFields = [2]; /* action */ >- /* console.log('Quote ID: '+quoteID); */ > /* do foo on various cells in the current row */ > $('td:eq(2)', nRow).html('<input type="button" class="delete" value="Delete" onclick="fnClickDeleteRow(this.parentNode);" />'); > /* apply no_edit id to noEditFields */ >@@ -184,9 +183,9 @@ > }, > "height" : "14px", > }); >- $("div.save_quotes").html('<input type="button" class="add_quote_button" value="Save Quotes" style="float: right;" onclick="fnGetData(document.getElementById(\'quotes_editor\'));"/>'); > }, > }); >+ document.getElementById('footer').style.visibility="visible"; > } > > function fnHandleFileSelect(evt) { >@@ -202,13 +201,14 @@ > parent.location='quotes-upload.pl'; > }; > reader.onloadstart = function(e) { >+ document.getElementById('cancel_upload').style.visibility="visible"; > document.getElementById('progress_bar').className = 'loading'; > }; > reader.onload = function(e) { > // Ensure that the progress bar displays 100% at the end. > progress.style.width = '100%'; > progress.textContent = '100%'; >- setTimeout("document.getElementById('progress_bar').className='';", 2000); >+ document.getElementById('cancel_upload').style.visibility="hidden"; > quotes = fnCSVToArray(e.target.result, ','); > fnDataTable(quotes); > } >@@ -232,7 +232,8 @@ > reader.readAsText(evt.target.files[0]); > } > >- document.getElementById('files').addEventListener('change', fnHandleFileSelect, false); >+ //document.getElementById('file_upload').addEventListener('change', fnHandleFileSelect, false); >+ $('#file_upload').one('change', fnHandleFileSelect); > > }); > >@@ -281,11 +282,16 @@ > <div id="bd"> > <div id="yui-main"> > <div class="yui-b"> >- >- <div id="file_uploader" style="float: left; width: 100%; visibility:visible;"> >- <input type="file" id="files" name="file" /> >- <button onclick="fnAbortRead();">Cancel Upload</button> >- <div id="progress_bar"><div class="percent">0%</div></div> >+ <div id="toolbar" style="height:61px;"> >+ <div id="save_quotes" style="visibility:hidden;"> >+ <input type="button" class="add_quote_button" value="Save Quotes" style="border-radius: 5px;" onclick="fnGetData(document.getElementById('quotes_editor'));"/> >+ <span class="hint">Click on any field to edit contents</span> >+ </div> >+ <div id="file_uploader" class="file_uploader" style="visibility:visible;"> >+ <input id="file_upload" type="file" name="file" /> >+ <button id="cancel_upload" style="visibility:hidden;" onclick="fnAbortRead();">Cancel Upload</button> >+ <div id="progress_bar"><div class="percent">0%</div></div> >+ </div> > </div> > <div id="server_response" onclick='fnResetUpload()'>Server Response</div> > <table id="quotes_editor" style="float: left; width: 100%; visibility:hidden;"> >@@ -305,9 +311,8 @@ > </tr> > </tbody> > </table> >- >- >- >+ <fieldset id="footer" class="action" style="visibility:hidden; height:25px"> >+ </fieldset> > </div> > </div> > <div class="yui-b noprint"> >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 9742d7c..5858700 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt >@@ -21,12 +21,11 @@ > "sAjaxSource" : "/cgi-bin/koha/tools/quotes/quotes_ajax.pl", > "aoColumns" : [ > { "sWidth": "3%" }, >- { "sWidth": "12%" }, >+ { "sWidth": "11%" }, > { "sWidth": "65%" }, > { "sWidth": "10%" }, >- { "sWidth": "10%" }, >+ { "sWidth": "11%" }, > ], >- "sDom" : '<"add_quote">frtip', > "oLanguage" : { > "sEmptyTable": sEmptyTable, > }, >@@ -61,7 +60,6 @@ > }); > }, > }); >- $("div.add_quote").html('<input type="button" class="add_quote_button" value="Add Quote" style="float: right;" onclick="fnClickAddRow();"/><input type="button" class="import_quote_button" value="Import Quotes" style="float: right;" onclick="parent.location=\'quotes-upload.pl\'"/>'); > }); > > function fnClickAddQuote() { >@@ -152,7 +150,16 @@ > <div id="bd"> > <div id="yui-main"> > <div class="yui-b"> >- <table id="quotes_editor" style="float: left; width: 100%"> >+ <div id="toolbar"> >+ <ul class="toolbar"> >+ <li> >+ <input type="button" class="add_quote_button" value="Add Quote" style="border-radius: 5px;" onclick="fnClickAddRow();"/> >+ <input type="button" class="import_quote_button" value="Import Quotes" style="border-radius: 5px;" onclick="parent.location='quotes-upload.pl'"/> >+ <span class="hint" style="">Click Source or Text field to edit contents. Press <Enter> to save changes.</span> >+ </li> >+ </ul> >+ </div> >+ <table id="quotes_editor" style="float: left; width: 100%;"> > <thead> > <tr> > <th>ID</th> >@@ -173,6 +180,8 @@ > </tr> > </tbody> > </table> >+ <fieldset id="footer" class="action" style="height:25px;"> >+ </fieldset> > </div> > </div> > <div class="yui-b noprint"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >index c78f17d..9b1b11b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >@@ -88,7 +88,7 @@ > [% END %] > > [% IF ( CAN_user_tools_edit_quotes ) %] >- <dt><a href="/cgi-bin/koha/tools/quotes.pl">Edit Quotes for QOD Feature</a></dt> >+ <dt><a href="/cgi-bin/koha/tools/quotes.pl">Edit Quotes for QOTD Feature</a></dt> > <dd>Quote editor for Quote-of-the-day feature in OPAC</dd> > [% END %] > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt >index a97b578..84ba67a 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt >@@ -36,7 +36,7 @@ > [% END %] > > [% IF ( display_daily_quote && daily_quote ) %] >- <div id="daily-quote" class="container"><h1>Quote of the Day</h1><div><span id="daily-quote-text">[% daily_quote.text %]</span> ~ <span id="daily-quote-source">[% daily_quote.source %]</span></div></div> >+ <div id="daily-quote" class="container"><h1>Quote of the Day</h1><div><span id="daily-quote-text">[% daily_quote.text %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source %]</span></div></div> > [% END %] > > [% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock" class="container">[% OpacMainUserBlock %]</div>[% END %] >diff --git a/tools/quotes/quotes_ajax.pl b/tools/quotes/quotes_ajax.pl >index 75ff18d..1e1e655 100755 >--- a/tools/quotes/quotes_ajax.pl >+++ b/tools/quotes/quotes_ajax.pl >@@ -46,8 +46,6 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > > my $params = $cgi->Vars; # NOTE: Multivalue parameters NOT allowed!! > >-warn Dumper($params); #XXX >- > print $cgi->header('application/json'); > > if ($params->{'action'} eq 'add') { >-- >1.7.0.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7977
:
9310
|
9321
|
9323
|
9324
|
9325
|
9326
|
9327
|
9328
|
9338
|
9343
|
9373
|
9376
|
9377
|
9378
|
9392
|
9405
|
9406
|
9407
|
9408
|
9409
|
9433
|
9434
|
9435
|
9441
|
9442
|
9443
|
9447
|
9473
|
9474
|
9475
|
9476
|
9477
|
9478
|
9479
|
9480
|
9481
|
9482
|
9483
|
9484
|
9485
|
9486
|
9503
|
9504
|
9505
|
9510
|
9517
|
9521
|
9529
|
9530
|
9531
|
9682
|
9683
|
9711
|
9712
|
9713
|
9714
|
9715
|
9716
|
9717
|
9718
|
9719
|
9720
|
9721
|
9722
|
9723
|
9724
|
9725
|
9726
|
9727
|
9728
|
9729
|
9730
|
9731
|
9732