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

(-)a/koha-tmpl/opac-tmpl/bootstrap/css/overdrive.css (+25 lines)
Line 0 Link Here
1
.overdrive-thumbnail {
2
    max-width: 150px;
3
}
4
.overdrive-div {
5
    margin-top: 1em;
6
}
7
.overdrive-item {
8
    display: flex;
9
}
10
.overdrive-item > div {
11
    padding: 1em;
12
}
13
.overdrive-item-status {
14
    color: #727272;
15
    font-size: 90%;
16
    padding: .25rem .5rem
17
}
18
.overdrive-item-subtitle {
19
    font-size: 85%;
20
}
21
.overdrive-item-author {
22
    padding-bottom: .25em;
23
    margin-bottom: .25em;
24
    border-bottom: 1px solid #EEE;
25
}
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt (-1 / +2 lines)
Lines 4-9 Link Here
4
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>OverDrive search for '[% q | html %]' &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
5
<title>OverDrive search for '[% q | html %]' &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% Asset.css("css/overdrive.css") | $raw %]
7
[% BLOCK cssinclude %]
8
[% BLOCK cssinclude %]
8
[% END %]
9
[% END %]
9
</head>
10
</head>
Lines 157-163 Link Here
157
                    results.push( '<td>' );
158
                    results.push( '<td>' );
158
                    if ( prod.images.thumbnail ) {
159
                    if ( prod.images.thumbnail ) {
159
                        results.push( '<a href="', prod.contentDetails[0].href, '">' );
160
                        results.push( '<a href="', prod.contentDetails[0].href, '">' );
160
                        results.push( '<img class="thumbnail" src="', prod.images.thumbnail.href, '" />' );
161
                        results.push( '<img class="overdrive-thumbnail thumbnail" src="', prod.images.thumbnail.href, '" />' );
161
                        results.push( '</a>' );
162
                        results.push( '</a>' );
162
                    }
163
                    }
163
                    results.push( '</td>' );
164
                    results.push( '</td>' );
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-14 / +2 lines)
Lines 15-34 Link Here
15
[% INCLUDE 'doc-head-open.inc' %]
15
[% INCLUDE 'doc-head-open.inc' %]
16
<title>Your library home &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
16
<title>Your library home &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
17
[% INCLUDE 'doc-head-close.inc' %]
17
[% INCLUDE 'doc-head-close.inc' %]
18
[% BLOCK cssinclude %]
18
[% Asset.css("css/overdrive.css") | $raw %]
19
    [% FILTER collapse %]
19
[% BLOCK cssinclude %][% END %]
20
        <style>
21
            #addNote {
22
                width: 100%;
23
            }
24
            .checkout_note {
25
                border-radius: 5px;
26
                border: 1px dashed #999;
27
                padding: .5em;
28
            }
29
        </style>
30
    [% END %]
31
[% END %]
32
</head>
20
</head>
33
[% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
21
[% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
34
[% INCLUDE 'masthead.inc' %]
22
[% INCLUDE 'masthead.inc' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js (-37 / +44 lines)
Lines 70-76 KOHA.OverDriveCirculation = new function() { Link Here
70
        error_div.text(error);
70
        error_div.text(error);
71
    }
71
    }
72
72
73
    var login_link = $('<a href="#">')
73
    var login_link = $('<a class="btn btn-primary" href="#">')
74
        .click(function(e) {
74
        .click(function(e) {
75
            e.preventDefault();
75
            e.preventDefault();
76
            if( OD_password_required ) { $("#overdrive-login").modal('show'); }
76
            if( OD_password_required ) { $("#overdrive-login").modal('show'); }
Lines 120-143 KOHA.OverDriveCirculation = new function() { Link Here
120
            return;
120
            return;
121
        }
121
        }
122
122
123
        var overdrive_link = $('<a href="https://www.overdrive.com/account/" target="overdrive-account" class="overdrive-link" style="float:right">')
123
        var button_toolbar = $("<div/>").addClass("btn-toolbar").attr("role","toolbar");
124
            .text( __( "OverDrive account page" ) );
125
        $(container).append(overdrive_link);
126
124
127
        var logout_link = $('<a href="#logout" class="overdrive-logout" style="float:left">')
125
        var overdrive_link = $("<div/>").addClass("btn-group mr-2").attr("role", "group")
128
            .click(function(e) {
126
            .append( $('<a href="https://www.overdrive.com/account/" target="overdrive-account" class="btn btn-sm btn-primary overdrive-link">')
129
                e.preventDefault();
127
                .text( __( "OverDrive account page" ) ) );
130
                $(container).empty().append(error_div);
128
        button_toolbar.append(overdrive_link);
131
                logout(function(data) {
129
132
                    display_account(container, data);
130
        var logout_link = $("<div/>").addClass("btn-group mr-2").attr("role", "group")
133
                });
131
            .append( $('<a href="#logout" class="btn btn-sm btn-primary overdrive-logout">')
134
            }).text( __("Log out of your OverDrive account") );
132
                .click(function(e) {
135
        $(container).append(logout_link);
133
                    e.preventDefault();
136
        $(container).append('<br style="clear:both;"/>');
134
                    $(container).empty().append(error_div);
135
                    logout(function(data) {
136
                        display_account(container, data);
137
                    });
138
                }).text( __("Log out of your OverDrive account") ) );
139
140
        button_toolbar.append(logout_link);
141
142
        $(container).append( button_toolbar );
137
143
138
        if (data.checkouts) {
144
        if (data.checkouts) {
139
            var checkouts_div = $('<div class="overdrive-div">').html('<h3>' + __("Checkouts") + '</h3>');
145
            var checkouts_div = $('<div class="overdrive-div">').html('<h3>' + __("Checkouts") + '</h3>');
140
            var checkouts_list = $('<ul class="overdrive-list">');
146
            var checkouts_list = $('<div class="overdrive-list">');
141
            data.checkouts.items.forEach(function(item) {
147
            data.checkouts.items.forEach(function(item) {
142
                item_line(checkouts_list, item);
148
                item_line(checkouts_list, item);
143
            });
149
            });
Lines 147-153 KOHA.OverDriveCirculation = new function() { Link Here
147
153
148
        if (data.holds) {
154
        if (data.holds) {
149
            var holds_div = $('<div class="overdrive-div">').html('<h3>' + __("Holds") + '</h3>');
155
            var holds_div = $('<div class="overdrive-div">').html('<h3>' + __("Holds") + '</h3>');
150
            var holds_list = $('<ul class="overdrive-list">');
156
            var holds_list = $('<div class="overdrive-list">');
151
            data.holds.items.forEach(function(item) {
157
            data.holds.items.forEach(function(item) {
152
                item_line(holds_list, item);
158
                item_line(holds_list, item);
153
            });
159
            });
Lines 157-186 KOHA.OverDriveCirculation = new function() { Link Here
157
    }
163
    }
158
164
159
    function item_line(ul_el, item) {
165
    function item_line(ul_el, item) {
160
        var line = $('<li class="overdrive-item">');
166
        var line = $('<div class="overdrive-item">');
167
        var image_container = $('<div class="overdrive-item-thumbnail">');
161
        if (item.images) {
168
        if (item.images) {
162
            var thumb_url = item.images.thumbnail;
169
            var thumb_url = item.images.thumbnail;
163
            if (thumb_url) {
170
            if (thumb_url) {
164
                $('<img class="overdrive-item-thumbnail">')
171
                $('<img class="overdrive-thumbnail">')
165
                    .attr("src", thumb_url)
172
                    .attr("src", thumb_url)
166
                    .appendTo(line);
173
                    .appendTo( image_container );
167
            }
174
            }
168
        }
175
        }
169
        $('<div class="overdrive-item-title">')
176
        image_container.appendTo( line );
170
            .text(item.title)
177
        var item_details = $('<div class="overdrive-item-details">')
171
            .appendTo(line);
178
            .append(
172
        $('<div class="overdrive-item-subtitle">')
179
                $('<h4 class="overdrive-item-title">')
173
            .html(item.subtitle)
180
                    .text(item.title) )
181
            .append( $('<div class="overdrive-item-author">')
182
                .text(item.author) )
183
            .append(
184
                $('<div class="overdrive-item-subtitle">')
185
                    .html(item.subtitle) )
174
            .appendTo(line);
186
            .appendTo(line);
175
        $('<div class="overdrive-item-author">')
187
        var actions = $('<div class="actions">');
176
            .text(item.author)
177
            .appendTo(line);
178
        var actions = $('<span class="actions">');
179
        display_actions(actions, item.id);
188
        display_actions(actions, item.id);
180
        $('<div id="action_'+item.id+'" class="actions-menu">')
189
        item_details.append( $('<div id="action_' + item.id + '" class="actions-menu">')
181
            .append(actions)
190
            .append(actions) )
182
            .appendTo(line);
191
            .appendTo(line);
183
184
        $(ul_el).append(line);
192
        $(ul_el).append(line);
185
    }
193
    }
186
194
Lines 278-284 KOHA.OverDriveCirculation = new function() { Link Here
278
            var item = item_is_checked_out(id);
286
            var item = item_is_checked_out(id);
279
            if (item) {
287
            if (item) {
280
                var expires = new Date(item.expires);
288
                var expires = new Date(item.expires);
281
                $('<span class="overdrive-item-status">')
289
                $('<div class="overdrive-item-status">')
282
                    .text( __( "Checked out until: " )  + " " + expires.toLocaleString())
290
                    .text( __( "Checked out until: " )  + " " + expires.toLocaleString())
283
                    .appendTo(el);
291
                    .appendTo(el);
284
                $(el).append(" ");
292
                $(el).append(" ");
Lines 329-336 KOHA.OverDriveCirculation = new function() { Link Here
329
337
330
            item = item_is_on_hold(id);
338
            item = item_is_on_hold(id);
331
            if (item) {
339
            if (item) {
332
                $('<span class="overdrive-status">')
340
                $('<span class="overdrive-item-status">')
333
                    .text( __("On hold") )
341
                    .text(__("On hold"))
334
                    .appendTo(el);
342
                    .appendTo(el);
335
                $(el).append(" ");
343
                $(el).append(" ");
336
            }
344
            }
Lines 372-378 KOHA.OverDriveCirculation = new function() { Link Here
372
            }
380
            }
373
381
374
            if (item) {
382
            if (item) {
375
                $(el).append( ajax_button( __("Cancel"), function() {
383
                $(el).append( ajax_button( __("Cancel hold"), function() {
376
                    if( confirm( __("Are you sure you want to cancel this hold?") ) ) {
384
                    if( confirm( __("Are you sure you want to cancel this hold?") ) ) {
377
                        item_action({action: "remove-hold", id: id}, el, copies_available);
385
                        item_action({action: "remove-hold", id: id}, el, copies_available);
378
                    }
386
                    }
Lines 394-400 KOHA.OverDriveCirculation = new function() { Link Here
394
402
395
    function decorate_button(button, label) {
403
    function decorate_button(button, label) {
396
        $(button)
404
        $(button)
397
            .addClass("btn btn-primary btn-mini")
405
            .addClass("btn btn-primary btn-sm")
398
            .css("color","white")
406
            .css("color","white")
399
            .text(label);
407
            .text(label);
400
    }
408
    }
401
- 

Return to bug 28537