Commit acabb973 authored by Ivan Tyagov's avatar Ivan Tyagov

Add possibility to highlight and cite previous posts.

CSS fixes and form improvements.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34938 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 963e0667
......@@ -53,8 +53,23 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.REQUEST.get(\'good_uid\')\n
</string> </value>
<value> <string encoding="cdata"><![CDATA[
if discussion_post_uid is not None:\n
# set title & text_content\n
discussion_post = getattr(context, discussion_post_uid)\n
author_dict = discussion_post.DiscussionPost_getAuthorDict()\n
title = \'Re: %s\' %discussion_post.getTitle()\n
text_content = \'<blockquote>From: %s<br/>%s</blockquote>\' %(author_dict[\'author_title\'],\n
discussion_post.getTextContent())\n
context.REQUEST.set(\'discussion_post_title\', text_content)\n
context.REQUEST.set(\'discussion_post_text_content\', text_content)\n
context.log(context.getRelativeUrl())\n
\n
return context.DiscussionThread_viewCreateNewDiscussionPostDialog()\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -64,7 +79,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>discussion_post_uid=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -84,15 +99,22 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>_getattr_</string>
<string>discussion_post_uid</string>
<string>None</string>
<string>getattr</string>
<string>context</string>
<string>discussion_post</string>
<string>_getattr_</string>
<string>author_dict</string>
<string>title</string>
<string>_getitem_</string>
<string>text_content</string>
</tuple>
</value>
</item>
......@@ -104,12 +126,14 @@
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DiscussionThread_getSelectedPost</string> </value>
<value> <string>DiscussionThread_redirectCreateNewDiscussionPost</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -13,11 +13,10 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>default</string>
<string>css_class</string>
<string>text_editor</string>
<string>default</string>
<string>editable</string>
<string>title</string>
</list>
</value>
</item>
......@@ -85,12 +84,6 @@
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>text_editor</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
......@@ -126,10 +119,6 @@
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>text_editor</string> </key>
<value> <string>fck_editor</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Body</string> </value>
......@@ -151,27 +140,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python: " >%s" % (context.portal_catalog.getObject(here.DiscussionThread_getSelectedPost()).text_content.replace("<br />", "<br /> \\>"))
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:(here.portal_preferences.getPreferredTextFormat() == \'text/html\' and here.portal_preferences.getPreferreTextEditor()) or \'text_area\'d</string> </value>
<value> <string>python: context.REQUEST.get(\'discussion_post_text_content\',\'\')</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -148,24 +148,28 @@
tal:content="author_signature"/>\n
<hr/>\n
</tal:block>\n
\n
<input type="hidden" \n
name="good_uid" \n
tal:attributes="value event_uid; id python: \'listbox_cb_%s\' % (event_uid)">\n
<button tal:condition="isUserAllowedToPost" \n
type="submit" \n
title="Reply" \n
name="DiscussionThread_viewCreateNewDiscussionPostDialog:method"\n
class="discussion-post-action-button"\n
tal:attributes="onClick python: \'getElementById(\\\'listbox_cb_%s\\\').checked = true\' % (event_object.getUid())">\n
Reply\n
tal:attributes="onClick python: \'redirectCreateCitedNewDiscussionPost(\\\'%s\\\')\' %event_id">\n
Cited Reply\n
</button>\n
<button tal:condition="isUserAllowedToPost" \n
type="submit" \n
title="Reply" \n
name="DiscussionThread_redirectCreateNewDiscussionPost:method"\n
class="discussion-post-action-button">\n
New Reply\n
</button>\n
\n
<tal:block tal:condition="python:real_context.portal_membership.checkPermission(\'Delete objects\', event_object)">\n
<button type="submit" \n
title="Delete" \n
name="DiscussionThread_deleteDiscussionPost:method"\n
class="discussion-post-action-button"\n
tal:attributes="onClick python: \'deleteDiscussionPost(\\\'%s\\\')\' %event.getId()">\n
tal:attributes="onClick python: \'deleteDiscussionPost(\\\'%s\\\')\' %event_id">\n
Delete\n
</button>\n
</tal:block>\n
......
......@@ -15,7 +15,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts72458028.86</string> </value>
<value> <string>ts72891835.3</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -89,7 +89,7 @@ a.discussion-post-creator-title-link{\n
}\n
\n
div.discussion-post-body-container{\n
/*float: left;*/\n
float: left;\n
margin-left: 10px;\n
margin-top: 10px;\n
margin-bottom: 10px;\n
......@@ -105,11 +105,18 @@ div.discussion-post-author-signature-container{\n
}\n
\n
button.discussion-post-action-button{\n
border: dashed 1px #3D6474; \n
background-color: #eee; \n
/*border: dashed 1px #3D6474; \n
background-color: #eee;\n
*/\n
padding: 3px;\n
}\n
</string> </value>
\n
blockquote {\n
background-color:#E9E9E9 ;\n
border:1px solid #8CACBB;\n
margin:5px;\n
padding:10px 15px;\n
}</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
......@@ -117,7 +124,7 @@ button.discussion-post-action-button{\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1333</int> </value>
<value> <int>1442</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -15,7 +15,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts69330662.3</string> </value>
<value> <string>ts72889188.39</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -35,7 +35,19 @@
\'name\': \'delete_discussion_post_id\', \n
\'type\':\'hidden\'}));\n
clickSaveButton(\'DiscussionThread_deleteDiscussionPost\');\n
}</string> </value>
}\n
\n
function redirectCreateCitedNewDiscussionPost(id){\n
/* this will add respective input box for reply post id (so multiple reply buttons can \n
safely coexist in one HTML page with one HTML form */\n
appendChildNodes(document.forms[0], \n
INPUT({\'value\':id, \n
\'name\': \'discussion_post_uid\', \n
\'type\':\'hidden\'}));\n
clickSaveButton(\'DiscussionThread_redirectCreateNewDiscussionPost\');\n
}\n
\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
......@@ -43,7 +55,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <long>435</long> </value>
<value> <int>893</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
48
\ No newline at end of file
50
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment