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
Kasra Jamshidi
erp5
Commits
0ce1e644
Commit
0ce1e644
authored
May 31, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use permanent URL.
Set same categories as predicate on web section.
parent
fb86cd76
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_viewLastPostWidget.xml
...s/erp5_discussion/DiscussionThread_viewLastPostWidget.xml
+2
-2
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml
.../erp5_discussion/WebSection_createNewDiscussionThread.xml
+14
-2
bt5/erp5_discussion/bt/revision
bt5/erp5_discussion/bt/revision
+1
-1
No files found.
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_viewLastPostWidget.xml
View file @
0ce1e644
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
tal:condition=
"not:is_author_link_available"
/>
\n
tal:condition=
"not:is_author_link_available"
/>
\n
\n
\n
<a
class=
"listbox-row-discussion-thread-last-post-link"
\n
<a
class=
"listbox-row-discussion-thread-last-post-link"
\n
tal:attributes=
"href python: \'%s/view?list_start=%s&reset=1#%s\' %(here.
absolute_url(), last_post.getId(), last_post.getUid())"
>
\n
tal:attributes=
"href python: \'%s/view?list_start=%s&reset=1#%s\' %(here.
getReference(), last_post.getId(), last_post.getUid())"
>
\n
<img
src=
"document_icon.gif"
alt=
"Link To Post"
/>
\n
<img
src=
"document_icon.gif"
alt=
"Link To Post"
/>
\n
</a>
\n
</a>
\n
\n
\n
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
<value>
<string>
iso-8859-15
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml
View file @
0ce1e644
...
@@ -70,9 +70,14 @@ if site_list in MARKER:\n
...
@@ -70,9 +70,14 @@ if site_list in MARKER:\n
membership_criterion_category_list = context.getMembershipCriterionCategoryList()\n
membership_criterion_category_list = context.getMembershipCriterionCategoryList()\n
multimembership_criterion_base_category_list = context.getMultimembershipCriterionBaseCategoryList()\n
multimembership_criterion_base_category_list = context.getMultimembershipCriterionBaseCategoryList()\n
\n
\n
# XXX: what if reference duplicates : add some random part ?\n
reference = title.replace(\' \', \'-\')\n
reference = title.replace(\' \', \'-\')\n
exisiting_document = context.getDocumentValue(reference)\n
if exisiting_document is not None:\n
# if there are other document which reference duplicates just add some random part\n
# so we can distinguish)\n
reference = \'%s-%s\' %(context.Base_generateRandomString(), reference)\n
\n
\n
category_list = []\n
create_kw = dict(title = title,\n
create_kw = dict(title = title,\n
source_value = person,\n
source_value = person,\n
reference = reference,\n
reference = reference,\n
...
@@ -83,12 +88,19 @@ create_kw = dict(title = title,\n
...
@@ -83,12 +88,19 @@ create_kw = dict(title = title,\n
classification=classification,\n
classification=classification,\n
group_list=group_list,\n
group_list=group_list,\n
site_list=site_list)\n
site_list=site_list)\n
\n
for base_category in multimembership_criterion_base_category_list:\n
for base_category in multimembership_criterion_base_category_list:\n
create_kw[\'%s_list\' %base_category] = [x for x in membership_criterion_category_list if x.startswith(base_category)]\n
#create_kw[\'%s_list\' %base_category] = [x for x in membership_criterion_category_list if x.startswith(base_category)]\n
category_list.extend([x for x in membership_criterion_category_list if x.startswith(base_category)])\n
\n
\n
discussion_thread = portal.discussion_thread_module.newContent(\n
discussion_thread = portal.discussion_thread_module.newContent(\n
portal_type = "Discussion Thread",\n
portal_type = "Discussion Thread",\n
**create_kw)\n
**create_kw)\n
# as we create a thread under a "root" predicate web section copy\n
# all categories from it to create thread, this way thread will be part\n
# of web section (through getDocumentValue API)\n
discussion_thread.setCategoryList(category_list)\n
\n
discussion_post = discussion_thread.newContent(\n
discussion_post = discussion_thread.newContent(\n
portal_type = "Discussion Post",\n
portal_type = "Discussion Post",\n
title = title,\n
title = title,\n
...
...
bt5/erp5_discussion/bt/revision
View file @
0ce1e644
108
109
\ 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