source: WAeUP_SRP/trunk/skins/waeup_custom/widget_image_render.pt @ 807

Last change on this file since 807 was 807, checked in by joachim, 18 years ago

results added

  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1<tal:block define="mode options/mode;
2  id here/getWidgetId;
3  fields here/fields;
4  current_filename options/current_filename;
5  empty_file options/empty_file;
6  session_file options/session_file;
7  mimetype options/mimetype;
8  size options/size;
9  content_url options/content_url;
10  last_modified options/last_modified;
11  image_width options/width;
12  image_height options/height;
13  image_tag options/image_tag;
14  ">
15  <img tal:condition="python: mode == 'view' and not empty_file"
16    tal:replace="structure image_tag" />
17
18  <tal:block condition="python: mode == 'edit'">
19
20    <metal:block use-macro="here/widget_file_render/macros/file_size_max_view" />
21
22    <metal:block define-macro="image_title_edit">
23    <span tal:condition="python:0">
24      <metal:block use-macro="here/widget_file_render/macros/file_title_edit">
25      </metal:block>
26    </span>
27    </metal:block>
28
29    <img tal:condition="python: 0 and not empty_file and not session_file"
30      tal:replace="structure image_tag" />
31
32    <metal:block define-macro="image_edit">
33      <tal:block define="allow_resize here/allow_resize|nothing">
34      <metal:block use-macro="here/widget_file_render/macros/file_edit">
35        <metal:block fill-slot="edit_file_action">
36          <metal:block define-slot="edit_file_action" />
37        </metal:block>
38        <metal:block fill-slot="change_file">
39          <input type="radio" class="noborder"  name="." value="change"
40                 tal:attributes="name radio_name;
41                                 id string:${radio_name}_change" />
42          <label i18n:translate="cpsschemas_label_file_change"
43                 tal:attributes="for string:${radio_name}_change">Change</label>
44          <input type="file" name="." size="24"
45                 tal:attributes="name name;
46            onclick string:document.getElementById('${radio_name}_change').checked='checked'" />
47          <tal:block condition="allow_resize">
48            <label i18n:translate="cpsschemas_image_resize"
49                   tal:attributes="for string:${radio_name}_change">resize</label>
50            <select tal:attributes="name string:${name}_resize;
51              onchange string:document.getElementById('${radio_name}_change').checked='checked';"
52              tal:define="wid_size python:(here.display_width, here.display_height);
53              sizes python:[s for s in here.getImgSizes() if not wid_size[0] or s['size'] < wid_size]">
54              <option tal:repeat="op sizes"
55                tal:attributes="value op/id;
56                selected python: op['size'] and (op['size'][0]==image_width
57                                               or op['size'][1]==image_height)"
58                i18n:translate=""
59                ><span tal:replace="op/id" /> <span tal:condition="op/size"
60                  i18n:name="dim"
61                  tal:replace="python:'(%sx%s)' % op['size']">
62                  640x480</span></option>
63            </select>
64          </tal:block>
65        </metal:block>
66      </metal:block>
67      </tal:block>
68    </metal:block>
69
70  </tal:block>
71</tal:block>
Note: See TracBrowser for help on using the repository browser.