Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
0b1ab658
Commit
0b1ab658
authored
Aug 17, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
odt_style: use ImageField.render_odt
instead of having the logic repeated in the page template
parent
592fadbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
44 deletions
+6
-44
bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_style/form_view.oot
...kinTemplateItem/portal_skins/erp5_odt_style/form_view.oot
+6
-44
No files found.
bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_style/form_view.oot
View file @
0b1ab658
...
...
@@ -139,27 +139,12 @@
<table:table-cell table:style-name='field-table.B1'
office:value-type='string'
tal:define="value python: field.get_value('default')">
<tal:block tal:condition="python: field_type not in ('
ImageField','OOoChart'
)">
<tal:block tal:condition="python: field_type not in ('
OOoChart',
)">
<text:p tal:replace="structure python:field.render_odt(REQUEST=request, attr_dict={'{urn:oasis:names:tc:opendocument:xmlns:text:1.0}style-name': 'field-content'})"
/>
</tal:block>
<!-- TODO: render_odt for image field! -->
<!-- With this max_size, pictures and graph stay in a table cell-->
<tal:block tal:define="global max_size python:9;"/>
<tal:block tal:condition="python: field_type == 'ImageField'">
<text:p text:style-name='field-content'
tal:define="preferred_width python: preference_tool.getPreference('preferred_%s_image_width' % (field.get_value('image_display')), 100);
width python:(preferred_width / 20.) < max_size and (preferred_width / 20.) or max_size;
field_value python: field.get_value('default')">
<tal:block tal:condition="field_value">
<office:include_img tal:attributes="width width;
path python: '/'.join(request.physicalPathFromURL(field_value));"
style="inline-graphic"/>
</tal:block>
</text:p>
</tal:block>
<!-- TODO: render_odt for OOoChart
!
-->
<!-- TODO: render_odt for OOoChart
? (or drop support ?)
-->
<tal:block tal:condition="python: field_type == 'OOoChart'">
<tal:block tal:define="display python: field.get_value('image_display');
preferred_method_height_id python: 'getPreferred%sImageHeight' % (display.capitalize());
...
...
@@ -197,27 +182,13 @@
<tal:block tal:define="field_list python: form.get_fields_in_group('center')">
<tal:block tal:repeat="field field_list">
<tal:block tal:define="field_type python: field.meta_type == 'ProxyField' and field.getRecursiveTemplateField().meta_type or field.meta_type">
<tal:block tal:condition="python: field_type not in ('
ImageField','OOoChart'
)">
<tal:block tal:condition="python: field_type not in ('
OOoChart',
)">
<text:p tal:replace="structure python:render_text(here.Base_translateString(field.get_value('title')),
{'{urn:oasis:names:tc:opendocument:xmlns:text:1.0}style-name': 'field-label-center'})"/>
<text:p tal:replace="structure python:field.render_odt(REQUEST=request, attr_dict={'{urn:oasis:names:tc:opendocument:xmlns:text:1.0}style-name': 'field-content-center'})"/>
</tal:block>
<!-- TODO: render_odt for ImageField ! -->
<tal:block tal:condition="python: field_type == 'ImageField'">
<text:p text:style-name='field-label-center' i18n:domain="ui"
i18n:translate=""
tal:content="python: field.get_value('title')"/>
<text:p text:style-name='field-content-center'
tal:define="preferred_width python: preference_tool.getPreference('preferred_%s_image_width' % (field.get_value('image_display')));">
<office:include_img style="inline-graphic"
tal:attributes="width python: (preferred_width or 100) / 20.;
path python: '/'.join(request.physicalPathFromURL(field.get_value('default')));"/>
</text:p>
</tal:block>
<!-- TODO: render_odt for OOoChart ! -->
<!-- TODO: render_odt for OOoChart ? or drop support ? -->
<tal:block tal:condition="python: field_type == 'OOoChart'">
<text:p text:style-name='field-label-center' i18n:domain="ui" i18n:translate=""
tal:content="python: field.get_value('title')"/>
...
...
@@ -263,7 +234,7 @@
<div metal:use-macro="here/listbox_odt_macro/macros/listbox" />
</tal:block>
</tal:block>
<tal:block tal:condition="python: field_type not in ('
ImageField', 'OOoChart'
)">
<tal:block tal:condition="python: field_type not in ('
OOoChart',
)">
<tal:block tal:define="item_list python:field.has_value('items') and field.get_value('items') or None;
value python: field.get_value('default')">
<tal:block tal:condition="python: same_type(value,[]) or same_type(value,())">
...
...
@@ -294,17 +265,8 @@
</tal:block>
</tal:block>
</tal:block>
<!-- TODO: render_odt support for ImageField -->
<tal:block tal:condition="python: field_type == 'ImageField'">
<text:p text:style-name='field-content-center'
tal:define="preferred_width python: preference_tool.getPreference('preferred_%s_image_width' % (field.get_value('image_display')))">
<office:include_img style="inline-graphic"
tal:attributes="width python: preferred_width or (100 / 20.);
path python: '/'.join(request.physicalPathFromURL(field.get_value('default')));"/>
</text:p>
</tal:block>
<!-- TODO: render_odt support for OOoChart -->
<!-- TODO: render_odt support for OOoChart ? or drop support ? -->
<tal:block tal:condition="python: field_type == 'OOoChart'">
<tal:block tal:define="display python: field.get_value('image_display') "
tal:condition="display">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment