source: WAeUP_SRP/trunk/skins/waeup_upload/widget_uploadfile_render.pt @ 17397

Last change on this file since 17397 was 3283, checked in by joachim, 17 years ago
  1. show --- as default, and dont edit when set
  2. show full filename
  3. check if upload-object exists, display error message, at the moment the
  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
1<tal:block define="mode options/mode;
2  id here/getWidgetId;
3  current_filename options/current_filename;
4  empty_file options/empty_file;
5  session_file options/session_file|nothing;
6  mimetype options/mimetype;
7  size options/size;
8  content_url options/content_url;
9  last_modified options/last_modified;
10  content_url_nocache string:${content_url}?nocache=${last_modified};
11  ">
12
13  <tal:block condition="python: mode == 'view' and not empty_file">
14    <metal:block define-macro="file_view">
15      <a tal:condition="mimetype"
16        tal:attributes="
17        href content_url_nocache;
18        onClick string:return openLinkInPopup('${content_url_nocache}');
19        ">
20        <img tal:replace="structure python:here.getImgTag(mimetype.icon_path,
21          title=mimetype.name())" /></a>
22      <a class="strong"
23        tal:attributes="href content_url_nocache">
24        <tal:block replace="current_filename" /></a>
25      <span tal:condition="size" class="note"
26        tal:define="str_size python:here.getHumanReadableSize(size);">
27        <tal:block content="str_size"/>
28      </span>
29    </metal:block>
30  </tal:block>
31
32  <tal:block condition="python: mode == 'edit'">
33
34    <metal:block define-macro="file_size_max_view">
35      <tal:block define="size_max python:here.size_max;
36                         str_sizeMax python:here.getHumanReadableSize(size_max)"
37        condition="python:size_max > 0">
38
39        <p i18n:translate="">
40          cpsschemas_size_max
41          <tal:block i18n:name="size_max" content="str_sizeMax"/>
42        </p>
43      </tal:block>
44    </metal:block>
45
46    <metal:block define-macro="file_edit">
47
48      <ul class="fileChoice"
49          tal:define="name here/getHtmlWidgetId;
50                      radio_name string:${name}_choice;"
51                      >
52      <li>
53        <metal:block define-slot="keep_file" tal:condition="nothing">
54          <input type="radio" class="noborder" name="." value="keep"
55                 checked="checked"
56                 tal:attributes="name radio_name;
57                 id string:${radio_name}_keep;"
58                 />
59          <label i18n:translate="cpsschemas_label_file_none"
60                 tal:condition="empty_file"
61                 tal:attributes="for string:${radio_name}_keep">None</label>
62          <label i18n:translate="cpsschemas_label_file_keep"
63                 tal:condition="not:empty_file"
64                 tal:attributes="for string:${radio_name}_keep">Keep</label>
65        </metal:block>
66      </li>
67      <metal:block define-slot="edit_file_action" />
68      <li>
69        <metal:block define-slot="change_file">
70          <input type="hidden" class="noborder"  name="." value="change"
71                 tal:attributes="name radio_name;
72                 id string:${radio_name}_change"
73                 />
74          <input type="file" name="." size="24"
75                 tal:attributes="name name;
76                 onclick string:document.getElementById('${radio_name}_change').checked='checked'"
77                 />
78        </metal:block>
79      </li>
80      </ul>
81    </metal:block>
82
83    <metal:block define-macro="file_title_edit" tal:condition="nothing">
84      <p tal:define="name here/getHtmlWidgetId;
85                     title_name string:${name}_filename;">
86        <span i18n:translate="cpsschemas_label_filename">
87          Filename
88        </span>
89        <input style="margin-left: 5px" type="text" size="30" maxlength="80"
90               tal:attributes="name title_name;
91                               value current_filename" />
92      </p>
93    </metal:block>
94
95  </tal:block>
96
97</tal:block>
Note: See TracBrowser for help on using the repository browser.