]>
Commit | Line | Data |
---|---|---|
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 | ||
c29434c9 | 44 | <: .for m in metas -:> |
4029e8ab | 45 | <:#= bse.dumper(m) |raw :> |
c29434c9 TC |
46 | <: .set name = "meta_" _ m.name -:> |
47 | <: .set mdata = file.meta_by_name(m.name) -:> | |
48 | <: .if m.type eq 'image' -:> | |
49 | <: .set def = file.meta_by_name(m.display_name) -:> | |
50 | <: .set def = def ? def.value_text : "" -:> | |
51 | <: .else -:> | |
52 | <: .set def = mdata ? mdata.value_text : "" -:> | |
53 | <: .end if -:> | |
54 | <: .if m.ro -:> | |
41dfbd05 | 55 | <: .call "inlinefieldro", name: name, field: m.field, |
c29434c9 TC |
56 | options: { default: def } -:> |
57 | <: .else -:> | |
41dfbd05 | 58 | <: .call "inlinefield", name: name, field: m.field, |
c29434c9 | 59 | options: { delete: 1, default: def } -:> |
4029e8ab | 60 | <: .end if :> |
c29434c9 | 61 | <: .end for -:> |
6dd128ea TC |
62 | </fieldset> |
63 | <p class="buttons"> | |
b2a9e505 | 64 | <input type="submit" name="a_save_file" value="Save File" /> |
6dd128ea | 65 | </p> |
b2a9e505 | 66 | </form> |