Bug 28955: (follow-up) Set to fall back
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-downloadshelf.tt
1 [% USE Koha %]
2 [% USE AdditionalContents %]
3 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
4 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
5 [% IF ( fullpage ) %]
6     [% INCLUDE 'doc-head-open.inc' %]
7     <title>Download list [% shelf.shelfname | html %] &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>[% INCLUDE 'doc-head-close.inc' %]
8     [% BLOCK cssinclude %][% END %]
9     </head>
10     [% INCLUDE 'bodytag.inc' bodyid='opac-downloadlist' %]
11         [% INCLUDE 'masthead.inc' %]
12         <div class="main">
13             <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
14                 <ol class="breadcrumb">
15                     <li class="breadcrumb-item">
16                         <a href="/cgi-bin/koha/opac-main.pl">Home</a>
17                     </li>
18                     [% IF ( logged_in_user ) %]
19                         <li class="breadcrumb-item"><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a></li>
20                     [% END %]
21                     <li class="breadcrumb-item">
22                         [% IF shelf.public %]
23                             <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=1">Public lists</a>
24                         [% ELSE %]
25                             <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=0">Your lists</a>
26                         [% END %]
27                     </li>
28                     <li class="breadcrumb-item active">
29                         <a href="#" aria-current="page">Download list <em>[% shelf.shelfname | html %]</em></a>
30                     </li>
31                 </ul>
32             </nav> <!-- /#breadcrumbs -->
33
34             <div class="container-fluid">
35                 <div class="row">
36                     [% IF ( OpacNav||loggedinusername ) %]
37                         <div class="col-lg-2">
38                             <div id="navigation">
39                                 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
40                             </div>
41                         </div>
42                     [% END %]
43
44                     [% IF ( OpacNav||loggedinusername ) %]
45                         <div class="col-10 order-first order-md-first order-lg-2">
46                     [% ELSE %]
47                         <div class="col order-first order-md-first order-lg-2">
48                     [% END %]
49 [% END # / IF fullpage %]
50
51                     <div id="userdownloadshelf" class="maincontent">
52
53                         [% UNLESS ( invalidlist ) %]
54
55                             <h1>Download list <em>[% shelf.shelfname | html %]</em></h1>
56                             [% IF ( format ) %]
57                                 <div class="alert alert-info">
58                                     <p>Your download should begin automatically.</p>
59                                 </div>
60                             [% ELSE %]
61                                 <form method="post" action="/cgi-bin/koha/opac-downloadshelf.pl">
62                                     <fieldset>
63                                         <select name="format" id="dlformat" required="required">
64                                             <legend>Choose format</legend>
65                                             <option value="">-- Choose format --</option>
66                                             <option value="ris">RIS (Zotero, EndNote, others)</option>
67                                             <option value="bibtex">BibTeX</option>
68                                             <option value="isbd">ISBD</option>
69                                             <option value="iso2709">MARC</option>
70                                             [% FOREACH csv_profile IN csv_profiles %]
71                                             <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option>
72                                             [% END %]
73                                         </select>
74                                         <span class="required">Required</span>
75                                     </fieldset>
76
77                                     <fieldset class="action">
78                                         <legend class="sr-only">Choose action</legend>
79                                         <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
80                                         <input type="submit" name="save" class="btn btn-primary" value="Go" />
81                                         <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel close" data-dismiss="modal">Cancel</a>
82                                     </fieldset>
83                                 </form>
84                                 [% IF ( modal ) %]
85                                     <script>
86                                         $(document).ready(function(){
87                                             $("#userdownloadshelf form").on("submit",function(e){
88                                                 if( $("#dlformat").val() == "" ){
89                                                     e.preventDefault();
90                                                     alert(_("Please choose a download format"));
91                                                 } else {
92                                                     $("#modalWin").modal("hide");
93                                                 }
94                                             });
95                                         });
96                                     </script>
97                                 [% END %]
98                             [% END # / IF format %]
99
100                         [% ELSE %]
101                             <h1>Download list unsuccessful</h1>
102                             <div class="alert alert-warning">
103                                 <p>You do not have permission to download this list.</p>
104                             </div>
105
106                         [% END # / invalidlist %]
107
108                     </div> <!-- / #userdownloadshelf -->
109
110 [% IF ( fullpage ) %]
111                 </div> <!-- / .col-10 -->
112             </div> <!-- / .row -->
113         </div> <!-- / .container-fluid -->
114     </div> <!-- / .main -->
115     [% INCLUDE 'opac-bottom.inc' %]
116     [% BLOCK jsinclude %]
117         <script>
118             $(document).ready(function(){
119                 $("#userdownloadshelf form").on("submit",function(e){
120                     if( $("#dlformat").val() == "" ){
121                         e.preventDefault();
122                         alert(_("Please choose a download format"));
123                     }
124                 });
125             });
126         </script>
127     [% END %]
128 [% END # / IF fullpage %]