Commit 71cfab8a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

we no longer need '/view' for the default view URL.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40361 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a4512947
...@@ -91,7 +91,7 @@ elif doAction0 == \'add\':\n ...@@ -91,7 +91,7 @@ elif doAction0 == \'add\':\n
except AttributeError:\n except AttributeError:\n
# Maybe the Product is not upgraded yet.\n # Maybe the Product is not upgraded yet.\n
tmp_kw = new_content.Base_getRedirectParameterDictAfterAdd(context, **kw)\n tmp_kw = new_content.Base_getRedirectParameterDictAfterAdd(context, **kw)\n
redirect_url = tmp_kw.pop(\'redirect_url\', new_content.absolute_url() + \'/view\')\n redirect_url = tmp_kw.pop(\'redirect_url\', new_content.absolute_url())\n
kw.update(tmp_kw)\n kw.update(tmp_kw)\n
# Otherwise, check if this is an automatic menu (template)\n # Otherwise, check if this is an automatic menu (template)\n
elif doAction0 == \'template\':\n elif doAction0 == \'template\':\n
...@@ -105,10 +105,10 @@ elif doAction0 == \'template\':\n ...@@ -105,10 +105,10 @@ elif doAction0 == \'template\':\n
new_content = context[new_content_id]\n new_content = context[new_content_id]\n
new_content.makeTemplateInstance()\n new_content.makeTemplateInstance()\n
preserved_parameters[\'portal_status_message\'] = Base_translateString("Template created.")\n preserved_parameters[\'portal_status_message\'] = Base_translateString("Template created.")\n
redirect_url = \'%s/view\' % ( new_content.absolute_url(), )\n redirect_url = new_content.absolute_url()\n
else:\n else:\n
preserved_parameters[\'portal_status_message\'] = Base_translateString("Template does not exist.")\n preserved_parameters[\'portal_status_message\'] = Base_translateString("Template does not exist.")\n
redirect_url = \'%s/view\' % (context.absolute_url(), )\n redirect_url = context.absolute_url()\n
else:\n else:\n
redirect_url = request[\'ACTUAL_URL\']\n redirect_url = request[\'ACTUAL_URL\']\n
preserved_parameters[\'portal_status_message\'] = Base_translateString(\'Error: the action "%s" is not recognised.\' % (doAction0, ))\n preserved_parameters[\'portal_status_message\'] = Base_translateString(\'Error: the action "%s" is not recognised.\' % (doAction0, ))\n
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
select_module = context.REQUEST.form["Base_doModule"]\n select_module = context.REQUEST.form["Base_doModule"]\n
if select_module == \'\':\n if select_module == \'\':\n
return\n return\n
return context.ERP5Site_redirect(\'%s/view\' % select_module, **kw)\n return context.ERP5Site_redirect(select_module, **kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># This is the default method for a redirection after being added.\n <value> <string># This is the default method for a redirection after being added.\n
return dict(redirect_url=context.absolute_url() + \'/view\', selection_index=None, selection_name=None)\n return dict(redirect_url=context.absolute_url(), selection_index=None, selection_name=None)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -61,7 +61,7 @@ request_form.update(keep_items)\n ...@@ -61,7 +61,7 @@ request_form.update(keep_items)\n
# JPS-XXX Why ERP5Site ? not Base ? \n # JPS-XXX Why ERP5Site ? not Base ? \n
\n \n
if redirect_url is None:\n if redirect_url is None:\n
redirect_url = \'%s/view\' % (context.getPortalObject().absolute_url())\n redirect_url = context.getPortalObject().absolute_url()\n
\n \n
parameters = make_query(dict([(k, v) for k, v in request_form.items() if k and v is not None]))\n parameters = make_query(dict([(k, v) for k, v in request_form.items() if k and v is not None]))\n
if len(parameters):\n if len(parameters):\n
......
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
allowed_type_list = context.getVisibleAllowedContentTypeList()\n allowed_type_list = context.getVisibleAllowedContentTypeList()\n
\n \n
if not allowed_type_list:\n if not allowed_type_list:\n
return context.ERP5Site_redirect(\'%s/view\' % (context.absolute_url(), ), keep_items={\'portal_status_message\': Base_translateString("You are not allowed to add new content in this context.")})\n return context.ERP5Site_redirect(context.absolute_url(), keep_items={\'portal_status_message\': Base_translateString("You are not allowed to add new content in this context.")})\n
\n \n
# newContent will add the first allowed type when we do not specify portal_type=\n # newContent will add the first allowed type when we do not specify portal_type=\n
new_object = context.newContent(portal_type=allowed_type_list[0])\n new_object = context.newContent(portal_type=allowed_type_list[0])\n
\n \n
return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), \n return context.ERP5Site_redirect(new_object.absolute_url(),\n
keep_items={\'portal_status_message\': Base_translateString("Object created."),\n keep_items={\'portal_status_message\': Base_translateString("Object created."),\n
\'editable_mode\': 1})\n \'editable_mode\': 1})\n
</string> </value> </string> </value>
......
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"Modified version for ERP5 to append the default action (/view) in the URL."\n <value> <string>"Modified version for ERP5 to append the ignore_layout parameter etc. in the URL."\n
\n \n
from Products.CMFCore.utils import getToolByName\n from Products.CMFCore.utils import getToolByName\n
ptool = getToolByName(script, \'portal_properties\')\n ptool = getToolByName(script, \'portal_properties\')\n
...@@ -181,7 +181,7 @@ param = int(context.REQUEST.get(\'ignore_layout\', 0)) and \'?ignore_layout:int= ...@@ -181,7 +181,7 @@ param = int(context.REQUEST.get(\'ignore_layout\', 0)) and \'?ignore_layout:int=
if include_root:\n if include_root:\n
result.append( { \'id\' : \'root\'\n result.append( { \'id\' : \'root\'\n
, \'title\' : ptool.title()\n , \'title\' : ptool.title()\n
, \'url\' : \'%s/view%s\' % (portal_url, param)\n , \'url\' : \'%s%s\' % (portal_url, param)\n
}\n }\n
)\n )\n
\n \n
...@@ -203,7 +203,7 @@ for name in relative:\n ...@@ -203,7 +203,7 @@ for name in relative:\n
if not name == \'talkback\':\n if not name == \'talkback\':\n
result.append( { \'id\' : name\n result.append( { \'id\' : name\n
, \'title\' : title\n , \'title\' : title\n
, \'url\' : \'%s/%s/view%s\' % (portal_url, \'/\'.join(now), param)\n , \'url\' : \'%s/%s%s\' % (portal_url, \'/\'.join(now), param)\n
}\n }\n
)\n )\n
\n \n
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<tal:block tal:condition="python: type_info is not None and type_info.Base_getSourceVisibility()"\n <tal:block tal:condition="python: type_info is not None and type_info.Base_getSourceVisibility()"\n
tal:define="type_info python: portal.portal_types.getTypeInfo(here)">\n tal:define="type_info python: portal.portal_types.getTypeInfo(here)">\n
<option value="1" disabled="disabled" i18n:translate="" i18n:domain="ui">-- Developer Mode --</option>\n <option value="1" disabled="disabled" i18n:translate="" i18n:domain="ui">-- Developer Mode --</option>\n
<option tal:attributes="value python: \'%s/view\' % type_info.absolute_url_path()"\n <option tal:attributes="value type_info/absolute_url_path"\n
i18n:translate="" i18n:domain="ui">Edit Portal Type \'<tal:block tal:content="here/getPortalTypeName"\n i18n:translate="" i18n:domain="ui">Edit Portal Type \'<tal:block tal:content="here/getPortalTypeName"\n
i18n:name="portal_type" i18n:translate="" i18n:domain="ui" />\'</option>\n i18n:name="portal_type" i18n:translate="" i18n:domain="ui" />\'</option>\n
</tal:block>\n </tal:block>\n
...@@ -318,8 +318,7 @@ ...@@ -318,8 +318,7 @@
</span>\n </span>\n
<p class="clear"></p>\n <p class="clear"></p>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>
]]></unicode> </value> ]]></unicode> </value>
</item> </item>
......
...@@ -51,12 +51,11 @@ ...@@ -51,12 +51,11 @@
dummy python: response.redirect(url);" />\n dummy python: response.redirect(url);" />\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="not: isAnon">\n <tal:block tal:condition="not: isAnon">\n
<tal:block tal:define="came_from python: request.get(\'came_from\') or here.absolute_url() + \'/view\';\n <tal:block tal:define="came_from python: request.get(\'came_from\') or here.absolute_url();\n
dummy python: response.redirect(came_from);" />\n dummy python: response.redirect(came_from);" />\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>
]]></unicode> </value> ]]></unicode> </value>
</item> </item>
......
1043 1044
\ No newline at end of file \ 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