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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xueyun Qian
erp5
Commits
d09f5528
Commit
d09f5528
authored
Oct 25, 2011
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add script to generate proper URL for image conversion which can be reused in other UI parts.
parent
f601ecc6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
4 deletions
+89
-4
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/Base_getImageArgumentDict.xml
...ins/erp5_web_widget_library/Base_getImageArgumentDict.xml
+84
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/Document_getSummaryAsHTML.xml
...ins/erp5_web_widget_library/Document_getSummaryAsHTML.xml
+4
-3
bt5/erp5_web/bt/revision
bt5/erp5_web/bt/revision
+1
-1
No files found.
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/Base_getImageArgumentDict.xml
0 → 100644
View file @
d09f5528
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
"""\n
A core method that will return default image conversion arguments as a dict.\n
"""\n
portal = context.getPortalObject()\n
portal_preferences = portal.portal_preferences\n
image_argument_dict = {\'format\': portal_preferences.getPreferredImageFormat(),\n
\'quality\': portal_preferences.getPreferredImageQuality()}\n
\n
pre_converted_only = portal_preferences.getPreferredPreConvertedOnly()\n
if pre_converted_only:\n
# only add if it\'s True as conversion machine assume that if it is missing\n
# then conversion should happen "on the fly"\n
image_argument_dict[\'pre_converted_only\'] = pre_converted_only\n
\n
if context.getPortalType() in (\'PDF\',):\n
# PDF support frames\n
image_argument_dict[\'frame\'] = 0\n
return image_argument_dict\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_getImageArgumentDict
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/Document_getSummaryAsHTML.xml
View file @
d09f5528
...
...
@@ -39,11 +39,12 @@
<tal:block \n
tal:define="document_url here/absolute_url;\n
thumbnail_url here/Base_getThumbnailAbsoluteUrl;\n
display string:thumbnail;\n
icon here/getIconURL;\n
title here/getTitle;\n
modification_date python: here.Base_FormatDate(here.getModificationDate(),hour_minute=1);\n
format python: here.getObject().portal_preferences.getPreference(\'preferred_image_format\', \'png\');\n
image_conversion_dict here/Base_getImageArgumentDict;\n
dummy python: image_conversion_dict.update(**{\'display\':\'thumbnail\'});\n
image_conversion_arguments python: \'&\'.join([\'%s=%s\' % (k, v) for k, v in image_conversion_dict.items()]);\n
description python: here.getDescription();\n
box_relative_url python: request.get(\'box_relative_url\', \'\');\n
dom_id python: modules[\'base64\'].urlsafe_b64encode(\'%s-%s\' %(box_relative_url, here.getUid())).rstrip(\'=\')">
\n
...
...
@@ -68,7 +69,7 @@
tal:attributes=
"href string:${document_url}/view"
>
\n
<img
alt=
"Thumbnail"
class=
"document-thumbnail"
\n
tal:condition=
"python: thumbnail_url is not None"
\n
tal:attributes=
"src string:${thumbnail_url}/index_html?
display=${display}&format=${format
}"
/>
\n
tal:attributes=
"src string:${thumbnail_url}/index_html?
${image_conversion_arguments
}"
/>
\n
<br/>
\n
<span
class=
"description"
\n
tal:content=
"description"
/>
\n
...
...
bt5/erp5_web/bt/revision
View file @
d09f5528
1066
\ No newline at end of file
1067
\ No newline at end of file
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