View | Details | Raw Unified | Return to bug 7977
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css (+9 lines)
Lines 191-196 div.dataTables_paginate.paging_four_button { Link Here
191
    width: 250px;
191
    width: 250px;
192
}
192
}
193
193
194
.delete, .save, .cancel {
195
    border-radius: 5px;
196
    margin: 1px;
197
}
198
199
input {
200
    border-radius: 5px;
201
}
202
194
/*
203
/*
195
table.display {
204
table.display {
196
    width: 100%;
205
    width: 100%;
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/uploader.css (-4 / +15 lines)
Lines 10-21 Link Here
10
  -webkit-transition: opacity 1s linear;
10
  -webkit-transition: opacity 1s linear;
11
}
11
}
12
#progress_bar.loading {
12
#progress_bar.loading {
13
  opacity: 1.0;
13
    opacity: 1.0;
14
}
14
}
15
#progress_bar .percent {
15
#progress_bar .percent {
16
  background-color: #99ccff;
16
    color: #E6F0F2;
17
  height: auto;
17
    background-color: #004D99;
18
  width: 0;
18
    height: auto;
19
    width: 0;
19
}
20
}
20
#server_response {
21
#server_response {
21
    background-color: white;
22
    background-color: white;
Lines 36-38 Link Here
36
    top: 50%;
37
    top: 50%;
37
    width: 250px;
38
    width: 250px;
38
}
39
}
40
41
#file_uploader {
42
    position: relative;
43
    top: -24px;
44
}
45
46
#file_upload {
47
    position: relative;
48
    top: -1px;
49
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt (-14 / +19 lines)
Lines 134-147 Link Here
134
        for(var i=0; i<aaData.length; i++) {
134
        for(var i=0; i<aaData.length; i++) {
135
            aaData[i].push('Delete'); //this is hackish FIXME
135
            aaData[i].push('Delete'); //this is hackish FIXME
136
        }
136
        }
137
        document.getElementById('quotes_editor').style.visibility="visible";
137
        document.getElementById('save_quotes').style.visibility="visible";
138
        document.getElementById('file_uploader').style.visibility="hidden";
138
        document.getElementById('file_uploader').style.visibility="hidden";
139
        document.getElementById('quotes_editor').style.visibility="visible";
139
        oTable = $('#quotes_editor').dataTable( {
140
        oTable = $('#quotes_editor').dataTable( {
140
            "bAutoWidth"        : false,
141
            "bAutoWidth"        : false,
141
            "bPaginate"         : true,
142
            "bPaginate"         : true,
142
            "bSort"             : false,
143
            "bSort"             : false,
143
            "sPaginationType"   : "full_numbers",
144
            "sPaginationType"   : "full_numbers",
144
            "sDom"              : '<"save_quotes">frtip',
145
            "aaData"            : aaData,
145
            "aaData"            : aaData,
146
            "aoColumns"         : [
146
            "aoColumns"         : [
147
                {
147
                {
Lines 162-168 Link Here
162
            },
162
            },
163
            "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
163
            "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
164
                noEditFields = [2]; /* action */
164
                noEditFields = [2]; /* action */
165
                /* console.log('Quote ID: '+quoteID); */
166
                /* do foo on various cells in the current row */
165
                /* do foo on various cells in the current row */
167
                $('td:eq(2)', nRow).html('<input type="button" class="delete" value="Delete" onclick="fnClickDeleteRow(this.parentNode);" />');
166
                $('td:eq(2)', nRow).html('<input type="button" class="delete" value="Delete" onclick="fnClickDeleteRow(this.parentNode);" />');
168
                /* apply no_edit id to noEditFields */
167
                /* apply no_edit id to noEditFields */
Lines 184-192 Link Here
184
                                      },
183
                                      },
185
                    "height"        : "14px",
184
                    "height"        : "14px",
186
                });
185
                });
187
                $("div.save_quotes").html('<input type="button" class="add_quote_button" value="Save Quotes" style="float: right;" onclick="fnGetData(document.getElementById(\'quotes_editor\'));"/>');
188
           },
186
           },
189
        });
187
        });
188
        document.getElementById('footer').style.visibility="visible";
190
    }
189
    }
191
190
192
    function fnHandleFileSelect(evt) {
191
    function fnHandleFileSelect(evt) {
Lines 202-214 Link Here
202
            parent.location='quotes-upload.pl';
201
            parent.location='quotes-upload.pl';
203
        };
202
        };
204
        reader.onloadstart = function(e) {
203
        reader.onloadstart = function(e) {
204
            document.getElementById('cancel_upload').style.visibility="visible";
205
            document.getElementById('progress_bar').className = 'loading';
205
            document.getElementById('progress_bar').className = 'loading';
206
        };
206
        };
207
        reader.onload = function(e) {
207
        reader.onload = function(e) {
208
            // Ensure that the progress bar displays 100% at the end.
208
            // Ensure that the progress bar displays 100% at the end.
209
            progress.style.width = '100%';
209
            progress.style.width = '100%';
210
            progress.textContent = '100%';
210
            progress.textContent = '100%';
211
            setTimeout("document.getElementById('progress_bar').className='';", 2000);
211
            document.getElementById('cancel_upload').style.visibility="hidden";
212
            quotes = fnCSVToArray(e.target.result, ',');
212
            quotes = fnCSVToArray(e.target.result, ',');
213
            fnDataTable(quotes);
213
            fnDataTable(quotes);
214
        }
214
        }
Lines 232-238 Link Here
232
        reader.readAsText(evt.target.files[0]);
232
        reader.readAsText(evt.target.files[0]);
233
    }
233
    }
234
234
235
    document.getElementById('files').addEventListener('change', fnHandleFileSelect, false);
235
    //document.getElementById('file_upload').addEventListener('change', fnHandleFileSelect, false);
236
    $('#file_upload').one('change', fnHandleFileSelect);
236
237
237
    });
238
    });
238
239
Lines 281-291 Link Here
281
    <div id="bd">
282
    <div id="bd">
282
        <div id="yui-main">
283
        <div id="yui-main">
283
            <div class="yui-b">
284
            <div class="yui-b">
284
285
                <div id="toolbar" style="height:61px;">
285
                <div id="file_uploader" style="float: left; width: 100%; visibility:visible;">
286
                    <div id="save_quotes" style="visibility:hidden;">
286
                    <input type="file" id="files" name="file" />
287
                        <input type="button" class="add_quote_button" value="Save Quotes" style="border-radius: 5px;" onclick="fnGetData(document.getElementById('quotes_editor'));"/>
287
                    <button onclick="fnAbortRead();">Cancel Upload</button>
288
                        <span class="hint">Click on any field to edit contents</span>
288
                    <div id="progress_bar"><div class="percent">0%</div></div>
289
                    </div>
290
                    <div id="file_uploader" class="file_uploader" style="visibility:visible;">
291
                        <input id="file_upload" type="file" name="file" />
292
                        <button id="cancel_upload" style="visibility:hidden;" onclick="fnAbortRead();">Cancel Upload</button>
293
                        <div id="progress_bar"><div class="percent">0%</div></div>
294
                    </div>
289
                </div>
295
                </div>
290
                <div id="server_response" onclick='fnResetUpload()'>Server Response</div>
296
                <div id="server_response" onclick='fnResetUpload()'>Server Response</div>
291
                <table id="quotes_editor" style="float: left; width: 100%; visibility:hidden;">
297
                <table id="quotes_editor" style="float: left; width: 100%; visibility:hidden;">
Lines 305-313 Link Here
305
                    </tr>
311
                    </tr>
306
                </tbody>
312
                </tbody>
307
                </table>
313
                </table>
308
314
                <fieldset id="footer" class="action" style="visibility:hidden; height:25px">
309
315
                </fieldset>
310
311
            </div>
316
            </div>
312
        </div>
317
        </div>
313
    <div class="yui-b noprint">
318
    <div class="yui-b noprint">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt (-5 / +14 lines)
Lines 21-32 Link Here
21
                    "sAjaxSource"       : "/cgi-bin/koha/tools/quotes/quotes_ajax.pl",
21
                    "sAjaxSource"       : "/cgi-bin/koha/tools/quotes/quotes_ajax.pl",
22
                    "aoColumns"         : [
22
                    "aoColumns"         : [
23
                                            { "sWidth": "3%"  },
23
                                            { "sWidth": "3%"  },
24
                                            { "sWidth": "12%" },
24
                                            { "sWidth": "11%" },
25
                                            { "sWidth": "65%" },
25
                                            { "sWidth": "65%" },
26
                                            { "sWidth": "10%" },
26
                                            { "sWidth": "10%" },
27
                                            { "sWidth": "10%" },
27
                                            { "sWidth": "11%" },
28
                                          ],
28
                                          ],
29
                   "sDom"               : '<"add_quote">frtip',
30
                   "oLanguage"          : {
29
                   "oLanguage"          : {
31
                                            "sEmptyTable": sEmptyTable,
30
                                            "sEmptyTable": sEmptyTable,
32
                                          },
31
                                          },
Lines 61-67 Link Here
61
                        });
60
                        });
62
                   },
61
                   },
63
        });
62
        });
64
        $("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\'"/>');
65
    });
63
    });
66
64
67
        function fnClickAddQuote() {
65
        function fnClickAddQuote() {
Lines 152-158 Link Here
152
    <div id="bd">
150
    <div id="bd">
153
        <div id="yui-main">
151
        <div id="yui-main">
154
            <div class="yui-b">
152
            <div class="yui-b">
155
                <table id="quotes_editor" style="float: left; width: 100%">
153
                <div id="toolbar">
154
                <ul class="toolbar">
155
                <li>
156
                    <input type="button" class="add_quote_button" value="Add Quote" style="border-radius: 5px;" onclick="fnClickAddRow();"/>
157
                    <input type="button" class="import_quote_button" value="Import Quotes" style="border-radius: 5px;" onclick="parent.location='quotes-upload.pl'"/>
158
                    <span class="hint" style="">Click Source or Text field to edit contents. Press <Enter> to save changes.</span>
159
                </li>
160
                </ul>
161
                </div>
162
                <table id="quotes_editor" style="float: left; width: 100%;">
156
                <thead>
163
                <thead>
157
                    <tr>
164
                    <tr>
158
                        <th>ID</th>
165
                        <th>ID</th>
Lines 173-178 Link Here
173
                    </tr>
180
                    </tr>
174
                </tbody>
181
                </tbody>
175
                </table>
182
                </table>
183
                <fieldset id="footer" class="action" style="height:25px;">
184
                </fieldset>
176
            </div>
185
            </div>
177
        </div>
186
        </div>
178
    <div class="yui-b noprint">
187
    <div class="yui-b noprint">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt (-1 / +1 lines)
Lines 88-94 Link Here
88
    [% END %]
88
    [% END %]
89
	
89
	
90
    [% IF ( CAN_user_tools_edit_quotes ) %]
90
    [% IF ( CAN_user_tools_edit_quotes ) %]
91
    <dt><a href="/cgi-bin/koha/tools/quotes.pl">Edit Quotes for QOD Feature</a></dt>
91
    <dt><a href="/cgi-bin/koha/tools/quotes.pl">Edit Quotes for QOTD Feature</a></dt>
92
    <dd>Quote editor for Quote-of-the-day feature in OPAC</dd>
92
    <dd>Quote editor for Quote-of-the-day feature in OPAC</dd>
93
    [% END %]
93
    [% END %]
94
94
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt (-1 / +1 lines)
Lines 36-42 Link Here
36
[% END %]
36
[% END %]
37
37
38
	[% IF ( display_daily_quote && daily_quote ) %]
38
	[% IF ( display_daily_quote && daily_quote ) %]
39
    <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>
39
    <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>
40
[% END %]
40
[% END %]
41
41
42
	[% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock" class="container">[% OpacMainUserBlock %]</div>[% END %]
42
	[% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock" class="container">[% OpacMainUserBlock %]</div>[% END %]
(-)a/tools/quotes/quotes_ajax.pl (-3 lines)
Lines 46-53 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
46
46
47
my $params = $cgi->Vars; # NOTE: Multivalue parameters NOT allowed!!
47
my $params = $cgi->Vars; # NOTE: Multivalue parameters NOT allowed!!
48
48
49
warn Dumper($params); #XXX
50
51
print $cgi->header('application/json');
49
print $cgi->header('application/json');
52
50
53
if ($params->{'action'} eq 'add') {
51
if ($params->{'action'} eq 'add') {
54
- 

Return to bug 7977