Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
e975c723
Commit
e975c723
authored
Feb 07, 2012
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept url for Slide image
This changes permit use URL instead local images all the time.
parent
63202dd8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
155 additions
and
42 deletions
+155
-42
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPageModule_createChapter.xml
...al_skins/erp5_run_my_doc/TestPageModule_createChapter.xml
+14
-6
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPageModule_finishCreation.xml
...l_skins/erp5_run_my_doc/TestPageModule_finishCreation.xml
+16
-30
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPageModule_viewChapterCreationWizard.xml
...5_run_my_doc/TestPageModule_viewChapterCreationWizard.xml
+1
-0
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPageModule_viewChapterCreationWizard/your_image_url.xml
...stPageModule_viewChapterCreationWizard/your_image_url.xml
+110
-0
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_uploadImage.xml
...tem/portal_skins/erp5_run_my_doc/TestPage_uploadImage.xml
+13
-5
bt5/erp5_run_my_doc/bt/revision
bt5/erp5_run_my_doc/bt/revision
+1
-1
No files found.
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPageModule_createChapter.xml
View file @
e975c723
...
...
@@ -69,16 +69,23 @@ else:\n
listbox = []\n
int_index = 1\n
\n
if slide_type == \'Screenshot\':\n
tested = True\n
image_id = \'\'\n
\n
if slide_type in [\'Illustration\',\'Screenshot\']:\n
test_page_path = session[\'test_page_path\']\n
test_page = context.restrictedTraverse(test_page_path)\n
\n
if slide_type == \'Illustration\':\n
if image_url != "":\n
image_id = image_url\n
else:\n
image_id = test_page.TestPage_getNextImageID(chapter_title, slide_type)\n
image = test_page.TestPage_uploadImage(image_id, file, batch_mode = True)\n
\n
if slide_type == \'Screenshot\':\n
tested = True\n
image_id = test_page.TestPage_getNextImageID(chapter_title, slide_type)\n
image = test_page.TestPage_uploadImage(image_id, file, batch_mode = True)\n
else:\n
image_id = \'\'\n
\n
listbox.append(newTempBase(context.getPortalObject(),\n
\'\',\n
...
...
@@ -94,14 +101,15 @@ listbox.append(newTempBase(context.getPortalObject(),\n
))\n
\n
session[\'listbox\'] = listbox\n
return context.Base_redirect(\'TestPageModule_viewChapterCreationWizard\', keep_items = dict(portal_status_message=portal_status_message))\n
return context.Base_redirect(\'TestPageModule_viewChapterCreationWizard\', \n
keep_items = dict(portal_status_message=portal_status_message))\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
chapter_title, slide_type, file, text_content, slide_content, tested, **kw
</string>
</value>
<value>
<string>
chapter_title, slide_type,
image_url,
file, text_content, slide_content, tested, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPageModule_finishCreation.xml
View file @
e975c723
...
...
@@ -57,9 +57,9 @@
"""\n
\n
from Products.ERP5Type.Document import newTempBase\n
\n
# Add the last chapter to the listbox\n
context.TestPageModule_createChapter(chapter_title, slide_type, file, text_content, slide_content, tested, **kw)\n
context.TestPageModule_createChapter(chapter_title, slide_type, image_url, \n
file, text_content, slide_content, tested, **kw)\n
\n
translateString = context.Base_translateString\n
portal_status_message = ""\n
...
...
@@ -72,17 +72,7 @@ author = session[\'author\']\n
author_mail = session[\'author_mail\']\n
\n
# Headers and first chapter/slide\n
text_content = """<!DOCTYPE html>
\n
<html>
\n
<head>
\n
<base
href=
""
/>
\n
<meta
http-equiv=
"content-type"
content=
"text/html; charset=UTF-8"
>
\n
<link
href=
"http://fonts.googleapis.com/css?family=Oswald"
rel=
"stylesheet"
>
\n
<meta
charset=
"utf-8"
>
\n
<title>
""" + title + """
</title>
\n
</head>
\n
<body>
\n
<section
class=
"master"
>
\n
text_content = """<section class="master">
\n
<h1>
""" + title + """
</h1>
\n
""" + listbox[0].slide_content\n
\n
...
...
@@ -128,20 +118,19 @@ for chapter in listbox[1:]:\n
\n
# let\'s add a template test to this chapter\n
if chapter.tested:\n
text_content += """\n
<test>
\n
<table
class=
"test"
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
style=
"display:none;"
>
"""\n
text_content +="""\n
<test>
"""\n
if first:\n
text_content += """\n
<thead>
\n
<tr><th
rowspan=
"1"
colspan=
"3"
>
""" + session[\'title\'] + """
</th></tr>
\n
</thead>
"""\n
text_content +="""\n
<span
metal:use-macro=
"container/ERP5RunMyDocs_initTest/macros/init_test_environment"
style=
"display:none;"
>
init
</span>
"""\n
first = False\n
\n
text_content +="""\n
<table
class=
"test"
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
style=
"display:none;"
>
\n
<tbody>
"""\n
\n
\n
text_content += """\n
<tbody>
\n
<tr>
\n
<td
colspan=
3
>
<
span metal:use-macro="container/ERP5RunMyDocs_initTest/macros/init_test_environment" style="display:none;"
>
init
<
/span
>
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
selectAndWait
</td>
\n
\t
<td>
name=select_module
</td>
\n
...
...
@@ -167,20 +156,17 @@ for chapter in listbox[1:]:\n
</section>
\n
"""\n
\n
text_content +="""\n
</body>
\n
</html>
"""\n
\n
test_page.setTextContent(text_content)\n
\n
return test_page.Base_redirect(\'view\', keep_items = dict(portal_status_message=portal_status_message))\n
return test_page.Base_redirect(\'view\', \n
keep_items = dict(portal_status_message=portal_status_message))\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
chapter_title, slide_type, file, text_content, slide_content, tested, **kw
</string>
</value>
<value>
<string>
chapter_title, slide_type,
image_url,
file, text_content, slide_content, tested, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPageModule_viewChapterCreationWizard.xml
View file @
e975c723
...
...
@@ -87,6 +87,7 @@
<string>
your_title
</string>
<string>
your_chapter_title
</string>
<string>
your_slide_type
</string>
<string>
your_image_url
</string>
<string>
your_file
</string>
<string>
your_slide_content
</string>
<string>
your_text_content
</string>
...
...
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPageModule_viewChapterCreationWizard/your_image_url.xml
0 → 100644
View file @
e975c723
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
description
</string>
<string>
display_width
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_image_url
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
The URL to the image, you can use relative urls or image reference.
</string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<int>
90
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_title
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Image URL
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_uploadImage.xml
View file @
e975c723
...
...
@@ -54,7 +54,13 @@
Create an image object and upload the image if necessary\n
"""\n
\n
translateString = context.Base_translateString\n
\n
msg = \'Slide created.\'\n
\n
if edit_mode == 1:\n
msg = \'Slide updated.\'\n
\n
def createImage(image_id):\n
return context.newContent(portal_type = \'Embedded File\',\n
title = image_id,\n
...
...
@@ -80,16 +86,18 @@ if slide_type in [\'Screenshot\', \'Illustration\']:\n
msg += \' Image \' + image_id + \' created.\'\n
\n
if not(file is None or not file):\n
image.edit(file=file, data=file.read(), filename=file.filename)\n
image.edit(file=file, \n
data=file.read(), \n
filename=file.filename)\n
\n
msg += \' Image uploaded.\'\n
\n
if batch_mode:\n
return image\n
\n
translateString = context.Base_translateString\n
portal_status_message = translateString(msg)\n
context.Base_redirect(\'TestPage_viewSlideCreator\', \n
keep_items = dict(portal_status_message=portal_status_message))\n
form_id = context.REQUEST.get(\'dialog_id\', None)\n
context.Base_redirect(form_id,\n
keep_items = dict(portal_status_message=translateString(msg)))\n
</string>
</value>
</item>
<item>
...
...
bt5/erp5_run_my_doc/bt/revision
View file @
e975c723
35
\ No newline at end of file
36
\ 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