more metadata generalization and modification
[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>
4029e8ab
TC
96<tr><td colspan="3">
97<:.set metas = [ file.metafields ] :>
98<:.if metas.size :>
99<fieldset>
100 <legend>File metadata</legend>
101
102<: .for m in metas :>
103<:#= bse.dumper(m.field) |raw :>
104<:#= bse.dumper(m) |raw :>
105<: .set name = "meta_" _ m.name :>
106<: .set mdata = file.meta_by_name(m.name) :>
107<: .set def = mdata ? mdata.value : "" :>
108<: .if m.type eq 'image' :>
109<: .set def = file.meta_by_name(m.display_name).value :>
110<: .end if :>
111<: .set tmpobj = {} :>
112<:% tmpobj.set(name, def) :>
113<: .if m.ro :>
114<: .call "inlinefieldro", name: name, field: m.field, object: tmpobj :>
115<: .else :>
116<: .call "inlinefield", name: name, field: m.field, delete: 1, object: tmpobj :>
117<: .end if :>
118<: .end for :>
119</td></tr>
b2a9e505
TC
120 <tr>
121 <td colspan="3" align="right">
122 <input type="submit" name="a_save_file" value="Save File" />
123 </td>
124 </tr>
125 </table>
126</form>