|
Lines 685-799
Link Here
|
| 685 |
|
685 |
|
| 686 |
[% ELSIF op == 'list' %] |
686 |
[% ELSIF op == 'list' %] |
| 687 |
<h1>Lists</h1> |
687 |
<h1>Lists</h1> |
| 688 |
<div class="toptabs ui-tabs ui-widget ui-widget-content ui-corner-all"> |
688 |
<div class="toptabs"> |
| 689 |
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"> |
689 |
<ul class="nav nav-tabs" id="list-tabs"> |
| 690 |
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %] |
690 |
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %] |
| 691 |
[% IF !public %] |
691 |
[% IF !public %] |
| 692 |
<li id="privateshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0">Your lists</a></li> |
692 |
<li id="privateshelves_tab" class="nav-item"> |
|
|
693 |
<a class="nav-link active" id="your_lists" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0">Your lists</a> |
| 694 |
</li> |
| 693 |
[% ELSE %] |
695 |
[% ELSE %] |
| 694 |
<li id="privateshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0">Your lists</a></li> |
696 |
<li id="privateshelves_tab" class="nav-item"> |
|
|
697 |
<a class="nav-link" id="your_lists" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0">Your lists</a> |
| 698 |
</li> |
| 695 |
[% END %] |
699 |
[% END %] |
| 696 |
[% END %] |
700 |
[% END %] |
| 697 |
[% IF public %] |
701 |
[% IF public %] |
| 698 |
<li id="publicshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1">Public lists</a></li> |
702 |
<li id="publicshelves_tab" class="nav-item"> |
|
|
703 |
<a class="nav-link active" id="public_lists" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1">Public lists</a> |
| 704 |
</li> |
| 699 |
[% ELSE %] |
705 |
[% ELSE %] |
| 700 |
<li id="publicshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1">Public lists</a></li> |
706 |
<li id="publicshelves_tab" class="nav-item"> |
|
|
707 |
<a class="nav-link" id="public_lists" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1">Public lists</a> |
| 708 |
</li> |
| 701 |
[% END %] |
709 |
[% END %] |
| 702 |
</ul> |
710 |
</ul> |
| 703 |
|
711 |
|
| 704 |
[% IF !public %] |
712 |
<div class="tab-content"> |
| 705 |
<div id="privateshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;"> |
713 |
[% IF !public %] |
| 706 |
[% ELSE %] |
714 |
<div id="privateshelves" class="tab-pane active"> |
| 707 |
<div id="publicshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;"> |
|
|
| 708 |
[% END %] |
| 709 |
|
| 710 |
[% IF !public || Koha.Preference('OpacAllowPublicListCreation') %] |
| 711 |
[% IF loggedinusername %] |
| 712 |
<div id="toolbar" class="toolbar"><a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-plus" aria-hidden="true"></i> New list</a></div> |
| 713 |
[% ELSE %] |
715 |
[% ELSE %] |
| 714 |
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %] |
716 |
<div id="publicshelves" class="tab-pane active"> |
| 715 |
<div class="alert alert-info"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form">Log in to create a new list</a></div> |
|
|
| 716 |
[% END %] |
| 717 |
[% END %] |
717 |
[% END %] |
| 718 |
[% END %] |
|
|
| 719 |
|
718 |
|
| 720 |
[% IF shelves.count %] |
719 |
[% IF !public || Koha.Preference('OpacAllowPublicListCreation') %] |
| 721 |
<table class="table"> |
720 |
[% IF loggedinusername %] |
| 722 |
[% IF !public %] |
721 |
<div id="toolbar" class="toolbar"><a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-plus" aria-hidden="true"></i> New list</a></div> |
| 723 |
<caption class="sr-only">Your lists</caption> |
722 |
[% ELSE %] |
| 724 |
[% ELSIF public %] |
723 |
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %] |
| 725 |
<caption class="sr-only">Public lists</caption> |
724 |
<div class="alert alert-info"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form">Log in to create a new list</a></div> |
|
|
725 |
[% END %] |
| 726 |
[% END %] |
726 |
[% END %] |
| 727 |
<thead> |
727 |
[% END %] |
| 728 |
<tr> |
728 |
|
| 729 |
<th>List name</th> |
729 |
[% IF shelves.count %] |
| 730 |
<th>Contents</th> |
730 |
<table class="table"> |
| 731 |
<th>Type</th> |
731 |
[% IF !public %] |
| 732 |
<th> </th> |
732 |
<caption class="sr-only">Your lists</caption> |
| 733 |
</tr> |
733 |
[% ELSIF public %] |
| 734 |
</thead> |
734 |
<caption class="sr-only">Public lists</caption> |
| 735 |
<tbody> |
735 |
[% END %] |
| 736 |
[% FOREACH s IN shelves %] |
736 |
<thead> |
| 737 |
[% SET contents = s.get_contents %] |
|
|
| 738 |
<tr> |
737 |
<tr> |
| 739 |
<td><a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a></td> |
738 |
<th>List name</th> |
| 740 |
<td>[% IF contents.count %][% contents.count | html %] [% IF contents.count == 1 %]<span>item</span>[% ELSE %]<span>items</span>[% END %][% ELSE %]<span>Empty</span>[% END %]</td> |
739 |
<th>Contents</th> |
| 741 |
<td> |
740 |
<th>Type</th> |
| 742 |
[% IF s.is_private %] |
741 |
<th> </th> |
| 743 |
[% IF s.is_shared %]<span>Shared</span>[% ELSE %]<span>Private</span>[% END %] |
|
|
| 744 |
[% ELSE %] |
| 745 |
<span>Public</span> |
| 746 |
[% END %] |
| 747 |
</td> |
| 748 |
<td> |
| 749 |
[% IF s.can_be_managed( loggedinusernumber ) %] |
| 750 |
<form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="d-inline"> |
| 751 |
<input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" /> |
| 752 |
<input type="hidden" name="public" value="[% s.public | html %]" /> |
| 753 |
<input type="hidden" name="op" value="edit_form" /> |
| 754 |
<input type="hidden" name="referer" value="list" /> |
| 755 |
<button type="submit" class="btn btn-link editshelf"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit</button> |
| 756 |
</form> |
| 757 |
[% END %] |
| 758 |
[% IF s.can_be_deleted( loggedinusernumber ) %] |
| 759 |
[% PROCESS delete_shelf shelf = s context = "list" %] |
| 760 |
[% END %] |
| 761 |
[% IF s.is_private AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %] |
| 762 |
<a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% s.shelfnumber | uri %]" class="sharelist btn btn-link"><i class="fa fa-share" aria-hidden="true"></i> Share</a> |
| 763 |
[% END %] |
| 764 |
[% IF s.is_shared AND s.can_be_managed( loggedinusernumber ) %] |
| 765 |
<form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="d-inline"> |
| 766 |
<input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" /> |
| 767 |
<input type="hidden" name="public" value="0" /> |
| 768 |
<input type="hidden" name="op" value="transfer" /> |
| 769 |
<input type="hidden" name="referer" value="list" /> |
| 770 |
<button type="submit" class="btn btn-link transfershelf"> Transfer</button> |
| 771 |
</form> |
| 772 |
[% END %] |
| 773 |
[% IF s.is_shared_with( loggedinusernumber ) %] |
| 774 |
<form action="opac-shelves.pl" method="post" id="unshare[% s.shelfnumber | html %]" class="d-inline"> |
| 775 |
<input type="hidden" name="op" value="remove_share" /> |
| 776 |
<input type="hidden" name="referer" value="list" /> |
| 777 |
<input type='hidden' name='public' value='[% public | html %]' /> |
| 778 |
<input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" /> |
| 779 |
<button type="submit" class="btn btn-link remove remove_share" |
| 780 |
data-shelfname="[% s.shelfname | html %]" data-shelfnumber="[% s.shelfnumber | html %]"><i class="fa fa-remove" aria-hidden="true"></i> Remove share</button> |
| 781 |
</form> |
| 782 |
[% END %] |
| 783 |
</td> |
| 784 |
</tr> |
742 |
</tr> |
| 785 |
[% END %] |
743 |
</thead> |
| 786 |
</tbody> |
744 |
<tbody> |
| 787 |
</table> <!-- /.table --> |
745 |
[% FOREACH s IN shelves %] |
| 788 |
<div class="pages">[% pagination_bar | $raw %]</div> |
746 |
[% SET contents = s.get_contents %] |
| 789 |
[% ELSE %] |
747 |
<tr> |
| 790 |
[% IF public %] |
748 |
<td><a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a></td> |
| 791 |
<p>No public lists.</p> |
749 |
<td>[% IF contents.count %][% contents.count | html %] [% IF contents.count == 1 %]<span>item</span>[% ELSE %]<span>items</span>[% END %][% ELSE %]<span>Empty</span>[% END %]</td> |
| 792 |
[% ELSIF loggedinusernumber %] |
750 |
<td> |
| 793 |
<p>No private lists.</p> |
751 |
[% IF s.is_private %] |
| 794 |
[% END %] |
752 |
[% IF s.is_shared %]<span>Shared</span>[% ELSE %]<span>Private</span>[% END %] |
| 795 |
[% END # /IF shelves.count %] |
753 |
[% ELSE %] |
| 796 |
</div> |
754 |
<span>Public</span> |
|
|
755 |
[% END %] |
| 756 |
</td> |
| 757 |
<td> |
| 758 |
[% IF s.can_be_managed( loggedinusernumber ) %] |
| 759 |
<form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="d-inline"> |
| 760 |
<input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" /> |
| 761 |
<input type="hidden" name="public" value="[% s.public | html %]" /> |
| 762 |
<input type="hidden" name="op" value="edit_form" /> |
| 763 |
<input type="hidden" name="referer" value="list" /> |
| 764 |
<button type="submit" class="btn btn-link editshelf"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit</button> |
| 765 |
</form> |
| 766 |
[% END %] |
| 767 |
[% IF s.can_be_deleted( loggedinusernumber ) %] |
| 768 |
[% PROCESS delete_shelf shelf = s context = "list" %] |
| 769 |
[% END %] |
| 770 |
[% IF s.is_private AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %] |
| 771 |
<a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% s.shelfnumber | uri %]" class="sharelist btn btn-link"><i class="fa fa-share" aria-hidden="true"></i> Share</a> |
| 772 |
[% END %] |
| 773 |
[% IF s.is_shared AND s.can_be_managed( loggedinusernumber ) %] |
| 774 |
<form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="d-inline"> |
| 775 |
<input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" /> |
| 776 |
<input type="hidden" name="public" value="0" /> |
| 777 |
<input type="hidden" name="op" value="transfer" /> |
| 778 |
<input type="hidden" name="referer" value="list" /> |
| 779 |
<button type="submit" class="btn btn-link transfershelf"> Transfer</button> |
| 780 |
</form> |
| 781 |
[% END %] |
| 782 |
[% IF s.is_shared_with( loggedinusernumber ) %] |
| 783 |
<form action="opac-shelves.pl" method="post" id="unshare[% s.shelfnumber | html %]" class="d-inline"> |
| 784 |
<input type="hidden" name="op" value="remove_share" /> |
| 785 |
<input type="hidden" name="referer" value="list" /> |
| 786 |
<input type='hidden' name='public' value='[% public | html %]' /> |
| 787 |
<input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" /> |
| 788 |
<button type="submit" class="btn btn-link remove remove_share" |
| 789 |
data-shelfname="[% s.shelfname | html %]" data-shelfnumber="[% s.shelfnumber | html %]"><i class="fa fa-remove" aria-hidden="true"></i> Remove share</button> |
| 790 |
</form> |
| 791 |
[% END %] |
| 792 |
</td> |
| 793 |
</tr> |
| 794 |
[% END %] |
| 795 |
</tbody> |
| 796 |
</table> <!-- /.table --> |
| 797 |
<div class="pages">[% pagination_bar | $raw %]</div> |
| 798 |
[% ELSE %] |
| 799 |
[% IF public %] |
| 800 |
<p>No public lists.</p> |
| 801 |
[% ELSIF loggedinusernumber %] |
| 802 |
<p>No private lists.</p> |
| 803 |
[% END %] |
| 804 |
[% END # /IF shelves.count %] |
| 805 |
</div> <!-- /.tab-content --> |
| 806 |
</div> <!-- /.toptabs --> |
| 797 |
[% ELSIF NOT loggedinusernumber %] |
807 |
[% ELSIF NOT loggedinusernumber %] |
| 798 |
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %] |
808 |
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %] |
| 799 |
<div class="alert alert-info"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form">Log in to create a new list</a></div> |
809 |
<div class="alert alert-info"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form">Log in to create a new list</a></div> |
| 800 |
- |
|
|