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
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
Vincent Bechu
erp5
Commits
622ad2e3
Commit
622ad2e3
authored
Jun 01, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use portal_preferences API when possible.
Use property sheets. Clean up citing a post.
parent
32a990ef
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
207 additions
and
10 deletions
+207
-10
bt5/erp5_discussion/PropertySheetTemplateItem/portal_property_sheets/ForumPreference.xml
...etTemplateItem/portal_property_sheets/ForumPreference.xml
+66
-0
bt5/erp5_discussion/PropertySheetTemplateItem/portal_property_sheets/ForumPreference/preferred_forum_quote_original_message_property.xml
...rence/preferred_forum_quote_original_message_property.xml
+61
-0
bt5/erp5_discussion/PropertySheetTemplateItem/portal_property_sheets/ForumPreference/preferred_forum_signature_property.xml
...ts/ForumPreference/preferred_forum_signature_property.xml
+61
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_redirectCreateNewDiscussionPost.xml
...sion/DiscussionThread_redirectCreateNewDiscussionPost.xml
+2
-3
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/ERP5Site_getUserPreferredForumSettingsDict.xml
...discussion/ERP5Site_getUserPreferredForumSettingsDict.xml
+14
-5
bt5/erp5_discussion/bt/revision
bt5/erp5_discussion/bt/revision
+1
-1
bt5/erp5_discussion/bt/template_property_sheet_id_list
bt5/erp5_discussion/bt/template_property_sheet_id_list
+2
-1
No files found.
bt5/erp5_discussion/PropertySheetTemplateItem/portal_property_sheets/ForumPreference.xml
0 → 100644
View file @
622ad2e3
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ForumPreference
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
bt5/erp5_discussion/PropertySheetTemplateItem/portal_property_sheets/ForumPreference/preferred_forum_quote_original_message_property.xml
0 → 100644
View file @
622ad2e3
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_local_properties
</string>
</key>
<value>
<tuple>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mode
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/boolean
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Should we cite when replying parent post.
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
preferred_forum_quote_original_message_property
</string>
</value>
</item>
<item>
<key>
<string>
mode
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
preference
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
property_default
</string>
</key>
<value>
<string>
python: False
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_discussion/PropertySheetTemplateItem/portal_property_sheets/ForumPreference/preferred_forum_signature_property.xml
0 → 100644
View file @
622ad2e3
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_local_properties
</string>
</key>
<value>
<tuple>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mode
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/string
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Forum signature
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
preferred_forum_signature_property
</string>
</value>
</item>
<item>
<key>
<string>
mode
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
preference
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
property_default
</string>
</key>
<value>
<string>
python: None
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_redirectCreateNewDiscussionPost.xml
View file @
622ad2e3
...
...
@@ -53,8 +53,7 @@
<value>
<string
encoding=
"cdata"
>
<![CDATA[
portal = context.getPortalObject()\n
user = str(portal.portal_membership.getAuthenticatedMember())\n
preferred_forum_quote_original_message= portal.ERP5Site_getUserPreferredForumSettingsDict(user)[\'preferred_forum_quote_original_message\']\n
preferred_forum_quote_original_message= portal.ERP5Site_getUserPreferredForumSettingsDict()[\'preferred_forum_quote_original_message\']\n
\n
if discussion_post_uid is not None:\n
# set title & text_content\n
...
...
@@ -63,7 +62,7 @@ if discussion_post_uid is not None:\n
context.REQUEST.set(\'discussion_post_title\', title)\n
if preferred_forum_quote_original_message:\n
author_dict = discussion_post.DiscussionPost_getAuthorDict()\n
text_content = \'<blockquote>
From: %s
<br/>
%s
</blockquote>
\' %(author_dict[\'author_title\'],\n
text_content = \'<blockquote
style="background-color: #E9E9E9;border: 1px solid #8CACBB;margin: 5px;padding: 10px 15px;"
>
From: %s
<br/>
%s
</blockquote>
\' %(author_dict[\'author_title\'],\n
discussion_post.getTextContent())\n
context.REQUEST.set(\'discussion_post_text_content\', text_content)\n
\n
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/ERP5Site_getUserPreferredForumSettingsDict.xml
View file @
622ad2e3
...
...
@@ -56,6 +56,7 @@
from Products.ERP5Type.Cache import CachingMethod\n
\n
portal = context.getPortalObject()\n
\n
def getPreferredForumSignature(username):\n
result = {\'preferred_forum_signature\': None,\n
\'preferred_forum_quote_original_message\': False}\n
...
...
@@ -64,19 +65,27 @@ def getPreferredForumSignature(username):\n
owner = username,\n
preference_state=\'enabled\')\n
if preference is not None:\n
result[\'preferred_forum_signature\'] = preference.getProperty(\'preferred_forum_signature\', None)\n
result[\'preferred_forum_quote_original_message\'] = preference.getProperty(\'preferred_forum_quote_original_message\', True)\n
result[\'preferred_forum_signature\'] = preference.getPreferredForumSignature()\n
result[\'preferred_forum_quote_original_message\'] = preference.getPreferredForumQuoteOriginalMessage()\n
\n
return result\n
\n
\n
getPreferredForumSignature = CachingMethod(getPreferredForumSignature,\n
("ERP5Site_getUserPreferredForumSettingsDict", username),\n
cache_factory=\'erp5_ui_short\')\n
return getPreferredForumSignature(username)\n
if username is None:\n
# assume current logged in user\n
result = {\'preferred_forum_signature\': portal.portal_preferences.getPreferredForumSignature(),\n
\'preferred_forum_quote_original_message\': portal.portal_preferences.getPreferredForumQuoteOriginalMessage()}\n
else:\n
result = getPreferredForumSignature(username)\n
\n
return result\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
username
</string>
</value>
<value>
<string>
username
=None
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
bt5/erp5_discussion/bt/revision
View file @
622ad2e3
109
\ No newline at end of file
110
\ No newline at end of file
bt5/erp5_discussion/bt/template_property_sheet_id_list
View file @
622ad2e3
DiscussionPost
ForumPreference
\ 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