Bug 19641: Move patron templates to the footer
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / files.tt
1 [% USE KohaDates %]
2 [% USE AuthorisedValues %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Files for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
9 <body id="pat_files" class="pat">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'patron-search.inc' %]
12
13 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Files for [% INCLUDE 'patron-title.inc' %]</div>
14
15 <div id="doc3" class="yui-t2">
16     <div id="bd">
17         <div id="yui-main">
18             <div class="yui-b">
19                 [% INCLUDE 'members-toolbar.inc' %]
20
21                 <h1>Files</h1>
22
23                 [% IF errors %]
24                     <div class="dialog alert">
25                         [% IF errors.empty_upload %]The file you are attempting to upload has no contents.[% END %]
26                         [% IF errors.no_file %]You did not select a file to upload.[% END %]
27                     </div>
28                 [% END %]
29
30                 [% IF ( files ) %]
31                 <table>
32                     <thead>
33                         <tr>
34                             <th>Name</th>
35                             <th>Type</th>
36                             <th>Description</th>
37                             <th>Uploaded</th>
38                             [% IF CAN_user_borrowers_edit_borrowers %]<th>&nbsp;</th>[% END %]
39                         </tr>
40                     </thead>
41
42                     <tbody>
43                         [% FOREACH f IN files %]
44                             <tr>
45                                  <td><a href="?borrowernumber=[% borrowernumber %]&amp;op=download&amp;file_id=[% f.file_id %]">[% f.file_name %]</a></td>
46                                  <td>[% f.file_type %]</td>
47                                  <td>[% f.file_description %]</td>
48                                  <td>[% f.date_uploaded | $KohaDates %]</td>
49                                  [% IF CAN_user_borrowers_edit_borrowers %]<td><a class="btn btn-default btn-xs confirmdelete" href="?borrowernumber=[% borrowernumber %]&amp;op=delete&amp;file_id=[% f.file_id %]"><i class="fa fa-trash"></i> Delete</a></td>[% END %]
50                             </tr>
51                         [% END %]
52                     </tbody>
53                 </table>
54                 [% ELSE %]
55                 <div class="dialog message">
56                     <p>This patron has no files attached.</p>
57                 </div>
58                 [% END %]
59
60                 <form method="post" action="/cgi-bin/koha/members/files.pl" enctype="multipart/form-data">
61                     <fieldset class="rows">
62                         <legend>Upload New File</legend>
63                         <ol>
64                         <li><input type="hidden" name="op" value="upload" />
65                         <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
66                         <input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
67
68                         <label for="description">Description:</label>
69                         <input name="description" id="description" type="text" /></li>
70
71                         <li><label for="uploadfile">File:</label><input name="uploadfile" type="file" id="uploadfile" /></li>
72
73                         </ol>
74                         <fieldset class="action"><input name="upload" type="submit" id="upload" value="Upload File" /></fieldset>
75                     </fieldset>
76                 </form>
77
78             </div>
79         </div>
80
81         <div class="yui-b">
82             [% INCLUDE 'circ-menu.inc' %]
83         </div>
84     </div>
85
86 [% MACRO jsinclude BLOCK %]
87     <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
88     <script type="text/javascript">
89         $(document).ready(function(){
90             $(".confirmdelete").on("click", function(){
91                 $(this).parents('tr').addClass("warn");
92                 if(confirm(_("Are you sure you want to delete this file?"))){
93                     return true;
94                 } else {
95                     $(this).parents('tr').removeClass("warn");
96                     return false;
97                 }
98             });
99     });
100     </script>
101 [% END %]
102
103 [% INCLUDE 'intranet-bottom.inc' %]