1511eeec1ae5b01d68157f9a04332afc6276488c
[bse.git] / site / templates / admin / edit_1.tmpl
1 <:wrap admin/base.tmpl title=>[cond [ifNew] [cat "New " [articleType]] [cat "Edit " [articleType] ": " [article title]]], js => "admin_edit.js":>
2 <h1><:ifNew:>New<:or:>Edit<:eif:> <:articleType:></h1>
3 <:if Message:> 
4 <div id="message" <:ifError:>class="error"<:or:><:eif:>><:message:></div>
5 <:or Message:><:eif Message:> 
6 <:include admin/include/article_menu.tmpl:>
7
8   <h2><:articleType:> Details</h2>
9
10 <p>Path: / <a href="<:script:>?id=-1">(Sections)</a> <:iterator begin crumbs:>/ <a href="<:script:>?id=<:crumb id:>"><:crumb title |h:></a> <:iterator end crumbs:>/</p>
11
12 <:ifNew:><:or:>
13 <:if Or [iadminuser_count] [iadmingroup_count]:>
14       <form action="/cgi-bin/admin/adminusers.pl" name="access">
15   <input type="hidden" name="id" value="<: article id:>" />
16         <table class="editform editformtiny">
17           <tr>
18             <th>Manage access: </th>
19             <td>
20               <select name="adminid">
21 <:iterator begin adminusers:>
22 <option value="<:iadminuser id:>">User <:iadminuser logon:>
23 </option><:iterator end adminusers:>
24 <:iterator begin admingroups:>
25 <option value="<:iadmingroup id:>">Group <:iadmingroup name:>
26 </option><:iterator end admingroups:>
27               </select>
28               <input type="submit" name="a_showobjectart" value="Manage" />
29       </td>
30             <td class="help"><:help access manage:>
31         </td>
32           </tr>
33         </table>
34       </form>
35 <br />
36 <:or Or:><:eif Or:>
37 <:eif:>
38   <form enctype="multipart/form-data" method="post" action="<:script:>" name="edit">
39
40     <input type="hidden" name="lastModified" value="<:article lastModified :>" />
41     <input type="hidden" name="type" value="Article" />
42     <input type="hidden" name="level" value="<: level :>" />
43     <input type="hidden" name="id" value="<: article id :>" />
44 <:ifNew:><:csrfp admin_add_article hidden:><:or:><:csrfp admin_save_article hidden:><:eif:>
45         <table class="editform">
46           <tr> 
47             <th>Parent:</th>
48             <td> 
49               <:if FieldPerm parentid:><select name="parentid">
50                 <option value="">Please select a <:parentType:></option><: list:>
51               </select><:or FieldPerm:><:parent title:> (<:parent id:>)<:eif FieldPerm:>
52             </td>
53             <td class="help"><:help edit section:> <:error_img parentid:></td>
54           </tr>
55           <tr> 
56             <th>Title:</th>
57             <td> 
58             <:ifFieldPerm title:><input type="text" name="title" maxlength="<:cfg fields title_size 255:>" size="64" value="<: old title default title :>" />
59             <:or:><:default title:><:eif:></td>
60             <td class="help"><:help edit title:> <:error_img title:></td>
61           </tr>
62           <:if Cfg "title alias" [concatenate level [article level]]:><tr>
63             <th>Alias:</th>
64             <td>
65               <:if FieldPerm titleAlias:><input type="text" name="titleAlias" maxlength="<:cfg fields alias_size 60:>" size="60" value="<:old titleAlias article titleAlias:>" /><:or FieldPerm:><:article titleAlias:><:eif FieldPerm:>
66             </td>
67             <td class="help"><:help edit titleAlias:> <:error_img titleAlias:></td>
68           </tr><:or Cfg:><:eif Cfg:>
69           <tr> 
70             <th>Summary: 
71             </th>
72             <td> 
73             <:ifFieldPerm summary:><input type="text" name="summary" maxlength="<:cfg fields summary_size 255:>" size="64" value="<: old summary default summary :>" />
74             <:or:><:default summary:><:eif:></td>
75             <td class="help"><:help edit summary:> <:error_img summary:></td>
76           </tr>
77           <:if Cfg image title:><tr> 
78             <th>Title image:</th>
79             <td><:ifFieldPerm titleImage:><:titleImages:> (upload this to 
80               the /images/titles directory)<:or:><:article titleImage:><:eif:></td>
81             <td class="help"><:help edit titleImage:> <:error_img titleImage:></td>
82           </tr><:or Cfg:><:eif Cfg:>
83           <tr> 
84             <th> Body: </th>
85             <td> 
86               <:if FieldPerm body:><textarea name="body" rows="10" cols="60"><: old body default body :></textarea>
87               <:or FieldPerm:><:bodytext article body:><:eif FieldPerm:>
88             </td>
89             <td class="help"><:help body body:> <:error_img body:></td>
90           </tr>
91           <:if Cfgsection [concatenate level [article level] " menus"]:><tr> 
92             <th>Menu:</th>
93             <td> 
94               <:if FieldPerm menu:><select name="menu" id="menu">
95                 <:iterator begin cfgsection [concatenate level [article level] " menus"] sort=key:><option value="<:cfgentry key:>"<:if Eq [old menu] [cfgentry key]:> selected="selected"<:or Eq:><:eif Eq:>><:cfgentry value:></option><:iterator separator cfgsection:>
96                 <:iterator end cfgsection:>
97               </select><:or FieldPerm:><:article menu:><:eif FieldPerm:>
98             </td>
99             <td class="help"><:help article menu:> <:error_img menu:></td>
100           </tr><:or Cfgsection:><:eif Cfgsection:>
101           <tr> 
102             <th>Template:</th>
103             <td><:ifFieldPerm template:> <:templates:><:or:><:article template:><:eif:> </td>
104             <td class="help"><:help edit template:> <:error_img template:></td>
105           </tr>
106                   <tr> 
107             <th>List article:</th>
108             <td> <:if FieldPerm listed:><:list listed:><:or FieldPerm:><:if Article listed:><:ifEq [article listed] "1":>Yes<:or:>In Sections, but not menu<:eif:><:or Article:>No<:eif Article:><:eif FieldPerm:> </td>
109             <td class="help"><:help edit listed:> <:error_img listed:></td>
110           </tr>
111           <tr> 
112             <th>Link alias:</th>
113             <td> 
114             <:ifFieldPerm linkAlias:><input type="text" name="linkAlias" maxlength="<:cfg fields linkAlias_size 255:>" size="40" value="<: old linkAlias article linkAlias :>" />
115             <:or:><:default linkAlias:><:eif:></td>
116             <td class="help"><:help edit linkAlias:> <:error_img linkAlias:></td>
117           </tr>
118                   <tr>
119             <th>Flags:</th>
120             <td><:iterator begin flags:><:if FieldPerm flags:>
121               <input type="checkbox" name="flags" value="<:flag id:>" <:ifFlagSet [flag id]:>checked<:or:>
122               <:eif:> /><:or FieldPerm:><:ifFlagSet [flag id]:>Yes<:or:>No<:eif:>
123               <:eif FieldPerm:><:flag desc:><:iterator separator flags:><br /><:iterator end flags:></td>
124             <td class="help"><:help edit flags:> <:error_img flags:></td>
125           </tr>
126           <tr>
127             <th>Page title:</th>
128             <td>
129               <:ifFieldPerm pageTitle:><input type="text" name="pageTitle" value='<:old pageTitle article pageTitle:>' size="60" maxlength="255" /> (alternate title)<:or:><:article pageTitle:><:eif:>
130             </td>
131            <td class="help"><:help edit pageTitle:> <:error_img pageTitle:></td>
132           </tr>
133           <tr>
134             <th>Meta description:</th>
135             <td>
136               <:ifFieldPerm metaDescription:><input type="text" name="metaDescription" value='<:old metaDescription article metaDescription:>' size="60" maxlength="255" /><:or:><:article metaDescription:><:eif:>
137             </td>
138            <td class="help"><:help edit metaDescription:> <:error_img metaDescription:></td>
139           </tr>
140           <tr>
141             <th>Meta keywords:</th>
142             <td>
143               <:ifFieldPerm metaKeywords:><input type="text" name="metaKeywords" value='<:old metaKeywords article metaKeywords:>' size="60" maxlength="255" /> (comma separated)<:or:><:article metaKeywords:><:eif:>
144             </td>
145            <td class="help"><:help edit metaKeywords:> <:error_img metaKeywords:></td>
146           </tr>
147                   <tr>
148             <th>Author name:</th>
149             <td>
150               <:if FieldPerm author:><input type="text" name="author" value='<:ifCfg editor auto_author:><:old author adminuser name:><:or:><:old author:><:eif:>' size="40" maxlength="255" /><:or FieldPerm:><:article author:><:eif FieldPerm:>
151             </td>
152             <td class="help"><:help edit author:> <:error_img author:></td>
153           </tr>
154                   <tr> 
155             <th>Release date:</th>
156             <td> 
157               <:if FieldPerm release:><input type="text" name="release" value="<: old release date "%d/%m/%Y" default release :>" size="10" maxlength="10" />
158               (dd/mm/yyyy<: ifNew :> - default is today<: or :><: eif :>)<:or FieldPerm:><: date "%d/%m/%Y" article release :><:eif FieldPerm:></td>
159             <td class="help"><:help edit release:> <:error_img release:></td>
160           </tr>
161           <tr> 
162             <th>Expiry date:</th>
163             <td> 
164               <:if FieldPerm expire:><input type="text" name="expire" value="<: old expire date "%d/%m/%Y" default expire :>" size="10" maxlength="10" />
165               (dd/mm/yyyy - <: ifNew :>default is never, <: or :><: eif :>blank 
166               for never expires)<:or FieldPerm:><: date "%d/%m/%Y" article expire :><:eif FieldPerm:></td>
167             <td class="help"><:help edit expire:> <:error_img expire:></td>
168           </tr>
169           <tr> 
170             <th>Summary length:</th>
171             <td> 
172               <:if FieldPerm summaryLength:><input type="text" name="summaryLength" size="10" maxlength="10" value="<: old summaryLength default summaryLength :>" />
173               (in characters - <: ifNew :>default inherited from <:parentType:>, <: or :><: eif :> 
174               zero for no summary)<:or FieldPerm:><: article summaryLength :><:eif FieldPerm:></td>
175             <td class="help"><:help edit summary:> <:error_img summaryLength:></td>
176           </tr>
177           <tr> 
178             <th>Display threshold:</th>
179             <td> 
180               <:ifFieldPerm threshold:><input type="text" name="threshold" size="10" maxlength="10" value="<: old threshold default threshold :>" /><:or:><: article threshold :><:eif:>
181             </td>
182             <td class="help"><:help edit threshold:> <:error_img threshold:></td>
183           </tr>
184 <:include admin/include/edit_common.tmpl:>
185 <:include admin/article_custom.tmpl optional:>
186 <:include admin/include/article_cfg_custom.tmpl:>
187           <tr> 
188             <th>Thumbnail image:</th>
189             <td> 
190               <:ifFieldPerm thumbImage:>
191               <input type="file" name="thumbnail" /><:or:><:eif:>
192               <:ifArticle thumbImage:><img src="/images/<:article thumbImage:>"> 
193               <:if FieldPerm thumbImage:><input type="checkbox" name="remove_thumb" />
194             Remove<:or FieldPerm:><:eif FieldPerm:><:or:><:eif:></td>
195             <td class="help"><:help edit thumb:> <:error_img
196             thumbImage:></td>
197           </tr>
198           <:if Article id:> 
199           <tr> 
200             <th><a name="files"></a>Files:</th>
201             <td> <:if Files:> 
202                     <table class="editform">
203                       <tr bgcolor="#FFFFFF"> 
204                         <th>Filename</th>
205                         <th>Size</th>
206                         <th>Type</th>
207                         <th>D/l</th>
208                         <th>Pay</th>
209                         <th>User</th>
210                       </tr>
211                       <:iterator begin files:> 
212                       <tr bgcolor="#FFFFFF"> 
213                         <td><:file displayName:></td>
214                         <td align="center"><:kb file sizeInBytes:></td>
215                         <td><:file contentType:></td>
216                         <td align="center"><:ifFile download:>Yes<:or:>No<:eif:></td>
217                         <td align="center"><:ifFile forSale:>Yes<:or:>No<:eif:></td>
218                         <td align="center"><:ifFile requireUser:>Yes<:or:>No<:eif:></td>
219                       </tr>
220                       <:iterator end files:> 
221                     </table>
222               <div><a href="<:script:>?id=<:article id:>&amp;_t=file"><b>Manage Files</b></a>
223               </div>
224               <:or Files:>
225               <div>No files are attached to this article. <a href="<:script:>?id=<:article id:>&amp;_t=file"><b>Manage Files</b></a></div>
226               <:eif Files:>
227             </td>
228             <td class="help"><:help edit files:> <:error_img
229             files:></td>
230           </tr>
231           <tr> 
232             <th>Images: 
233             </th>
234             <td id="images"><:if Images:> <:iterator begin 
235               images:> <img src="/images/<: image image :>" alt="<:image alt :>" width="<:image width:>" height="<:image height:>" /> <:iterator separator images:> 
236               <hr noshade size="1">
237               <: iterator end images :>
238               <p align="left"><a href="<:script:>?id=<:article id:>&amp;_t=img">Manage Images</a></p>
239               <:or Images:>
240               No images are attached to this article.  <a href="<:script:>?id=<:article id:>&amp;_t=img">Manage Images</a>
241               <:eif Images:>
242             </td>
243             <td class="help"><:help edit images:> <:error_img
244             images:></td>
245           </tr>
246           <:or Article:><:eif Article:> 
247         </table>
248 <:.set metas = [ article.metafields ] -:>
249 <:  .if metas.size -:>
250 <fieldset>
251   <legend>Article Metadata</legend>
252 <input type="hidden" name="_save_meta" value="1">
253 <:  .for m in metas -:>
254 <:#= bse.dumper(m) |raw :>
255 <:    .set name = "meta_" _ m.name -:>
256 <:    .set mdata = article.meta_by_name(m.name) -:>
257 <:    .if m.type eq 'image' -:>
258 <:      .set def = article.meta_by_name(m.display_name) -:>
259 <:      .set def = def ? def.value_text : "" -:>
260 <:    .else -:>
261 <:      .set def = mdata ? mdata.value_text : "" -:>
262 <:    .end if -:>
263 <:    .if m.ro -:>
264 <:      .call "inlinefieldro", name: name, field: m.field,
265                 options: { default: def } -:>
266 <:    .else -:>
267 <:      .call "inlinefield", name: name, field: m.field, 
268                 options: { delete: 1, default: def } -:>
269 <:    .end if :>
270 <:  .end for -:>
271 </fieldset>
272 <:  .end if -:>
273
274   <p><: ifNew :>
275     <input type="submit" name="save" value="Add New <: articleType:>" />
276    <:or:>
277   <:if UserCan edit_save:article:><input type="submit" name="save" value="Update <: articleType:>" /><:or UserCan:><:eif UserCan:>
278    <:eif:></p>
279   </form>
280 <:if Children:> <:ifEq [article id] [cfg articles shop]:> 
281 <h2>Catalogs</h2>
282 <:or:> 
283 <h2><: childtype :></h2>
284 <:eif:><a name="children"></a> 
285       <table class="editform">
286         <tr> 
287           <th width="30%">Title</th>
288           <th width="70%">Summary</th>
289           <th>Listed</th>
290           <th nowrap="nowrap">Modify</th>
291                   <th nowrap="nowrap">Move</th>
292         </tr>
293 <:if UserCan edit_reorder_children:article:>
294         <tr> 
295           <td colspan="5" bgcolor="#FFFFFF">Sort by:
296 <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&amp;sort=title&amp;refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">title</a> |
297 <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&amp;sort=date&amp;refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">date</a> |
298 <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&amp;reverse=1&amp;refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">reverse</a> |
299 <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&amp;sort=shuffle&amp;refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">shuffle</a></td>
300         </tr>
301 <:or UserCan:><:eif UserCan:>
302         <:iterator begin children:> 
303         <tr bgcolor="#FFFFFF"> 
304           <td width="30%"><a href="<:child admin:>"><:child title:></a></td>
305           <td width="70%"><: summary child body :></td>
306           <td align="center"><: is child listed :></td>
307           <td nowrap="nowrap"> <a href="/cgi-bin/admin/add.pl?id=<:child id:>">Edit</a> 
308             <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&amp;remove=1&amp;_csrfp=<:csrfp admin_remove_article:>" onclick="return window.confirm('Are you sure you want to delete this <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>')">Delete</a><:or UserCan:><:eif UserCan:></td>
309                   <td nowrap="nowrap"><:movechild:></td>
310         </tr>
311         <:iterator separator children:> <:iterator end children:> 
312       </table>
313 <:or Children:>
314 <:eif Children:>
315 <:if HaveChildType:>
316 <:if New:>
317 <:or New:>
318 <:if UserCan edit_add_child:article:><form action="/cgi-bin/admin/add.pl" name="addchild">
319 <input type="hidden" name="parentid" value="<:article id:>" />
320   <p> 
321     <input type="submit" value="Add <:ifEq [article id] [cfg articles shop]:>Catalog<:or:><: childtype :><:eif:>" />
322   </p>
323 </form><:or UserCan:><:eif UserCan:>
324 <:eif New:> <:or HaveChildType:> <:eif HaveChildType:>
325
326 <h2>Metadata</h2>
327
328 <table class="editform">
329   <tr>
330     <th>Last Modified</th>
331     <td><:= bse.date("%H:%M %d/%m/%Y", article.lastModified) -:></td>
332   </tr>
333   <tr>
334     <th>Last Modified By</th>
335     <td><:= article.lastModifiedBy eq "" ? "(unknown)" : article.lastModifiedBy -:></td>
336   </tr>
337   <tr>
338     <th>Link</th>
339     <td><a href="<:= article.link -:>"><:= article.link -:></a></td>
340   </tr>
341   <tr>
342     <th>Generator</th>
343     <td><:= article.generator -:></td>
344   </tr>
345   <tr>
346     <th>Created</th>
347     <td><:= bse.date("%H:%M %d/%m/%Y", article.created) -:></td>
348   </tr>
349   <tr>
350     <th>Created By</th>
351     <td><:= article.createdBy eq "" ? "(unknown)" : article.createdBy -:></td>
352   </tr>
353 </table>