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