1 <:.set article_type = cfg.entry("level names", article.level, "Article") -:>
3 <:-.if images.size > 1 -:>
4 <:.set up_url = loop.is_first ? ""
5 : cfg.admin_url2("add", "moveimgup",
9 _csrfp: request.get_csrf_token("admin_move_image")
11 <:.set down_url = loop.is_last ? ""
12 : cfg.admin_url2("add", "moveimgdown",
16 _csrfp: request.get_csrf_token("admin_move_image")
18 <:.call "make_arrows", down_url:down_url, up_url: up_url -:>
21 <:.wrap "admin/basej.tmpl", title:"Image Wizard", js:"admin_jedit.js" :>
22 <h1><:.if article.id == -1:>Global<:.else:><:= article_type :><:.end if:> Image Wizard</h1>
26 <p>| <a href="<:= cfg.admin_url("menu") :>">Admin menu</a> |
27 <:.if article.generator =~ /Product/ :>
28 <a href="<:= cfg.admin_url("add", { id: article.id }) :>">Edit product</a> |
29 <a href="<:= cfg.admin_url("shopadmin") :>">Manage catalogs</a> |
30 <:.elsif article.id == cfg.entry("articles", "shop", 3) -:>
31 <a href="/cgi-bin/admin/add.pl?id=<:article id:>">Edit shop</a> |
32 <:.elsif article.id == -1 -:>
33 <a href="/cgi-bin/admin/add.pl?id=<:article id:>">Edit sections</a> |
35 <a href="/cgi-bin/admin/add.pl?id=<:article id:>"><:.if article.generator =~ /Catalog/:>Edit catalog<:.else:>Edit article<:.end if:></a> |
39 <a href="<:= cfg.admin_url("add", {id:article.id, "_t": "img", f_showfull:1}) :>">Full size images</a> |
42 <a href="<:= cfg.admin_url("add", {id:article.id, _t: "img"}):>">With Thumbnails</a> |
46 <:.if request.user_can("edit_images_add", article) -:>
47 <h2>Add new image</h2>
49 <form method="post" action="<:script:>" enctype="multipart/form-data" name="add">
51 <input type="hidden" name="level" value="<:= article.level :>" />
52 <input type="hidden" name="id" value="<:= article.id :>" />
53 <input type="hidden" name="parentid" value="<:= article.parentid :>" />
54 <input type="hidden" name="_t" value="img" />
55 <:csrfp admin_add_image hidden:>
58 <th>Image file to add:</th>
60 <input type="file" name="image" />
62 <td class="help"><:help image file:> <:.call "error_img", field: "image":></td>
65 <th>Alt text for image:</th>
67 <input type="text" name="altIn" value="<:.call "old", field:"altIn":>" />
69 <td class="help"><:help image alt:> <:.call "error_img", field: "altIn":></td>
72 <th>URL for image:</th>
74 <input type="text" name="url" value="<:.call "old", field: "url":>" />
76 <td class="help"><:help image url:> <:.call "error_img", field: "url":></td>
79 <th>Identifier for image:</th>
81 <input type="text" name="name" value="<:.call "old", field: "name":>" />
83 <td class="help"><:help image name:> <:.call "error_img", field: "name":></td>
88 <input type="hidden" name="_save_tags" value="1" />
90 <:- .set tags = [ cgi.param("tags") ] :>
91 <:- .if tags.size == 0 :>
95 <div class="tag"><input type="text" name="tags" value="<:= tag :>" /><:.call "error_img_n", field:"tags", index:loop.index :></div>
99 <td class="help"><:help edit tags:></td>
104 <select name="storage">
105 <option value="">(Auto)</option>
106 <:iterator begin image_stores:>
107 <option value="<:image_store name:>"><:image_store description:></option>
108 <:iterator end image_stores:>
111 <td class="help"><:help image storage:> <:error_img storage:></td>
114 <td colspan="3" class="buttons">
115 <input type="submit" name="addimg" value="Add Image" />
122 <:.set images = [ article.images ] -:>
123 <:.set can_save = request.user_can("edit_images_save", article) -:>
124 <:.set can_delete = request.user_can("edit_images_delete", article) -:>
125 <:.set delete_token = request.get_csrf_token("admin_remove_image") -:>
127 <form method="post" action="<:= cfg.admin_url("add") :>" enctype="multipart/form-data" name="manage">
128 <input type="hidden" name="level" value="<:= article.level :>" />
129 <input type="hidden" name="id" value="<:= article.id :>" />
130 <input type="hidden" name="parentid" value="<:= article.parentid :>" />
131 <input type="hidden" name="_t" value="img" />
132 <:csrfp admin_save_images hidden:>
133 <h2>Manage images</h2>
134 <table class="editform images">
135 <:.if images.size:><:.if article.id != -1
136 and cfg.entry("basic", "auto_images", 1)-:>
138 <th colspan="6">First Image Position</th>
142 <input type="radio" name="imagePos" value="tl" <:= article.imagePos eq "tl" ? "checked " : "":>/>Top Left
143 <input type="radio" name="imagePos" value="tr" <:= article.imagePos eq "tr" ? "checked " : "":>/>Top Right
144 <input type="radio" name="imagePos" value="bl" <:= article.imagePos eq "bl" ? "checked " : "":>/>Bottom Left
145 <input type="radio" name="imagePos" value="br" <:= article.imagePos eq "br" ? "checked " : "":>/>Bottom Right
146 <input type="radio" name="imagePos" value="xx" <:= article.imagePos eq "xx" ? "checked " : "":>/>Don't automatically insert images
148 <:help image position:>
156 <th colspan="2"> </th>
157 <th class="col_tags">Tags</th>
158 <th class="col_modify"> Modify</th>
159 <th class="col_move"> Move</th>
161 <:.for image in images:>
163 <td rowspan="5" class="col_thumbnail"><a href="#" onclick="window.open('<:= image.src:>', 'fullimage', 'width=<:= 20 + image.width:>,height=<:= 30 + image.height:>,location=no,status=no,menubar=no,scrollbars=yes'); return false;"><:= image.thumb("geo", "editor") |raw:></a></td>
165 <td class="col_field">
166 <:.if can_save:><input type="text" name="alt<:= image.id:>" value="<:.call "old", field:"alt" _ image.id, default: image.alt :>" size="32" /><:.else:><:= image.alt :><:.end if:>
168 <td class="col_tags" rowspan="5">
169 <input type="hidden" name="_save_image_tags<:= image.id:>" value="1">
170 <div class="tags" data-name="tags<:= image.id :>">
171 <:.if cgi.param("_save_image_tags" _ image.id) -:>
172 <:.set image_tags = [ cgi.param("tags" _ image.id) ] -:>
174 <:.set image_tags = [ image.tags ] -:>
175 <:% image_tags.push("") -:>
177 <:.for tag in image_tags :>
178 <div class="tag"><input type="text" name="tags<:= image.id :>" value="<:= tag :>"><:.call "error_img_n", field:"tags" _ image.id, index: loop.index :></div>
182 <td class="col_modify" rowspan="5">
184 <b><a href="<:= cfg.admin_url("add", { id:article.id, "removeimg_" _ image.id:1, _t:"img", _csrfp: delete_token}):>" onClick="return window.confirm('Are you sure you want to delete this Image')">Delete</a></b>
187 <a href="<:= cfg.admin_url2("add", "edit_image", { id:article.id, image_id:image. id}):>">Edit</a>
190 <td class="col_move" rowspan="5">
191 <:.call "image_move":></td>
195 <td class="col_field">
196 <:.if can_save :><input type="text" name="url<:= image.id :>" value="<:.call "old", field:"url" _ image.id, default:image.url :>" size="32" /><:.else:><:= image.url :><:.end if:>
201 <td class="col_field">
202 <:.if can_save :><input type="text" name="name<:= image.id:>" value="<:.call "old", field: "name" _ image.id, default: image.name :>" size="32" /> <:.call "error_img", field: "name" _ image.id :><:.else:><:= image.name :><:.end if:>
207 <td class="col_field">
208 <:.if can_save :><input type="file" name="image<:= image.id:>" size="32" /> <:.call "error_img", field: "image" _ image.id:><:.else:><:= image.displayName :><:.end if:>
213 <td class="col_field">
215 <:.set stores = [ image_stores() ] -:>
216 <:.set oldstore = cgi.param("storage").defined
217 ? cgi.param("storage") : image.storage -:>
219 <select name="storage<:= image.id:>">
220 <option value="">(Auto)</option>
221 <:.for store in stores :>
222 <option value="<:= store.name:>"<:= oldstore eq store.name ? " selected" : "" :>><:= store.description:></option>
224 </select><:.call "error_img", field: "storage" _ image.id:><:.else:><:= image.storage :><:.end if:>
230 <th colspan="5">Image</th>
232 <:.for image in images :>
234 <td class="col_image" colspan="5"><:= image.inline("align", "center") |raw:></td>
238 <th class="col_url"> URL</th>
240 <th class="col_modify"> Modify</th>
241 <th class="col_move"> Move</th>
245 <:.if can_save:><input type="text" name="alt<:= image.id:>" value="<:.call "old", field: "alt" _ image.id, default: image.alt:>" size="32" /><:.else:><:= image.alt :><:.end if:>
248 <:.if can_save:><input type="text" name="url<:=image.id:>" value="<:.call "old", field: "url" _ image.id, default: image.url :>" size="32" /><:.else:><:= image.url :><:.end if:>
250 <td class="col_identifier">
251 <:.if can_save:><input type="text" name="name<:= image.id:>" value="<:.call "old", field: "name" _ image.id, default: image.name:>" size="32" /> <:.call "error_img", field: "name" _ image.id :><:.else:><:= image.name :><:.end if:>
253 <td class="col_modify">
254 <:.if can_save:><b><a href="<:= cfg.admin_url("add", { id:article.id, "removeimg_" _ image.id:1, _t:"img", _csrfp: delete_token}):>" onClick="return window.confirm('Are you sure you want to delete this Image')">Delete</a></b><:.end if:></td>
255 <td class="col_move"><:.call "image_move":></td>
257 <:.if !loop.is_last :>
259 <td colspan="5"> </td>
266 <td colspan="6" class="buttons">
267 <input type="submit" name="process" value="Save changes" />
272 <tr><td colspan="5" align="center" bgcolor="#FFFFFF">
273 <:-= article.id == -1 ? "There are no global images"
274 : "No images are attached to this article" :></td>
279 <script type="text/html" id="add_link">
280 <div class="tag_add"><a href="#" class="tag_add_click">Add</a></div>
282 <script type="text/html" id="tag_field">
283 <div class="tag"><input type="text" name="{{fname}}"><a href="#" class="tag_delete_click">Delete</a></div>
285 <script type="text/html" id="del_link">
286 <a href="#" class="tag_delete_click">Delete</a>