Commit bb49dd04 authored by Fabien Morin's avatar Fabien Morin

tag -> subject which is the appropriate term in erp5

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39593 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7173d28b
......@@ -66,7 +66,7 @@
</small>\n
\n
<small class="post_author"><tal:block i18n:translate="" i18n:domain="ui">Author</tal:block>: <span tal:replace="author">Author</span></small><tal:block tal:condition="categories"> | <small class="post_category"><tal:block i18n:translate="" i18n:domain="ui">Category</tal:block>: \n
<tal:block tal:repeat="category categories"><a tal:attributes="href python: \'%s?tag=%s\' % (base_url_string, category)" tal:content="category">cat.</a><tal:block tal:condition="not: repeat/category/end"> ; </tal:block></tal:block></small></tal:block>\n
<tal:block tal:repeat="category categories"><a tal:attributes="href python: \'%s?subject=%s\' % (base_url_string, category)" tal:content="category">cat.</a><tal:block tal:condition="not: repeat/category/end"> ; </tal:block></tal:block></small></tal:block>\n
\n
</div><!--End post_head -->\n
\n
......
......@@ -52,11 +52,10 @@
<key> <string>_body</string> </key>
<value> <string>"""\n
This script returns the blog post that must be displayed in the current section.\n
The blog post are filtered through the tag parameter that is retrieved through\n
The blog post are filtered through the subject parameter that is retrieved through\n
the GET parameters.\n
\n
TODO: XXX-JPS\n
- why don\'t you explicitly define subject as a parameter of the method\n
- again, way too slow if this returns 1,000,000 documents\n
- appropriate way is to either call context.getDocumentValueList(subject=subject, **kw)\n
or context.getDocumentValueList(subject=subject), depending on your goal\n
......@@ -65,15 +64,14 @@
\n
request = container.REQUEST\n
\n
requested_tag = request.get(\'tag\') # XXX-JPS it would be better to use subject which is the normal term in ERP5\n
current_section = context.getWebSectionValue()\n
result = current_section.WebSection_getDocumentValueList(**kw)\n
tagged_result = []\n
if requested_tag is not None:\n
result_with_subject = []\n
if subject is not None:\n
for item in result: # XXX-JPS this could be way too slow\n
if requested_tag in item.getSubjectList():\n
tagged_result.append(item)\n
return tagged_result\n
if subject in item.getSubjectList():\n
result_with_subject.append(item)\n
return result_with_subject\n
\n
return result\n
</string> </value>
......@@ -86,7 +84,7 @@ return result\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>subject=None, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -106,22 +104,22 @@ return result\n
<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>subject</string>
<string>kw</string>
<string>_getattr_</string>
<string>container</string>
<string>request</string>
<string>requested_tag</string>
<string>context</string>
<string>current_section</string>
<string>_apply_</string>
<string>result</string>
<string>tagged_result</string>
<string>result_with_subject</string>
<string>None</string>
<string>_getiter_</string>
<string>item</string>
......@@ -136,7 +134,9 @@ return result\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
......
......@@ -45,7 +45,7 @@
<ul tal:define="current_web_section python:request.get(\'current_web_section\', here)">\n
<li tal:repeat="line here/query">\n
<tal:block tal:define="render_result line/render">\n
<a tal:attributes="href python: \'%s?tag=%s\' % (current_web_section.absolute_url(), render_result[0][1])" tal:content="python: render_result[0][1]"></a>\n
<a tal:attributes="href python: \'%s?subject=%s\' % (current_web_section.absolute_url(), render_result[0][1])" tal:content="python: render_result[0][1]"></a>\n
</tal:block>\n
</li>\n
</ul>\n
......@@ -63,7 +63,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_viewTagListWidget</string> </value>
<value> <string>WebSection_viewSubjectListWidget</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
......
......@@ -94,7 +94,7 @@
<key> <string>side box (Tags)</string> </key>
<value>
<list>
<string>tag_list</string>
<string>subject_list</string>
</list>
</value>
</item>
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>tag_list</string> </value>
<value> <string>subject_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -368,6 +368,10 @@
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>table</string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
......@@ -378,6 +382,12 @@
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_style_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
......@@ -412,6 +422,10 @@
<list/>
</value>
</item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
......@@ -440,9 +454,13 @@
<list/>
</value>
</item>
<item>
<key> <string>page_navigation_mode</string> </key>
<value> <string>slider</string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string>WebSection_viewTagListWidget</string> </value>
<value> <string>WebSection_viewSubjectListWidget</string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
......@@ -504,6 +522,12 @@
<key> <string>stat_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>List of categories</string> </value>
......
......@@ -122,7 +122,7 @@
<key> <string>left column (Tags)</string> </key>
<value>
<list>
<string>tag_list</string>
<string>subject_list</string>
</list>
</value>
</item>
......
......@@ -14,7 +14,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>tag_list</string> </value>
<value> <string>subject_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -122,7 +122,7 @@
<key> <string>left column (Tags)</string> </key>
<value>
<list>
<string>tag_list</string>
<string>subject_list</string>
</list>
</value>
</item>
......
......@@ -14,7 +14,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>tag_list</string> </value>
<value> <string>subject_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>tag_list</string> </value>
<value> <string>subject_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......
55
\ No newline at end of file
56
\ 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