Commit 3dbdcae4 authored by Aurel's avatar Aurel

on modified objects, filter the diff before displaying it to the user

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37865 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 44a80bc7
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -61,6 +58,9 @@ modified=context.REQUEST["modified"]\n ...@@ -61,6 +58,9 @@ modified=context.REQUEST["modified"]\n
added=context.REQUEST["added"]\n added=context.REQUEST["added"]\n
removed=context.REQUEST["removed"]\n removed=context.REQUEST["removed"]\n
\n \n
subversion_tool = context.getPortalObject()["portal_subversion"]\n
template_tool = context.getPortalObject()["portal_templates"]\n
\n
print \'<div style="color: black">\'\n print \'<div style="color: black">\'\n
tab_Modified=modified.split(\',\')\n tab_Modified=modified.split(\',\')\n
tab_Added=added.split(\',\')\n tab_Added=added.split(\',\')\n
...@@ -68,26 +68,30 @@ tab_Removed=removed.split(\',\')\n ...@@ -68,26 +68,30 @@ tab_Removed=removed.split(\',\')\n
\n \n
if modified != \'none\':\n if modified != \'none\':\n
for f in tab_Modified:\n for f in tab_Modified:\n
print \'<input name="modified" value="%s" type="checkbox" checked="checked" />\'%f\n diff = subversion_tool.diff(f, context)\n
f = context.getPortalObject()["portal_subversion"].relativeToAbsolute(f, context)\n final_diff = template_tool.getFilteredDiffAsHTML(diff)\n
print "<span style=\'font-weight: bold; color: black;\'>Index: "\\\n context.log("final_diff = %s" %(final_diff))\n
"<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n if len(final_diff):\n
make_query(file=f), f)\n print \'<input name="modified" value="%s" type="checkbox" checked="checked" />\'%f\n
edit_path = context.getPortalObject()["portal_subversion"].editPath(context, f)\n f = context.getPortalObject()["portal_subversion"].relativeToAbsolute(f, context)\n
if(edit_path != \'#\'):\n print "<span style=\'font-weight: bold; color: black;\'>Index: "\\\n
print "<a href=\'"+edit_path+"\'><img src=\'ERP5Subversion_imgs/edit.png\' alt=\'Edit\' style=\'border: 0\' /></a>"\n "<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n
print \'</span><br/>\'\n make_query(file=f), f)\n
print context.getPortalObject()["portal_subversion"].diffHTML(f, context)\n edit_path = subversion_tool.editPath(context, f)\n
print \'<hr/><br/>\'\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 \n
if added != \'none\':\n if added != \'none\':\n
for f in tab_Added:\n for f in tab_Added:\n
print \'<input name="added" value="%s" type="checkbox" checked="checked" />\'%f\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 print "<span style=\'font-weight: bold; color: black;\'>Index: "\\\n
"<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n "<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n
make_query(file=f), f)\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 if(edit_path != \'#\'):\n
print "<a href=\'"+edit_path+"\'><img src=\'ERP5Subversion_imgs/edit.png\' alt=\'Edit\' style=\'border: 0\' /></a>"\n print "<a href=\'"+edit_path+"\'><img src=\'ERP5Subversion_imgs/edit.png\' alt=\'Edit\' style=\'border: 0\' /></a>"\n
print \'</span><br/>\'\n print \'</span><br/>\'\n
...@@ -96,11 +100,11 @@ if added != \'none\':\n ...@@ -96,11 +100,11 @@ if added != \'none\':\n
if removed != \'none\':\n if removed != \'none\':\n
for f in tab_Removed:\n for f in tab_Removed:\n
print \'<input name="removed" value="%s" type="checkbox" checked="checked" />\'%f\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 print "<span style=\'font-weight: bold; color: black;\'>Index: "\\\n
"<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n "<a href=\'BusinessTemplate_viewSvnShowFile?%s\'>%s</a></span>" %(\n
make_query(file=f), f)\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 if(edit_path != \'#\'):\n
print "<a href=\'"+edit_path+"\'><img src=\'ERP5Subversion_imgs/edit.png\' alt=\'Edit\' style=\'border: 0\' /></a>"\n print "<a href=\'"+edit_path+"\'><img src=\'ERP5Subversion_imgs/edit.png\' alt=\'Edit\' style=\'border: 0\' /></a>"\n
print \'</span><br/>\'\n print \'</span><br/>\'\n
...@@ -156,11 +160,16 @@ return printed\n ...@@ -156,11 +160,16 @@ return printed\n
<string>modified</string> <string>modified</string>
<string>added</string> <string>added</string>
<string>removed</string> <string>removed</string>
<string>subversion_tool</string>
<string>template_tool</string>
<string>tab_Modified</string> <string>tab_Modified</string>
<string>tab_Added</string> <string>tab_Added</string>
<string>tab_Removed</string> <string>tab_Removed</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>f</string> <string>f</string>
<string>diff</string>
<string>final_diff</string>
<string>len</string>
<string>edit_path</string> <string>edit_path</string>
</tuple> </tuple>
</value> </value>
......
605 606
\ 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