make default, delete and note supplied via a options parameter
[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:>
6dd128ea
TC
21<:.set object = file -:>
22<fieldset>
23 <legend>File Details</legend>
24<:.call "field", name:"file",
25 options: {
26 default: file.displayName,
27 note: "Choose a file to replace the current file or leave blank to keep the current file."
28 } :>
29<:.call "field", name:"description" :>
30<:.call "field", name:"notes" :>
31<:.call "field", name:"contentType" :>
32<:.call "field", name:"name" :>
33<:.call "field", name:"download" :>
34<:.call "field", name:"forSale" :>
35<:.call "field", name:"requireUser" :>
36<:.call "field", name:"hide_from_list" :>
37<:.call "field", name:"storage" :>
38</fieldset>
4029e8ab
TC
39<:.set metas = [ file.metafields ] :>
40<:.if metas.size :>
41<fieldset>
42 <legend>File metadata</legend>
43
44<: .for m in metas :>
45<:#= bse.dumper(m.field) |raw :>
46<:#= bse.dumper(m) |raw :>
47<: .set name = "meta_" _ m.name :>
48<: .set mdata = file.meta_by_name(m.name) :>
49<: .set def = mdata ? mdata.value : "" :>
50<: .if m.type eq 'image' :>
51<: .set def = file.meta_by_name(m.display_name).value :>
52<: .end if :>
4029e8ab 53<: .if m.ro :>
41dfbd05
TC
54<: .call "inlinefieldro", name: name, field: m.field,
55 options: { default: def } :>
4029e8ab 56<: .else :>
41dfbd05
TC
57<: .call "inlinefield", name: name, field: m.field,
58 options: { delete: 1, default: def } :>
4029e8ab
TC
59<: .end if :>
60<: .end for :>
6dd128ea
TC
61</fieldset>
62 <p class="buttons">
b2a9e505 63 <input type="submit" name="a_save_file" value="Save File" />
6dd128ea 64 </p>
b2a9e505 65</form>