[Erp5-report] r37865 aurel - in /erp5/trunk/bt5/erp5_forge: SkinTemplateItem/portal_skins/e...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Aug 17 13:05:58 CEST 2010


Author: aurel
Date: Tue Aug 17 13:05:53 2010
New Revision: 37865

URL: http://svn.erp5.org?rev=37865&view=rev
Log:
on modified objects, filter the diff before displaying it to the user

Modified:
    erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_svn/BusinessTemplate_doSvnDiff.xml
    erp5/trunk/bt5/erp5_forge/bt/revision

Modified: erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_svn/BusinessTemplate_doSvnDiff.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_svn/BusinessTemplate_doSvnDiff.xml?rev=37865&r1=37864&r2=37865&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_svn/BusinessTemplate_doSvnDiff.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_svn/BusinessTemplate_doSvnDiff.xml [utf8] Tue Aug 17 13:05:53 2010
@@ -2,10 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <tuple>
-        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-        <tuple/>
-      </tuple>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -61,6 +58,9 @@ modified=context.REQUEST["modified"]\n
 added=context.REQUEST["added"]\n
 removed=context.REQUEST["removed"]\n
 \n
+subversion_tool = context.getPortalObject()["portal_subversion"]\n
+template_tool = context.getPortalObject()["portal_templates"]\n
+\n
 print \'<div style="color: black">\'\n
 tab_Modified=modified.split(\',\')\n
 tab_Added=added.split(\',\')\n
@@ -68,26 +68,30 @@ tab_Removed=removed.split(\',\')\n
 \n
 if modified != \'none\':\n
   for f in tab_Modified:\n
-    print \'<input name="modified" value="%s" type="checkbox" checked="checked" />\'%f\n
-    f = context.getPortalObject()["portal_subversion"].relativeToAbsolute(f, context)\n
-    print "<span style=\'font-weight: bold; color: black;\'>Index: "\\\n
-        "<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n
-         make_query(file=f), f)\n
-    edit_path = context.getPortalObject()["portal_subversion"].editPath(context, f)\n
-    if(edit_path != \'#\'):\n
-      print "<a href=\'"+edit_path+"\'><img src=\'ERP5Subversion_imgs/edit.png\' alt=\'Edit\' style=\'border: 0\' /></a>"\n
-    print \'</span><br/>\'\n
-    print context.getPortalObject()["portal_subversion"].diffHTML(f, context)\n
-    print \'<hr/><br/>\'\n
+    diff = subversion_tool.diff(f, context)\n
+    final_diff = template_tool.getFilteredDiffAsHTML(diff)\n
+    context.log("final_diff = %s" %(final_diff))\n
+    if len(final_diff):\n
+      print \'<input name="modified" value="%s" type="checkbox" checked="checked" />\'%f\n
+      f = context.getPortalObject()["portal_subversion"].relativeToAbsolute(f, context)\n
+      print "<span style=\'font-weight: bold; color: black;\'>Index: "\\\n
+          "<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n
+           make_query(file=f), f)\n
+      edit_path = subversion_tool.editPath(context, f)\n
+      if(edit_path != \'#\'):\n
+        print "<a href=\'"+edit_path+"\'><img src=\'ERP5Subversion_imgs/edit.png\' alt=\'Edit\' style=\'border: 0\' /></a>"\n
+      print final_diff\n
+      print \'</span><br/>\'\n
+      print \'<hr/><br/>\'\n
 \n
 if added != \'none\':\n
   for f in tab_Added:\n
     print \'<input name="added" value="%s" type="checkbox" checked="checked" />\'%f\n
-    f = context.getPortalObject()["portal_subversion"].relativeToAbsolute(f, context)\n
+    f = subversion_tool.relativeToAbsolute(f, context)\n
     print "<span style=\'font-weight: bold; color: black;\'>Index: "\\\n
         "<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n
          make_query(file=f), f)\n
-    edit_path = context.getPortalObject()["portal_subversion"].editPath(context, f)\n
+    edit_path = subversion_tool.editPath(context, f)\n
     if(edit_path != \'#\'):\n
       print "<a href=\'"+edit_path+"\'><img src=\'ERP5Subversion_imgs/edit.png\' alt=\'Edit\' style=\'border: 0\' /></a>"\n
     print \'</span><br/>\'\n
@@ -96,11 +100,11 @@ if added != \'none\':\n
 if removed != \'none\':\n
   for f in tab_Removed:\n
     print \'<input name="removed" value="%s" type="checkbox" checked="checked" />\'%f\n
-    f = context.getPortalObject()["portal_subversion"].relativeToAbsolute(f, context)\n
+    f = subversion_tool.relativeToAbsolute(f, context)\n
     print "<span style=\'font-weight: bold; color: black;\'>Index: "\\\n
         "<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n
          make_query(file=f), f)\n
-    edit_path = context.getPortalObject()["portal_subversion"].editPath(context, f)\n
+    edit_path = subversion_tool.editPath(context, f)\n
     if(edit_path != \'#\'):\n
       print "<a href=\'"+edit_path+"\'><img src=\'ERP5Subversion_imgs/edit.png\' alt=\'Edit\' style=\'border: 0\' /></a>"\n
     print \'</span><br/>\'\n
@@ -156,11 +160,16 @@ return printed\n
                             <string>modified</string>
                             <string>added</string>
                             <string>removed</string>
+                            <string>subversion_tool</string>
+                            <string>template_tool</string>
                             <string>tab_Modified</string>
                             <string>tab_Added</string>
                             <string>tab_Removed</string>
                             <string>_getiter_</string>
                             <string>f</string>
+                            <string>diff</string>
+                            <string>final_diff</string>
+                            <string>len</string>
                             <string>edit_path</string>
                           </tuple>
                         </value>

Modified: erp5/trunk/bt5/erp5_forge/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_forge/bt/revision?rev=37865&r1=37864&r2=37865&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_forge/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_forge/bt/revision [utf8] Tue Aug 17 13:05:53 2010
@@ -1 +1 @@
-605
\ No newline at end of file
+606
\ No newline at end of file




More information about the Erp5-report mailing list