From 71cfab8a59e4beb91594d600953678e49e1c811f Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Thu, 18 Nov 2010 12:40:44 +0000
Subject: [PATCH] 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
---
 .../portal_skins/erp5_xhtml_style/Base_doAction.xml         | 6 +++---
 .../portal_skins/erp5_xhtml_style/Base_doModule.xml         | 2 +-
 .../Base_getRedirectParameterDictAfterAdd.xml               | 2 +-
 .../portal_skins/erp5_xhtml_style/ERP5Site_redirect.xml     | 2 +-
 .../portal_skins/erp5_xhtml_style/Folder_create.xml         | 4 ++--
 .../portal_skins/erp5_xhtml_style/breadcrumbs.xml           | 6 +++---
 .../portal_skins/erp5_xhtml_style/context_box_render.xml    | 5 ++---
 .../portal_skins/erp5_xhtml_style/logged_in.xml             | 5 ++---
 product/ERP5/bootstrap/erp5_xhtml_style/bt/revision         | 2 +-
 9 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doAction.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doAction.xml
index e5b3d933bf..6f38e5ad93 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doAction.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doAction.xml
@@ -91,7 +91,7 @@ elif doAction0 == \'add\':\n
   except AttributeError:\n
     # Maybe the Product is not upgraded yet.\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
 # Otherwise, check if this is an automatic menu (template)\n
 elif doAction0 == \'template\':\n
@@ -105,10 +105,10 @@ elif doAction0 == \'template\':\n
     new_content = context[new_content_id]\n
     new_content.makeTemplateInstance()\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
     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
   redirect_url = request[\'ACTUAL_URL\']\n
   preserved_parameters[\'portal_status_message\'] = Base_translateString(\'Error: the action "%s" is not recognised.\' % (doAction0, ))\n
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doModule.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doModule.xml
index 305ad9073c..89260bf510 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doModule.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doModule.xml
@@ -54,7 +54,7 @@
   select_module = context.REQUEST.form["Base_doModule"]\n
 if select_module == \'\':\n
   return\n
-return context.ERP5Site_redirect(\'%s/view\' % select_module, **kw)\n
+return context.ERP5Site_redirect(select_module, **kw)\n
 </string> </value>
         </item>
         <item>
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_getRedirectParameterDictAfterAdd.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_getRedirectParameterDictAfterAdd.xml
index e9472ae4cd..2108c10b43 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_getRedirectParameterDictAfterAdd.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_getRedirectParameterDictAfterAdd.xml
@@ -51,7 +51,7 @@
         <item>
             <key> <string>_body</string> </key>
             <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>
         </item>
         <item>
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ERP5Site_redirect.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ERP5Site_redirect.xml
index c68944fc1e..5d92cd3da3 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ERP5Site_redirect.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ERP5Site_redirect.xml
@@ -61,7 +61,7 @@ request_form.update(keep_items)\n
 # JPS-XXX Why ERP5Site ? not Base ? \n
 \n
 if redirect_url is None:\n
-  redirect_url = \'%s/view\' % (context.getPortalObject().absolute_url())\n
+  redirect_url = context.getPortalObject().absolute_url()\n
 \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
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Folder_create.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Folder_create.xml
index 28e041c7b6..802dad9f24 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Folder_create.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Folder_create.xml
@@ -54,12 +54,12 @@
 allowed_type_list = context.getVisibleAllowedContentTypeList()\n
 \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
 # 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
 \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
                                              \'editable_mode\': 1})\n
 </string> </value>
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.xml
index ae0c6acac1..01929de919 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.xml
@@ -170,7 +170,7 @@
         </item>
         <item>
             <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
 from Products.CMFCore.utils import getToolByName\n
 ptool = getToolByName(script, \'portal_properties\')\n
@@ -181,7 +181,7 @@ param = int(context.REQUEST.get(\'ignore_layout\', 0)) and \'?ignore_layout:int=
 if include_root:\n
     result.append( { \'id\'      : \'root\'\n
                    , \'title\'   : ptool.title()\n
-                   , \'url\'     : \'%s/view%s\' % (portal_url, param)\n
+                   , \'url\'     : \'%s%s\' % (portal_url, param)\n
                    }\n
                  )\n
 \n
@@ -203,7 +203,7 @@ for name in relative:\n
     if not name == \'talkback\':\n
         result.append( { \'id\'      : name\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
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/context_box_render.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/context_box_render.xml
index 87a3c9b608..b1ec5e8fe7 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/context_box_render.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/context_box_render.xml
@@ -53,7 +53,7 @@
           <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
             <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:name="portal_type" i18n:translate="" i18n:domain="ui" />\'</option>\n
           </tal:block>\n
@@ -318,8 +318,7 @@
     </span>\n
     <p class="clear"></p>\n
   </tal:block>\n
-</tal:block>\n
-
+</tal:block>
 
 ]]></unicode> </value>
         </item>
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/logged_in.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/logged_in.xml
index c4e6ef2ce2..19bb2b8b8a 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/logged_in.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/logged_in.xml
@@ -51,12 +51,11 @@
                  dummy python: response.redirect(url);" />\n
     </tal:block>\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
     </tal:block>\n
   </tal:block>\n
-</tal:block>\n
-
+</tal:block>
 
 ]]></unicode> </value>
         </item>
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
index a76eb9d7a5..03c4ecbc93 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
@@ -1 +1 @@
-1043
\ No newline at end of file
+1044
\ No newline at end of file
-- 
2.30.9