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
1
Issues
1
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roque
erp5
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
...
@@ -69,16 +69,23 @@ else:\n
listbox = []\n
listbox = []\n
int_index = 1\n
int_index = 1\n
\n
\n
if slide_type == \'Screenshot\':\n
image_id = \'\'\n
tested = True\n
\n
\n
if slide_type in [\'Illustration\',\'Screenshot\']:\n
if slide_type in [\'Illustration\',\'Screenshot\']:\n
test_page_path = session[\'test_page_path\']\n
test_page_path = session[\'test_page_path\']\n
test_page = context.restrictedTraverse(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_id = test_page.TestPage_getNextImageID(chapter_title, slide_type)\n
image = test_page.TestPage_uploadImage(image_id, file, batch_mode = True)\n
image = test_page.TestPage_uploadImage(image_id, file, batch_mode = True)\n
else:\n
image_id = \'\'\n
\n
\n
listbox.append(newTempBase(context.getPortalObject(),\n
listbox.append(newTempBase(context.getPortalObject(),\n
\'\',\n
\'\',\n
...
@@ -94,14 +101,15 @@ listbox.append(newTempBase(context.getPortalObject(),\n
...
@@ -94,14 +101,15 @@ listbox.append(newTempBase(context.getPortalObject(),\n
))\n
))\n
\n
\n
session[\'listbox\'] = listbox\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>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<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>
<item>
<item>
<key>
<string>
id
</string>
</key>
<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 @@
...
@@ -57,9 +57,9 @@
"""\n
"""\n
\n
\n
from Products.ERP5Type.Document import newTempBase\n
from Products.ERP5Type.Document import newTempBase\n
\n
# Add the last chapter to the listbox\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
\n
translateString = context.Base_translateString\n
translateString = context.Base_translateString\n
portal_status_message = ""\n
portal_status_message = ""\n
...
@@ -72,17 +72,7 @@ author = session[\'author\']\n
...
@@ -72,17 +72,7 @@ author = session[\'author\']\n
author_mail = session[\'author_mail\']\n
author_mail = session[\'author_mail\']\n
\n
\n
# Headers and first chapter/slide\n
# Headers and first chapter/slide\n
text_content = """<!DOCTYPE html>
\n
text_content = """<section class="master">
\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
<h1>
""" + title + """
</h1>
\n
<h1>
""" + title + """
</h1>
\n
""" + listbox[0].slide_content\n
""" + listbox[0].slide_content\n
\n
\n
...
@@ -128,20 +118,19 @@ for chapter in listbox[1:]:\n
...
@@ -128,20 +118,19 @@ for chapter in listbox[1:]:\n
\n
\n
# let\'s add a template test to this chapter\n
# let\'s add a template test to this chapter\n
if chapter.tested:\n
if chapter.tested:\n
text_content += """\n
text_content +="""\n
<test>
\n
<test>
"""\n
<table
class=
"test"
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
style=
"display:none;"
>
"""\n
if first:\n
if first:\n
text_content += """\n
text_content +="""\n
<thead>
\n
<span
metal:use-macro=
"container/ERP5RunMyDocs_initTest/macros/init_test_environment"
style=
"display:none;"
>
init
</span>
"""\n
<tr><th
rowspan=
"1"
colspan=
"3"
>
""" + session[\'title\'] + """
</th></tr>
\n
</thead>
"""\n
first = False\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
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
<tr>
\n
\t
<td>
selectAndWait
</td>
\n
\t
<td>
selectAndWait
</td>
\n
\t
<td>
name=select_module
</td>
\n
\t
<td>
name=select_module
</td>
\n
...
@@ -167,20 +156,17 @@ for chapter in listbox[1:]:\n
...
@@ -167,20 +156,17 @@ for chapter in listbox[1:]:\n
</section>
\n
</section>
\n
"""\n
"""\n
\n
\n
text_content +="""\n
</body>
\n
</html>
"""\n
\n
test_page.setTextContent(text_content)\n
test_page.setTextContent(text_content)\n
\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>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<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>
<item>
<item>
<key>
<string>
id
</string>
</key>
<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 @@
...
@@ -87,6 +87,7 @@
<string>
your_title
</string>
<string>
your_title
</string>
<string>
your_chapter_title
</string>
<string>
your_chapter_title
</string>
<string>
your_slide_type
</string>
<string>
your_slide_type
</string>
<string>
your_image_url
</string>
<string>
your_file
</string>
<string>
your_file
</string>
<string>
your_slide_content
</string>
<string>
your_slide_content
</string>
<string>
your_text_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 @@
...
@@ -54,7 +54,13 @@
Create an image object and upload the image if necessary\n
Create an image object and upload the image if necessary\n
"""\n
"""\n
\n
\n
translateString = context.Base_translateString\n
\n
msg = \'Slide created.\'\n
msg = \'Slide created.\'\n
\n
if edit_mode == 1:\n
msg = \'Slide updated.\'\n
\n
def createImage(image_id):\n
def createImage(image_id):\n
return context.newContent(portal_type = \'Embedded File\',\n
return context.newContent(portal_type = \'Embedded File\',\n
title = image_id,\n
title = image_id,\n
...
@@ -80,16 +86,18 @@ if slide_type in [\'Screenshot\', \'Illustration\']:\n
...
@@ -80,16 +86,18 @@ if slide_type in [\'Screenshot\', \'Illustration\']:\n
msg += \' Image \' + image_id + \' created.\'\n
msg += \' Image \' + image_id + \' created.\'\n
\n
\n
if not(file is None or not file):\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
msg += \' Image uploaded.\'\n
\n
\n
if batch_mode:\n
if batch_mode:\n
return image\n
return image\n
\n
\n
translateString = context.Base_translateString\n
form_id = context.REQUEST.get(\'dialog_id\', None)\n
portal_status_message = translateString(msg)\n
context.Base_redirect(form_id,\n
context.Base_redirect(\'TestPage_viewSlideCreator\', \n
keep_items = dict(portal_status_message=translateString(msg)))\n
keep_items = dict(portal_status_message=portal_status_message))\n
</string>
</value>
</string>
</value>
</item>
</item>
<item>
<item>
...
...
bt5/erp5_run_my_doc/bt/revision
View file @
e975c723
35
36
\ No newline at end of file
\ 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