make metadata more general
[bse.git] / site / templates / admin / file_edit.tmpl
CommitLineData
8a3b8db8 1<:wrap admin/base.tmpl title=>"Edit Article File":>
b2a9e505
TC
2<h1>Edit Article File</h1>
3<:ifMessage:>
4<p><b><:message:></b></p>
5<:or:><:eif:>
6<p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | <:if Match [article generator] "Product":><a href="/cgi-bin/admin/add.pl?id=<:article id:>">Edit
7 product</a> | <a href="/cgi-bin/admin/shopadmin.pl">Manage catalogs</a> <:or
8 Match:><:if Eq [article id] [cfg articles shop]:><a href="/cgi-bin/admin/add.pl?id=<:article id:>">Edit
9 shop</a><:or Eq:><a href="/cgi-bin/admin/add.pl?id=<:article id:>"><:ifMatch
10 [article generator] "Catalog":>Edit catalog<:or:>Edit article<:eif:></a><:eif
11 Eq:><:eif Match:> |</p>
12<h2>Edit article file</h2>
13
14<form method="post" action="<:script:>" enctype="multipart/form-data">
15
16<input type="hidden" name="id" value="<: article id :>" />
17<input type="hidden" name="file_id" value="<:efile id:>" />
18<input type="hidden" name="_t" value="file" />
19<input type="hidden" name="save_file_flags" value="1" />
aa6896b6 20<:csrfp admin_save_file hidden:>
36e373a9 21 <table class="editform editformsmall" id="filelist">
b2a9e505
TC
22 <tr>
23 <th align="left">Replacement file:</th>
24 <td>
f738f7b4 25 <:efile displayName:><:ifEfile file_exists:><:or:><br /><span class="alert">This file is missing!</span><:eif:><br /><input type="file" name="file" size="40" /><br />Choose a file to replace the current file or leave blank to keep the current file.
b2a9e505 26 </td>
8a3b8db8 27 <td class="help"><:help file file:> <:error_img file:></td>
b2a9e505
TC
28 </tr>
29 <tr>
30 <th align="left">Description:</th>
31 <td>
32 <input type="text" name="description" value="<:old description efile description:>" size="60"/>
33 </td>
8a3b8db8 34 <td class="help"><:help file description:> <:error_img description:></td>
b2a9e505
TC
35 </tr>
36 <tr>
37 <th align="left">Notes:</th>
38 <td>
8a3b8db8 39 <textarea name="notes" rows="10" cols="60"><:old notes efile notes:></textarea>
b2a9e505 40 </td>
8a3b8db8 41 <td class="help"><:help file notes:> <:error_img notes:></td>
b2a9e505
TC
42 </tr>
43 <tr>
44 <th align="left">Content-Type:</th>
45 <td>
46 <input type="text" name="contentType" value="<:old contentType efile contentType:>" size="40" />
47 </td>
8a3b8db8 48 <td class="help"><:help file content_type:> <:error_img contentType:></td>
b2a9e505
TC
49 </tr>
50 <tr>
51 <th align="left">Identifier:</th>
52 <td>
53 <input type="text" name="name" value="<:old name efile name:>" /> </td>
8a3b8db8 54 <td class="help"><:help file name:> <:error_img name:></td>
b2a9e505
TC
55 </tr>
56 <tr>
57 <th align="left">Treat as download:</th>
58 <td>
59 <input type="checkbox" name="download" value="1" <:ifOldChecked download:>checked="checked"<:or:><:eif:> />
60 </td>
8a3b8db8 61 <td class="help"><:help file download:> <:error_img download:></td>
b2a9e505
TC
62 </tr>
63 <tr>
64 <th align="left">Require payment:</th>
65 <td>
66 <input type="checkbox" name="forSale" value="1" <:ifOldChecked forSale:>checked="checked"<:or:><:eif:> />
67 </td>
8a3b8db8 68 <td class="help"><:help file forSale:> <:error_img forSale:></td>
b2a9e505
TC
69 </tr>
70 <tr>
71 <th align="left">Require login:</th>
72 <td>
73 <input type="checkbox" name="requireUser" value="1" <:ifOldChecked requireUser:>checked="checked"<:or:><:eif:>/>
74 </td>
8a3b8db8 75 <td class="help"><:help file requireUser:> <:error_img requireUser:></td>
b2a9e505
TC
76 </tr>
77 <tr>
78 <th align="left">Hide from list:</th>
79 <td>
80 <input type="checkbox" name="hide_from_list" value="1" <:ifOldChecked hide_from_list:>checked="checked"<:or:><:eif:>/>
81 </td>
8a3b8db8 82 <td class="help"><:help file hide_from_list:> <:error_img hide_from_list:></td>
b2a9e505 83 </tr>
e63c3728
TC
84 <tr>
85 <th align="left">Storage:</th>
86 <td>
87<select name="storage">
88<option value="">(Auto)</option>
89<:iterator begin file_stores:>
90<option value="<:file_store name:>" <:ifEq [efile storage] [file_store name]:>selected="selected"<:or:><:eif:>><:file_store description:></option>
91<:iterator end file_stores:>
92</select>
93 </td>
8a3b8db8 94 <td class="help"><:help file hide_from_list:> <:error_img hide_from_list:></td>
e63c3728 95 </tr>
36e373a9
TC
96<:if Filemetas:>
97<tr>
98 <th colspan="3">File metadata</th>
99</tr>
100<:iterator begin filemetas:>
101<tr>
102 <th><:filemeta title:></th>
103 <td>
104<:if Filemeta ro:>
105<:switch:>
106<:case Match [filemeta type] "^(integer|string|real)$" |x:>
107<:filemeta_value [filemeta name] :> <:filemeta unit:>
108<:case Eq [filemeta type] "text":>
109<textarea name="meta_<:filemeta name:>" class="meta_text_ro"><:filemeta_value [filemeta name]:></textarea>
110<:case Eq [filemeta type] "enum":>
111<:filemeta_select_label:> <:filemeta unit:>
112<:case Eq [filemeta type] "image":>
8a3b8db8
TC
113<:ifFilemeta_set [filemeta data_name]:><div class="file_display_trigger">Show
114<div class="file_display"><img src="<:filemeta_source [filemeta data_name]:>" width="<:filemeta_value [filemeta width_name]:>" height="<:filemeta_value [filemeta height_name]:>" /></div></div><:or:>(No image set)<:eif:>
36e373a9
TC
115<:case default:>
116Unknown metadata type <:filemeta type:>
117<:endswitch:>
118<:or Filemeta:>
119<:switch:>
120<:case Match [filemeta type] "^(integer|string|real)$" |x:>
121<input type="text" name="meta_<:filemeta name:>" value="<:filemeta_value [filemeta name] :>" class="meta_<:filemeta type:>" /> <:filemeta unit:>
122<:case Eq [filemeta type] "text":>
123<textarea name="meta_<:filemeta name:>" class="meta_text"><:filemeta_value [filemeta name]:></textarea>
124<:case Eq [filemeta type] "enum":>
125<:filemeta_select:> <:filemeta unit:>
126<:case Eq [filemeta type] "image":>
127<input type="file" name="meta_<:filemeta name:>" />
8a3b8db8
TC
128<:ifFilemeta_set [filemeta data_name]:><div class="file_display_trigger">Show
129<div class="file_display"><img src="<:filemeta_source [filemeta data_name]:>" width="<:filemeta_value [filemeta width_name]:>" height="<:filemeta_value [filemeta height_name]:>" /></div></div>
36e373a9
TC
130<input type="checkbox" name="delete_meta_<:filemeta name:>" value="1" />&nbsp;Delete
131<:or:>(No image set)<:eif:>
132<:case default:>
133Unknown metadata type <:filemeta type:>
134<:endswitch:>
135<:if Match [filemeta type] "image":><:or Match:>
136<:ifFilemeta_set [filemeta name]:><input type="checkbox" name="delete_meta_<:filemeta name:>" value="1" />&nbsp;Delete<:or:><:eif:>
137<:eif Match:>
138<:eif Filemeta:>
139 </td>
8a3b8db8 140 <td class="help">
36e373a9 141<:if Filemeta help:>
8a3b8db8
TC
142<div class="help_display_trigger"><img src="/images/admin/help.gif" alt="help" />
143<div class="help_display"><:filemeta help |z:></div></div>
36e373a9
TC
144<:or Filemeta:><:eif Filemeta:>
145 </td>
146</tr>
147<:iterator end filemetas:>
148<:or Filemetas:><:eif Filemetas:>
b2a9e505
TC
149 <tr>
150 <td colspan="3" align="right">
151 <input type="submit" name="a_save_file" value="Save File" />
152 </td>
153 </tr>
154 </table>
155</form>