Commit 4ca08cd3 authored by Christophe Dumez's avatar Christophe Dumez

- use listbox to display file history (still need improvements but working)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6554 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ca0154f
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
<string>Products.PageTemplates.ZopePageTemplate</string> <string>Products.ERP5Form.Form</string>
<string>ZopePageTemplate</string> <string>ERP5Form</string>
</tuple> </tuple>
<none/> <none/>
</tuple> </tuple>
...@@ -31,12 +31,7 @@ ...@@ -31,12 +31,7 @@
<item> <item>
<key> <string>_asgns</string> </key> <key> <string>_asgns</string> </key>
<value> <value>
<dictionary> <dictionary/>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -45,66 +40,106 @@ ...@@ -45,66 +40,106 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_objects</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value>
<tuple/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n </value>
"DTD/xhtml1-strict.dtd">\n </item>
<?xml-stylesheet href="erp5.css" rel="stylesheet" type="text/css"?>\n <item>
\n <key> <string>action</string> </key>
<tal:block metal:use-macro="here/view_master/macros/master">\n <value> <string></string> </value>
<tal:block metal:fill-slot="main">\n </item>
\n <item>
<tal:block tal:define="path context/file;\n <key> <string>encoding</string> </key>
log_list context/log_list">\n <value> <string>UTF-8</string> </value>
<font color=\'black\'>\n </item>
<br><a tal:attributes="href python:\'BusinessTemplate_viewSvnShowFile?file=\'+str(path)"><b tal:content="python:str(path)+\' File History\'"></b></a>\n <item>
<a tal:attributes="href context/edit_path"><img src=\'imgs/edit.png\' border=\'0\'></a><hr><br>\n <key> <string>enctype</string> </key>
<script>\n <value> <string></string> </value>
function checkControl(){\n </item>
alert("checked")\n <item>
}\n <key> <string>group_list</string> </key>
</script>\n <value>
\n <list>
<tal:block tal:repeat="rev_dict log_list">\n <string>right</string>
<center><table border=1 width=60%%>\n <string>left</string>
<tr> <!-- <td rowspan=\'2\'><input name=\'check%s\' value=\'%s\' type=\'checkbox\'></td> -->\n <string>center</string>
<td style=\'background-color: rgb(204, 204, 255);\'><b>Revision:</b> <span tal:content="python:rev_dict[\'revision\']">revision</span></td>\n <string>bottom</string>
<td style=\'background-color: rgb(204, 204, 255);\'> <b>Author:</b> <span tal:content="python:rev_dict[\'author\']">author</span></td>\n </list>
<td style=\'background-color: rgb(204, 204, 255);\'> <b>Date:</b> <span tal:content="python:rev_dict[\'date\']">date</span></td>\n </value>
</tr>\n </item>
<tr>\n <item>
<td style=\'background-color: white;\' colspan=\'3\'><i tal:content="structure python:\'<br>\'.join(rev_dict[\'message\'].split(\'\\n\'))">changelog</i></td>\n <key> <string>groups</string> </key>
</tr>\n <value>
</table></center>\n <dictionary>
<br>\n <item>
</tal:block>\n <key> <string>bottom</string> </key>
</font>\n <value>
<br><br>\n <list>
<center><button onclick="history.back()" value="back" name="back" type="button">Back</button>\n <string>listbox</string>
</center>\n <string>listbox_message</string>
</tal:block>\n </list>
</tal:block>\n </value>
</tal:block> </item>
<item>
]]></string> </value> <key> <string>center</string> </key>
</item> <value>
<item> <list/>
<key> <string>content_type</string> </key> </value>
<value> <string>text/html</string> </value> </item>
</item> <item>
<item> <key> <string>left</string> </key>
<key> <string>expand</string> </key> <value>
<value> <int>0</int> </value> <list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_title</string>
</list>
</value>
</item>
</dictionary>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>BusinessTemplate_viewSvnLog</string> </value> <value> <string>BusinessTemplate_viewSvnLog</string> </value>
</item> </item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>BusinessTemplate_viewSvnLog2</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -423,7 +423,7 @@ ...@@ -423,7 +423,7 @@
</item> </item>
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <int>10</int> </value> <value> <int>100</int> </value>
</item> </item>
<item> <item>
<key> <string>list_action</string> </key> <key> <string>list_action</string> </key>
...@@ -544,7 +544,7 @@ ...@@ -544,7 +544,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <string>svn_log2</string> </value> <value> <string>svn_log</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -243,7 +243,11 @@ ...@@ -243,7 +243,11 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>listbox_message</string> </value> <value> <string encoding="cdata"><![CDATA[
&nbsp;
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>truncate</string> </key> <key> <string>truncate</string> </key>
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
python: "<b>"+str(here.REQUEST[\'file\'])+"</b>&nbsp;&nbsp;<img src=\'imgs/edit.png\' border=\'0\'>" python: "<b><a href=\'BusinessTemplate_viewSvnShowFile?file="+str(here.REQUEST[\'file\'])+"\'>"+str(here.REQUEST[\'file\'])+"</a></b>&nbsp;&nbsp;<a href=\'"+here.getPortalObject()["portal_subversion"].editPath(here, here.REQUEST[\'file\'])+"\'><img src=\'imgs/edit.png\' border=\'0\'></a>"
]]></string> </value> ]]></string> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>Default</string>
<string>bottom</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>Default</string> </key>
<value>
<list>
<string>my_title</string>
</list>
</value>
</item>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
<string>listbox_message</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessTemplate_viewSvnLog2</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string> BusinessTemplate_viewSvnLog2</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -359,7 +359,7 @@ document.onmousemove = getMouse;\n ...@@ -359,7 +359,7 @@ document.onmousemove = getMouse;\n
function log(){\n function log(){\n
//hide popup\n //hide popup\n
document.getElementById(\'menudiv\').style.display = "none";\n document.getElementById(\'menudiv\').style.display = "none";\n
open(\'%s/svn_log?file=\'+tree.getSelectedItemId(), \'_self\');\n open(\'%s/BusinessTemplate_viewSvnLog?file=\'+tree.getSelectedItemId(), \'_self\');\n
}\n }\n
\n \n
function ls(){\n function ls(){\n
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n <value> <string>from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n
context.log("svn_commit", "blah")\n \n
if "changelog" in context.REQUEST.keys() and context.REQUEST["changelog"]!=\'\':\n if "changelog" in context.REQUEST.keys() and context.REQUEST["changelog"]!=\'\':\n
changelog=context.REQUEST["changelog"]\n changelog=context.REQUEST["changelog"]\n
else:\n else:\n
...@@ -81,7 +81,7 @@ else:\n ...@@ -81,7 +81,7 @@ else:\n
if modified != \'\' and modified != \'none\':\n if modified != \'\' and modified != \'none\':\n
commit_non_recurs = modified\n commit_non_recurs = modified\n
\n \n
if commit_non_recurs != \'\' and commit_non_recurs!=\'none\':\n if commit_non_recurs != \'\' and commit_non_recurs != \'none\':\n
commit_non_recurs = commit_non_recurs.split(\',\')\n commit_non_recurs = commit_non_recurs.split(\',\')\n
if removed != \'\' and removed != \'none\':\n if removed != \'\' and removed != \'none\':\n
commit_recurs = removed.split(\',\')\n commit_recurs = removed.split(\',\')\n
......
...@@ -66,15 +66,10 @@ ...@@ -66,15 +66,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n <value> <string encoding="cdata"><![CDATA[
svn_path = context.getPortalObject().portal_preferences.getPreference(\'subversion_working_copy\')\n
if not svn_path :\n from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n
raise "Error: Please set Subversion working path in preferences"\n from Products.ERP5Type.Document import newTempBase\n
if svn_path[-1]!=\'/\':\n
svn_path+=\'/\'\n
\n
file = svn_path + file\n
\n
try:\n try:\n
log_list = context.getPortalObject()["portal_subversion"].log(file)\n log_list = context.getPortalObject()["portal_subversion"].log(file)\n
except SubversionSSLTrustError, error:\n except SubversionSSLTrustError, error:\n
...@@ -84,8 +79,17 @@ except SubversionLoginError, error1 :\n ...@@ -84,8 +79,17 @@ except SubversionLoginError, error1 :\n
context.REQUEST.set(\'portal_status_message\', \'Server needs authentication, no cookie found\')\n context.REQUEST.set(\'portal_status_message\', \'Server needs authentication, no cookie found\')\n
return context.asContext(caller=\'log\', realm = error1.getRealm(), username = context.getPortalObject().portal_preferences.getPreference(\'preferred_subversion_user_name\')).BusinessTemplate_viewSvnLogin()\n return context.asContext(caller=\'log\', realm = error1.getRealm(), username = context.getPortalObject().portal_preferences.getPreference(\'preferred_subversion_user_name\')).BusinessTemplate_viewSvnLogin()\n
\n \n
return context.asContext(log_list=log_list, file=file, edit_path=context.getPortalObject()["portal_subversion"].editPath(context, file)).BusinessTemplate_viewSvnLog()\n object_list = []\n
</string> </value> for my_dict in log_list:\n
my_dict[\'message\']=\'<br>\'.join(my_dict[\'message\'].split(\'\\n\'))\n
temp_object = newTempBase(folder=context.getPortalObject(), id=\'1234\')\n
temp_object.edit(**my_dict)\n
object_list.append(temp_object)\n
\n
return object_list\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -99,7 +103,7 @@ return context.asContext(log_list=log_list, file=file, edit_path=context.getPort ...@@ -99,7 +103,7 @@ return context.asContext(log_list=log_list, file=file, edit_path=context.getPort
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>file</string> </value> <value> <string>file,**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -126,16 +130,24 @@ return context.asContext(log_list=log_list, file=file, edit_path=context.getPort ...@@ -126,16 +130,24 @@ return context.asContext(log_list=log_list, file=file, edit_path=context.getPort
<value> <value>
<tuple> <tuple>
<string>file</string> <string>file</string>
<string>kw</string>
<string>Products.ERP5Subversion.SubversionClient</string> <string>Products.ERP5Subversion.SubversionClient</string>
<string>SubversionSSLTrustError</string> <string>SubversionSSLTrustError</string>
<string>SubversionLoginError</string> <string>SubversionLoginError</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
<string>svn_path</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>context</string>
<string>log_list</string> <string>log_list</string>
<string>error</string> <string>error</string>
<string>error1</string> <string>error1</string>
<string>object_list</string>
<string>_getiter_</string>
<string>my_dict</string>
<string>_write_</string>
<string>temp_object</string>
<string>_apply_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">bfINCg==</string> </value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n
from Products.ERP5Type.Document import newTempBase\n
try:\n
log_list = context.getPortalObject()["portal_subversion"].log(file)\n
except SubversionSSLTrustError, error:\n
context.REQUEST.set(\'portal_status_message\', \'SSL Certificate was not recognized\')\n
return context.asContext(trust_dict = error.getTrustDict(), caller=\'log\').BusinessTemplate_viewSvnSSLTrust()\n
except SubversionLoginError, error1 :\n
context.REQUEST.set(\'portal_status_message\', \'Server needs authentication, no cookie found\')\n
return context.asContext(caller=\'log\', realm = error1.getRealm(), username = context.getPortalObject().portal_preferences.getPreference(\'preferred_subversion_user_name\')).BusinessTemplate_viewSvnLogin()\n
\n
object_list = []\n
for my_dict in log_list:\n
my_dict[\'message\']=\'<br>\'.join(my_dict[\'message\'].split(\'\\n\'))\n
temp_object = newTempBase(folder=context.getPortalObject(), id=\'1234\')\n
temp_object.edit(**my_dict)\n
object_list.append(temp_object)\n
\n
return object_list\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/erp5/portal_skins/erp5_svn/svn_log2</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>file,**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>file</string>
<string>kw</string>
<string>Products.ERP5Subversion.SubversionClient</string>
<string>SubversionSSLTrustError</string>
<string>SubversionLoginError</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>_getattr_</string>
<string>_getitem_</string>
<string>context</string>
<string>log_list</string>
<string>error</string>
<string>error1</string>
<string>object_list</string>
<string>_getiter_</string>
<string>my_dict</string>
<string>_write_</string>
<string>temp_object</string>
<string>_apply_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>svn_log2</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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