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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-21 / +38 lines)
Lines 8-13 Link Here
8
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
8
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
9
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
9
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
10
10
11
[% BLOCK delete_shelf %]
12
    <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="deleteshelf[% shelf.shelfnumber | html %]" class="form-inline">
13
        <input type="hidden" name="op" value="delete" />
14
        <input type="hidden" name="referer" value="list" />
15
        <input type='hidden' name='category' value='[% category | html %]' />
16
        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
17
        <button type="submit" class="btn btn-link remove deleteshelf" data-shelfnumber="[% shelf.shelfnumber | html %]" data-shelfname="[% shelf.shelfname | html %]" data-shared="[% shelf.is_shared | html %]" data-count="[% contents.count | html %]"><i class="fa fa-remove" aria-hidden="true"></i> [% delete_label | html %]</button>
18
    </form>
19
[% END %]
20
11
[% INCLUDE 'doc-head-open.inc' %]
21
[% INCLUDE 'doc-head-open.inc' %]
12
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;   [% IF op == 'view' %]Contents of [% shelf.shelfname | html %][% ELSE %]Your lists[% END %]</title>[% INCLUDE 'doc-head-close.inc' %]
22
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;   [% IF op == 'view' %]Contents of [% shelf.shelfname | html %][% ELSE %]Your lists[% END %]</title>[% INCLUDE 'doc-head-close.inc' %]
13
[% BLOCK cssinclude %][% END %]
23
[% BLOCK cssinclude %][% END %]
Lines 159-164 Link Here
159
                        </h3>
169
                        </h3>
160
170
161
                         [% IF ( itemsloop ) %]
171
                         [% IF ( itemsloop ) %]
172
                            [% SET contents = shelf.get_contents %]
173
                            [% IF ( contents.count ) %]<p>This list contains [% contents.count | html %] titles</p>[% END %]
162
                            <div id="floating">
174
                            <div id="floating">
163
                             <div id="toolbar" class="toolbar clearfix">
175
                             <div id="toolbar" class="toolbar clearfix">
164
                                 <div class="list-actions">
176
                                 <div class="list-actions">
Lines 181-193 Link Here
181
                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o"></i> Edit list</button>
193
                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o"></i> Edit list</button>
182
                                        </form>
194
                                        </form>
183
195
184
                                        <form method="post" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
196
                                        [% PROCESS delete_shelf delete_label="Delete list" %]
185
                                            <input type="hidden" name="op" value="delete" />
197
186
                                            <input type="hidden" name="referer" value="list" />
187
                                            <input type='hidden' name='category' value='[% shelf.category | html %]' />
188
                                            <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
189
                                            <button type="submit" class="btn btn-link remove deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"><i class="fa fa-fw fa-remove"></i> Delete list</button>
190
                                        </form>
191
                                        [% IF category == PRIVATE && Koha.Preference('OpacAllowSharingPrivateLists') %]
198
                                        [% IF category == PRIVATE && Koha.Preference('OpacAllowSharingPrivateLists') %]
192
                                            <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelf.shelfnumber | uri %]" class="btn btn-link sharelist"><i class="fa fa-fw fa-share"></i> Share list</a>
199
                                            <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelf.shelfnumber | uri %]" class="btn btn-link sharelist"><i class="fa fa-fw fa-share"></i> Share list</a>
193
                                        [% END %]
200
                                        [% END %]
Lines 504-515 Link Here
504
                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o"></i> Edit list</button>
511
                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o"></i> Edit list</button>
505
                                        </form>
512
                                        </form>
506
513
507
                                        <form method="post" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
514
                                        [% PROCESS delete_shelf delete_label="Delete list" %]
508
                                            <input type="hidden" name="op" value="delete" />
515
509
                                            <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]"/>
510
                                            <input type="hidden" name="category" value="[% shelf.category | html %]" />
511
                                            <button type="submit" class="btn btn-link remove deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"><i class="fa fa-fw fa-remove"></i> Delete list</button>
512
                                        </form>
513
                                    [% END %]
516
                                    [% END %]
514
                                </div> <!-- / .list-actions -->
517
                                </div> <!-- / .list-actions -->
515
                            </div> <!-- / #toolbar -->
518
                            </div> <!-- / #toolbar -->
Lines 688-700 Link Here
688
                                                        </form>
691
                                                        </form>
689
                                                    [% END %]
692
                                                    [% END %]
690
                                                    [% IF s.can_be_deleted( loggedinusernumber ) %]
693
                                                    [% IF s.can_be_deleted( loggedinusernumber ) %]
691
                                                        <form action="/cgi-bin/koha/opac-shelves.pl" method="post" class="form-inline">
694
                                                        [% PROCESS delete_shelf shelf = s delete_label="Delete" %]
692
                                                            <input type="hidden" name="op" value="delete" />
693
                                                            <input type="hidden" name="referer" value="list" />
694
                                                            <input type='hidden' name='category' value='[% category | html %]' />
695
                                                            <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
696
                                                            <button type="submit" class="btn btn-link remove deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"><i class="fa fa-remove"></i> Delete</button>
697
                                                        </form>
698
                                                    [% END %]
695
                                                    [% END %]
699
                                                    [% IF s.is_private AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %]
696
                                                    [% IF s.is_private AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %]
700
                                                        <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% s.shelfnumber | uri %]" class="sharelist btn btn-link"><i class="fa fa-share"></i> Share</a>
697
                                                        <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% s.shelfnumber | uri %]" class="sharelist btn btn-link"><i class="fa fa-share"></i> Share</a>
Lines 966-971 $(function() { Link Here
966
        });
963
        });
967
    [% END %]
964
    [% END %]
968
965
966
    $(".deleteshelf").on("click", function(e){
967
        e.preventDefault();
968
        var shelf_name = $(this).data("shelfname");
969
        var shelf_number = $(this).data("shelfnumber");
970
        var is_shared = $(this).data("shared");
971
        var count = $(this).data("count");
972
        var message = "<p><i>" + shelf_name + "</i></p>";
973
        if( count ){
974
            message += "<p>" + _("Items on this list:") + " <strong>" + count + "</strong></p>";
975
        }
976
        if( is_shared ){
977
            message += "<p>" + _("This list is shared. Other users will lose access to it.") + "</p>";
978
        }
979
        confirmModal( message, _("Are you sure you want to delete this list?"), _("Yes, delete"), _("No, do not delete"), function( result ){
980
                if( result ){
981
                    $("#deleteshelf" + shelf_number ).submit();
982
                }
983
            }
984
        );
985
    });
986
969
    $(".remove_share").on("click", function(e){
987
    $(".remove_share").on("click", function(e){
970
        e.preventDefault();
988
        e.preventDefault();
971
        var shelf_name = $(this).data("shelfname");
989
        var shelf_name = $(this).data("shelfname");
972
- 

Return to bug 25281