Bug 14676: (QA followup) Make title, breadcrumbs and labels consistent
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patroncards / image-manage.tt
1     [% INCLUDE 'doc-head-open.inc' %]
2     <title>Koha &rsaquo; Tools &rsaquo; Patron card creator &rsaquo; Images</title>
3     [% INCLUDE 'doc-head-close.inc' %]
4     <script type="text/javascript">
5         //<![CDATA[
6             var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this image?");
7             function DeleteConfirm() {
8                 var results = selected_images("delete");
9                 if (results.images != -1) {
10                     var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
11                     var answer = confirm(msg);
12                     if (answer) {
13                         window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
14                     }
15                     else {
16                         return; // abort delete
17                     }
18                 }
19             };
20             function selected_images(op) {
21                 var selected = new Array;
22                 var image_ids = new Array;
23                 if (document.delete_images.action.length) {
24                     for (i=0;i<document.delete_images.action.length;i++){
25                         if (document.delete_images.action[i].checked){
26                             selected.push("image_id=" + document.delete_images.action[i].value);
27                             image_ids.push(document.delete_images.action[i].value);
28                         }
29                     };
30                     images = selected.join("&");
31                     return {images:images, image_ids:image_ids};
32                 }
33                 else if (document.delete_images.action.checked){
34                         return {images:"batch_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
35                 };
36                 alert(_("Please select image(s) to %s.").format(op));
37                 return (-1);
38             };
39         $(document).ready(function() {
40             $("#delete").click(function(){
41                 return DeleteConfirm();
42             });
43          });
44         //]]>
45     </script>
46 </head>
47 <body id="pcard_image-manage" class="tools pcard">
48 [% INCLUDE 'header.inc' %]
49 [% INCLUDE 'cat-search.inc' %]
50 <div id="breadcrumbs">
51     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
52     <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
53     <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> &rsaquo;
54     Images
55 </div>
56 <div id="doc3" class="yui-t2">
57     <div id="bd">
58         <div id="yui-main">
59             <div class="yui-b">
60                     <div class="yui-g">
61                     [% INCLUDE 'patroncards-toolbar.inc' %]
62                         <div class="yui-u first">
63
64                         </div>
65                     </div>
66                 [% INCLUDE 'patroncards-errors.inc' %]
67                 <div class="yui-g">
68                     <div class="yui-u first">
69                         <h1>Upload Images</h1>
70                         <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
71                             <fieldset class="brief">
72                                 <div class="hint">
73                                     <b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported. Images <b>must</b> be less than 500KB.
74                                 </div>
75                                 <ol>
76                                 <li>
77                                     <label for="uploadfile">Select the file to upload: </label>
78                                     <input type="file" id="uploadfile" name="uploadfile" />
79                                     <input type="hidden" id="image" name="filetype" value="image" />
80                                 </li>
81                                 <li>
82                                     <label for="image_name">Image name: </label>
83                                     <div class="hint">
84                                         This will be the name by which you will refer to this image in the patron card layout editor.
85                                     </div>
86                                     <input type="text" id="image_name" name="image_name" size="20" />
87                                 </li>
88                                 </ol>
89                                 <div class="action">
90                                     <input type="hidden" name="op" value="upload" />
91                                     <input class="btn btn-default" id="uploadsu" type="submit" value="Upload" />
92                                 </div>
93                                 [% IF ( IMPORT_SUCCESSFUL ) %]
94                                     <div class="dialog message">
95                                     <h3>Image successfully uploaded</h3>
96                                     <ul><li>File: [% SOURCE_FILE %]</li>
97                                     <li>Image name: [% IMAGE_NAME %]</li></ul>
98                                     </div>
99                                 [% END %]
100                             </fieldset>
101
102                         </form>
103                     </div>
104                     <div class="yui-u">
105                     <h1>Delete Images</h1>
106                         [% IF ( TABLE ) %]
107                         <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
108                             <fieldset class="brief">
109                                 <div class="hint">
110                                     Select one or more images to delete.
111                                 </div>
112                                <table>
113                                     [% FOREACH TABL IN TABLE %]
114
115                                     [% IF ( TABL.header_fields ) %]
116
117                                     <tr>
118                                     [% FOREACH header_field IN TABL.header_fields %]
119                                     [% SWITCH header_field.field_label -%]
120                                         [% CASE "ID" %]
121                                             <th>Image ID</th>
122                                         [% CASE "Name" %]
123                                             <th>Name</th>
124                                         [% CASE " " %]
125                                             <th>Delete</th>
126                                         [% CASE %]
127                                            <th>[% header_field.field_label %]</th>
128                                     [% END %]
129                                     [% END %]
130                                     </tr>
131                                     [% ELSE %]
132                                     <tr>
133                                     [% FOREACH text_field IN TABL.text_fields %]
134                                     [% IF ( text_field.select_field ) %]
135                                         <td>
136                                             <a class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);" href="/cgi-bin/koha/patroncards/image-manage.pl?op=delete&image_id=[% text_field.field_value %]"><icon class="icon-trash"></icon> Delete</a>
137                                         </td>
138                                         <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
139                                     [% ELSIF ( text_field.field_value ) %]
140                                         <td>[% text_field.field_value %]</td>
141                                     [% ELSE %]
142                                         <td>&nbsp;</td>
143                                     [% END %]
144                                     [% END %]
145                                     </tr>
146                                     [% END %]
147                                     [% END %]
148                                 </table>
149                                 <div class="action">
150                                     <input type="hidden" name="op" value="delete" />
151                                     <input class="btn btn-default" type="button" id="delete" value="Delete selected" />
152                                 </div>
153                                 [% IF ( DELETE_SUCCESSFULL ) %]
154                                 <div id="dialog" class="dialog message">
155                                     <h3>Image(s) successfully deleted</h3>
156                                 </div>
157                                 [% END %]
158                             </fieldset>
159                         </form>
160                         [% ELSE %]
161                         <fieldset class="brief">
162                             <div class="hint">
163                                 No images are currently available.
164                             </div>
165                             [% IF ( DELETE_SUCCESSFULL ) %]
166                                 <div id="dialog" class="dialog message">
167                                     <h3>Image(s) successfully deleted</h3>
168                                 </div>
169                             [% END %]
170                         </fieldset>
171                         [% END %]
172                     </div>
173                 </div>
174             </div>
175         </div>
176     </div>
177     [% INCLUDE 'intranet-bottom.inc' %]