From fdb0e110cdb3e3d5eaa3ce6a8ad293b6ca20bc3f Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Fri, 5 Oct 2012 14:28:09 +0200 Subject: [PATCH] Generated description in RSS items. Fix selection. Use nice URLs to access from RSS Discussion Post. --- .../listbox.xml | 65 ++++++++++++++++-- .../listbox_link.xml | 6 +- .../DiscussionPost_getDescription.xml | 67 ------------------- bt5/erp5_discussion/bt/revision | 2 +- 4 files changed, 67 insertions(+), 73 deletions(-) delete mode 100644 bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionPost_getDescription.xml diff --git a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscusionThread_viewContentListAsRSS/listbox.xml b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscusionThread_viewContentListAsRSS/listbox.xml index d4a93be10c..dcab9ca09d 100644 --- a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscusionThread_viewContentListAsRSS/listbox.xml +++ b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscusionThread_viewContentListAsRSS/listbox.xml @@ -13,8 +13,10 @@ <string>columns</string> <string>count_method</string> <string>hide_rows_on_no_search_criterion</string> + <string>lines</string> <string>list_method</string> <string>portal_types</string> + <string>selection_name</string> <string>sort</string> </list> </value> @@ -57,6 +59,14 @@ <key> <string>tales</string> </key> <value> <dictionary> + <item> + <key> <string>columns</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>count_method</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> @@ -65,6 +75,32 @@ <key> <string>form_id</string> </key> <value> <string></string> </value> </item> + <item> + <key> <string>hide_rows_on_no_search_criterion</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>lines</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>list_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>portal_types</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>selection_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>sort</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>target</string> </key> <value> <string></string> </value> @@ -97,11 +133,11 @@ <string>link</string> </tuple> <tuple> - <string>DiscussionPost_getDescription</string> + <string>Base_getDescription</string> <string>description</string> </tuple> <tuple> - <string>absolute_url</string> + <string>link</string> <string>guid</string> </tuple> </list> @@ -123,10 +159,14 @@ <key> <string>hide_rows_on_no_search_criterion</string> </key> <value> <int>0</int> </value> </item> + <item> + <key> <string>lines</string> </key> + <value> <int>20</int> </value> + </item> <item> <key> <string>list_method</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> </value> </item> <item> @@ -140,12 +180,16 @@ </list> </value> </item> + <item> + <key> <string>selection_name</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>sort</string> </key> <value> <list> <tuple> - <string>creation_date</string> + <string>modification_date</string> <string>descending</string> </tuple> </list> @@ -162,6 +206,19 @@ </pickle> </record> <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: int(here.REQUEST.get(\'size\', preferences.getPreference(\'preferred_listbox_list_mode_line_count\', 30)))</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> <pickle> <global name="Method" module="Products.Formulator.MethodField"/> </pickle> diff --git a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscusionThread_viewContentListAsRSS/listbox_link.xml b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscusionThread_viewContentListAsRSS/listbox_link.xml index c00805bcce..c697a82644 100644 --- a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscusionThread_viewContentListAsRSS/listbox_link.xml +++ b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscusionThread_viewContentListAsRSS/listbox_link.xml @@ -116,7 +116,11 @@ <dictionary> <item> <key> <string>_text</string> </key> - <value> <string>python:cell.getPermanentURL(cell)</string> </value> + <value> <string encoding="cdata"><![CDATA[ + +python:\'%s/view?list_start=%s&reset=1#%s\' %(here.absolute_url(), cell.getId(), cell.getUid()) + +]]></string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionPost_getDescription.xml b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionPost_getDescription.xml deleted file mode 100644 index fbddfaaa5f..0000000000 --- a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionPost_getDescription.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>Script_magic</string> </key> - <value> <int>3</int> </value> - </item> - <item> - <key> <string>_bind_names</string> </key> - <value> - <object> - <klass> - <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> - </klass> - <tuple/> - <state> - <dictionary> - <item> - <key> <string>_asgns</string> </key> - <value> - <dictionary> - <item> - <key> <string>name_container</string> </key> - <value> <string>container</string> </value> - </item> - <item> - <key> <string>name_context</string> </key> - <value> <string>context</string> </value> - </item> - <item> - <key> <string>name_m_self</string> </key> - <value> <string>script</string> </value> - </item> - <item> - <key> <string>name_subpath</string> </key> - <value> <string>traverse_subpath</string> </value> - </item> - </dictionary> - </value> - </item> - </dictionary> - </state> - </object> - </value> - </item> - <item> - <key> <string>_body</string> </key> - <value> <string>return context.getTextContent()\n -</string> </value> - </item> - <item> - <key> <string>_params</string> </key> - <value> <string>**kw</string> </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>DiscussionPost_getDescription</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_discussion/bt/revision b/bt5/erp5_discussion/bt/revision index 1bda760653..8d9f781b52 100644 --- a/bt5/erp5_discussion/bt/revision +++ b/bt5/erp5_discussion/bt/revision @@ -1 +1 @@ -117 \ No newline at end of file +118 \ No newline at end of file -- 2.30.9