Changeset 793 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
8 Nov 2006, 17:27:44 (18 years ago)
Author:
joachim
Message:

fixed application_edit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_custom/widget_image_render.pt

    r790 r793  
    11<tal:block define="mode options/mode;
    22  id here/getWidgetId;
     3  fields here/fields;
    34  current_filename options/current_filename;
    45  empty_file options/empty_file;
     
    89  content_url options/content_url;
    910  last_modified options/last_modified;
    10   image_tag options/image_tag;   
     11  image_width options/width;
     12  image_height options/height;
     13  image_tag options/image_tag;
    1114  ">
    1215  <img tal:condition="python: mode == 'view' and not empty_file"
    1316    tal:replace="structure image_tag" />
    1417
    15 
    16   <tal:block condition="python: 0 and mode == 'view' and not empty_file">
    17     <metal:block define-macro="file_view">
    18       <a target="_blank" tal:condition="mimetype"
    19         tal:attributes="href string:${content_url}?nocache=${last_modified}">
    20         <img tal:replace="structure python:here.getImgTag(mimetype.icon_path,
    21           title=mimetype.name())" /></a>
    22       <a class="strong"
    23         tal:attributes="href string:${content_url}?nocache=${last_modified}">
    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 
    3218  <tal:block condition="python: mode == 'edit'">
    3319
    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">
     20    <metal:block use-macro="here/widget_file_render/macros/file_size_max_view" />
    3821
    39         <p i18n:translate="">
    40           cpsschemas_size_max
    41           <tal:block i18n:name="size_max" content="str_sizeMax"/>
    42         </p>
     22    <metal:block define-macro="image_title_edit">
     23      <metal:block use-macro="here/widget_file_render/macros/file_title_edit">
     24      </metal:block>
     25    </metal:block>
     26
     27    <img tal:condition="python: not empty_file and not session_file"
     28      tal:replace="structure image_tag" />
     29
     30    <metal:block define-macro="image_edit">
     31      <tal:block define="allow_resize here/allow_resize|nothing">
     32      <metal:block use-macro="here/widget_file_render/macros/file_edit">
     33        <metal:block fill-slot="edit_file_action">
     34          <metal:block define-slot="edit_file_action" />
     35        </metal:block>
     36        <metal:block fill-slot="change_file">
     37          <input type="radio" class="noborder"  name="." value="change"
     38                 tal:attributes="name radio_name;
     39                                 id string:${radio_name}_change" />
     40          <label i18n:translate="cpsschemas_label_file_change"
     41                 tal:attributes="for string:${radio_name}_change">Change</label>
     42          <input type="file" name="." size="24"
     43                 tal:attributes="name name;
     44            onclick string:document.getElementById('${radio_name}_change').checked='checked'" />
     45          <tal:block condition="allow_resize">
     46            <label i18n:translate="cpsschemas_image_resize"
     47                   tal:attributes="for string:${radio_name}_change">resize</label>
     48            <select tal:attributes="name string:${name}_resize;
     49              onchange string:document.getElementById('${radio_name}_change').checked='checked';"
     50              tal:define="wid_size python:(here.display_width, here.display_height);
     51              sizes python:[s for s in here.getImgSizes() if not wid_size[0] or s['size'] < wid_size]">
     52              <option tal:repeat="op sizes"
     53                tal:attributes="value op/id;
     54                selected python: op['size'] and (op['size'][0]==image_width
     55                                               or op['size'][1]==image_height)"
     56                i18n:translate=""
     57                ><span tal:replace="op/id" /> <span tal:condition="op/size"
     58                  i18n:name="dim"
     59                  tal:replace="python:'(%sx%s)' % op['size']">
     60                  640x480</span></option>
     61            </select>
     62          </tal:block>
     63        </metal:block>
     64      </metal:block>
    4365      </tal:block>
    4466    </metal:block>
    4567
    46     <metal:block define-macro="file_title_edit">
    47       <p tal:define="name here/getHtmlWidgetId;
    48                      title_name string:${name}_filename;">
    49         <span i18n:translate="cpsschemas_label_filename">
    50           Filename
    51         </span>
    52         <input style="margin-left: 5px" type="text" size="30" maxlength="80"
    53                tal:attributes="name title_name;
    54                                value current_filename" />
    55       </p>
    56     </metal:block>
    57 
    58     <metal:block define-macro="file_edit">
    59 
    60       <ul class="fileChoice"
    61           tal:define="name here/getHtmlWidgetId;
    62                       radio_name string:${name}_choice;">
    63         <li>
    64           <metal:block define-slot="keep_file">
    65             <input type="radio" class="noborder" name="." value="keep"
    66                    checked="checked"
    67                    tal:attributes="name radio_name;
    68                                    id string:${radio_name}_keep;"/>
    69             <label i18n:translate="cpsschemas_label_file_none"
    70                    tal:condition="empty_file"
    71                    tal:attributes="for string:${radio_name}_keep">None</label>
    72             <label i18n:translate="cpsschemas_label_file_keep"
    73                    tal:condition="not:empty_file"
    74                    tal:attributes="for string:${radio_name}_keep">Keep</label>
    75             <a href="http://url..." target="_blank"
    76                tal:condition="not:empty_file"
    77                tal:omit-tag="session_file"
    78                tal:attributes="href string:${content_url}?nocache=${last_modified}">
    79               <tal:block condition="mimetype"
    80                 replace="structure python:here.getImgTag(mimetype.icon_path,
    81                   title=mimetype.name())" />
    82               <tal:block replace="current_filename" />
    83             </a>
    84             <tal:block condition="python:not empty_file and not session_file and modules['Products.CPSUtil.integration'].isProductPresent('Products.ExternalEditor')">
    85               <tal:block define="ds options/datastructure;
    86                                  dm ds/getDataModel;
    87                                  proxy dm/getProxy;
    88                                  display_ee
    89                                    here/display_external_editor|python:True;
    90                                  portal here/portal_url/getPortalObject;
    91                                  field_id python:here.fields[0]">
    92               <tal:block condition="python: proxy and display_ee">
    93                 -
    94                 <a href="http://url..."
    95                    i18n:translate="cpsschemas_label_file_edit_online"
    96                    tal:attributes="href python:portal.getExternalEditorPath(proxy, id, field_id)">
    97                   Edit file online
    98                 </a>
    99               </tal:block>
    100               </tal:block>
    101             </tal:block>
    102           </metal:block>
    103         </li>
    104         <metal:block define-slot="edit_file_action" />
    105         <li>
    106           <metal:block define-slot="change_file">
    107             <input type="radio" class="noborder"  name="." value="change"
    108                    tal:attributes="name radio_name;
    109                                    id string:${radio_name}_change" />
    110             <label i18n:translate="cpsschemas_label_file_change"
    111                    tal:attributes="for string:${radio_name}_change">Change</label>
    112             <input type="file" name="." size="24"
    113                    tal:attributes="name name;
    114               onclick string:document.getElementById('${radio_name}_change').checked='checked'" />
    115           </metal:block>
    116         </li>
    117         <li tal:condition="python: not here.is_required and not empty_file">
    118           <metal:block define-slot="delete_file">
    119             <input type="radio" class="noborder" name="." value="delete"
    120                    tal:attributes="name radio_name;
    121                                    id string:${radio_name}_delete" />
    122             <label i18n:translate="cpsschemas_label_file_delete"
    123                    tal:attributes="for string:${radio_name}_delete">Delete</label>
    124           </metal:block>
    125         </li>
    126       </ul>
    127     </metal:block>
    128 
    12968  </tal:block>
    130 
    13169</tal:block>
Note: See TracChangeset for help on using the changeset viewer.