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
1
Merge Requests
1
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
Boxiang Sun
erp5
Commits
51f47079
Commit
51f47079
authored
Jan 09, 2018
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_post: Use object's value instead object's url
Please see
2b374847
parent
2b374847
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPost.py
...eItem/portal_skins/erp5_post/PostModule_createHTMLPost.py
+4
-5
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPost.xml
...Item/portal_skins/erp5_post/PostModule_createHTMLPost.xml
+1
-1
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPostFromText.py
...rtal_skins/erp5_post/PostModule_createHTMLPostFromText.py
+1
-1
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPostFromText.xml
...tal_skins/erp5_post/PostModule_createHTMLPostFromText.xml
+1
-1
No files found.
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPost.py
View file @
51f47079
...
@@ -3,20 +3,19 @@ portal = context.getPortalObject()
...
@@ -3,20 +3,19 @@ portal = context.getPortalObject()
# create an HTML Post
# create an HTML Post
post_module
=
portal
.
post_module
post_module
=
portal
.
post_module
# get the related object
follow_up_object
,
=
portal
.
portal_catalog
(
relative_url
=
follow_up
,
limit
=
2
)
follow_up_object
=
follow_up_object
.
getObject
()
now
=
DateTime
()
now
=
DateTime
()
post_edit_kw
=
{
post_edit_kw
=
{
"start_date"
:
now
,
"start_date"
:
now
,
"follow_up_value"
:
follow_up_
object
,
"follow_up_value"
:
follow_up_
value
,
"text_content"
:
data
,
"text_content"
:
data
,
}
}
if
predecessor
is
not
None
:
if
predecessor
is
not
None
:
predecessor_value
,
=
portal
.
portal_catalog
(
relative_url
=
predecessor
,
limit
=
2
)
predecessor_value
,
=
portal
.
portal_catalog
(
relative_url
=
predecessor
,
limit
=
2
)
post_edit_kw
[
"predecessor_value"
]
=
predecessor_value
.
getObject
()
post_edit_kw
[
"predecessor_value"
]
=
predecessor_value
.
getObject
()
post
=
post_module
.
newContent
(
post
=
post_module
.
newContent
(
reindex_on_commit
=
True
,
# XXX in support request web app interface, discussable page reloads right after
# adding a post, searching for new post hoping it is already indexed.
portal_type
=
'HTML Post'
,
portal_type
=
'HTML Post'
,
**
post_edit_kw
**
post_edit_kw
)
)
...
...
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPost.xml
View file @
51f47079
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
follow_up, data, predecessor=None
</string>
</value>
<value>
<string>
follow_up
_value
, data, predecessor=None
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPostFromText.py
View file @
51f47079
return
context
.
PostModule_createHTMLPost
(
return
context
.
PostModule_createHTMLPost
(
follow_up
=
follow_up
,
follow_up
_value
=
follow_up_value
,
predecessor
=
predecessor
,
predecessor
=
predecessor
,
data
=
"<p>"
+
data
.
replace
(
"&"
,
"&"
).
replace
(
"<"
,
"<"
).
replace
(
">"
,
">"
).
replace
(
" "
,
" "
).
replace
(
"
\
n
"
,
"<br/>"
)
+
"</p>"
,
data
=
"<p>"
+
data
.
replace
(
"&"
,
"&"
).
replace
(
"<"
,
"<"
).
replace
(
">"
,
">"
).
replace
(
" "
,
" "
).
replace
(
"
\
n
"
,
"<br/>"
)
+
"</p>"
,
)
)
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPostFromText.xml
View file @
51f47079
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
follow_up, data, predecessor=None
</string>
</value>
<value>
<string>
follow_up
_value
, data, predecessor=None
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
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