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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-21 / +44 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>
18
            [% IF ( context == "list" ) %]
19
                Delete
20
            [% ELSE %]
21
                Delete list
22
            [% END %]
23
        </button>
24
    </form>
25
[% END %]
26
11
[% INCLUDE 'doc-head-open.inc' %]
27
[% 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' %]
28
<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 %]
29
[% BLOCK cssinclude %][% END %]
Lines 159-164 Link Here
159
                        </h3>
175
                        </h3>
160
176
161
                         [% IF ( itemsloop ) %]
177
                         [% IF ( itemsloop ) %]
178
                            [% SET contents = shelf.get_contents %]
179
                            [% IF ( contents.count ) %]<p>This list contains [% contents.count | html %] titles</p>[% END %]
162
                            <div id="floating">
180
                            <div id="floating">
163
                             <div id="toolbar" class="toolbar clearfix">
181
                             <div id="toolbar" class="toolbar clearfix">
164
                                 <div class="list-actions">
182
                                 <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>
199
                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o"></i> Edit list</button>
182
                                        </form>
200
                                        </form>
183
201
184
                                        <form method="post" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
202
                                        [% PROCESS delete_shelf context = "details" %]
185
                                            <input type="hidden" name="op" value="delete" />
203
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') %]
204
                                        [% 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>
205
                                            <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 %]
206
                                        [% 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>
517
                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o"></i> Edit list</button>
505
                                        </form>
518
                                        </form>
506
519
507
                                        <form method="post" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
520
                                        [% PROCESS delete_shelf context = "details" %]
508
                                            <input type="hidden" name="op" value="delete" />
521
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 %]
522
                                    [% END %]
514
                                </div> <!-- / .list-actions -->
523
                                </div> <!-- / .list-actions -->
515
                            </div> <!-- / #toolbar -->
524
                            </div> <!-- / #toolbar -->
Lines 688-700 Link Here
688
                                                        </form>
697
                                                        </form>
689
                                                    [% END %]
698
                                                    [% END %]
690
                                                    [% IF s.can_be_deleted( loggedinusernumber ) %]
699
                                                    [% IF s.can_be_deleted( loggedinusernumber ) %]
691
                                                        <form action="/cgi-bin/koha/opac-shelves.pl" method="post" class="form-inline">
700
                                                        [% PROCESS delete_shelf shelf = s context = "list" %]
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 %]
701
                                                    [% END %]
699
                                                    [% IF s.is_private AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %]
702
                                                    [% 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>
703
                                                        <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
        });
969
        });
967
    [% END %]
970
    [% END %]
968
971
972
    $(".deleteshelf").on("click", function(e){
973
        e.preventDefault();
974
        var shelf_name = $(this).data("shelfname");
975
        var shelf_number = $(this).data("shelfnumber");
976
        var is_shared = $(this).data("shared");
977
        var count = $(this).data("count");
978
        var message = "<p><i>" + shelf_name + "</i></p>";
979
        if( count ){
980
            message += "<p>" + _("Items on this list:") + " <strong>" + count + "</strong></p>";
981
        }
982
        if( is_shared ){
983
            message += "<p>" + _("This list is shared. Other users will lose access to it.") + "</p>";
984
        }
985
        confirmModal( message, _("Are you sure you want to delete this list?"), _("Yes, delete"), _("No, do not delete"), function( result ){
986
                if( result ){
987
                    $("#deleteshelf" + shelf_number ).submit();
988
                }
989
            }
990
        );
991
    });
992
969
    $(".remove_share").on("click", function(e){
993
    $(".remove_share").on("click", function(e){
970
        e.preventDefault();
994
        e.preventDefault();
971
        var shelf_name = $(this).data("shelfname");
995
        var shelf_name = $(this).data("shelfname");
972
- 

Return to bug 25281