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 @@
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
......@@ -31,12 +31,7 @@
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
<dictionary/>
</value>
</item>
</dictionary>
......@@ -45,66 +40,106 @@
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n
"DTD/xhtml1-strict.dtd">\n
<?xml-stylesheet href="erp5.css" rel="stylesheet" type="text/css"?>\n
\n
<tal:block metal:use-macro="here/view_master/macros/master">\n
<tal:block metal:fill-slot="main">\n
\n
<tal:block tal:define="path context/file;\n
log_list context/log_list">\n
<font color=\'black\'>\n
<br><a tal:attributes="href python:\'BusinessTemplate_viewSvnShowFile?file=\'+str(path)"><b tal:content="python:str(path)+\' File History\'"></b></a>\n
<a tal:attributes="href context/edit_path"><img src=\'imgs/edit.png\' border=\'0\'></a><hr><br>\n
<script>\n
function checkControl(){\n
alert("checked")\n
}\n
</script>\n
\n
<tal:block tal:repeat="rev_dict log_list">\n
<center><table border=1 width=60%%>\n
<tr> <!-- <td rowspan=\'2\'><input name=\'check%s\' value=\'%s\' type=\'checkbox\'></td> -->\n
<td style=\'background-color: rgb(204, 204, 255);\'><b>Revision:</b> <span tal:content="python:rev_dict[\'revision\']">revision</span></td>\n
<td style=\'background-color: rgb(204, 204, 255);\'> <b>Author:</b> <span tal:content="python:rev_dict[\'author\']">author</span></td>\n
<td style=\'background-color: rgb(204, 204, 255);\'> <b>Date:</b> <span tal:content="python:rev_dict[\'date\']">date</span></td>\n
</tr>\n
<tr>\n
<td style=\'background-color: white;\' colspan=\'3\'><i tal:content="structure python:\'<br>\'.join(rev_dict[\'message\'].split(\'\\n\'))">changelog</i></td>\n
</tr>\n
</table></center>\n
<br>\n
</tal:block>\n
</font>\n
<br><br>\n
<center><button onclick="history.back()" value="back" name="back" type="button">Back</button>\n
</center>\n
</tal:block>\n
</tal:block>\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
<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>right</string>
<string>left</string>
<string>center</string>
<string>bottom</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
<string>listbox_message</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_title</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessTemplate_viewSvnLog</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>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>
<key> <string>title</string> </key>
<value> <string></string> </value>
</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>
</pickle>
</record>
......
......@@ -423,7 +423,7 @@
</item>
<item>
<key> <string>lines</string> </key>
<value> <int>10</int> </value>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>list_action</string> </key>
......@@ -544,7 +544,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>svn_log2</string> </value>
<value> <string>svn_log</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -243,7 +243,11 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>listbox_message</string> </value>
<value> <string encoding="cdata"><![CDATA[
&nbsp;
]]></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
......
......@@ -281,7 +281,7 @@
<key> <string>_text</string> </key>
<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>
</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
function log(){\n
//hide popup\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
function ls(){\n
......
......@@ -67,7 +67,7 @@
<item>
<key> <string>_body</string> </key>
<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
changelog=context.REQUEST["changelog"]\n
else:\n
......@@ -81,7 +81,7 @@ else:\n
if modified != \'\' and modified != \'none\':\n
commit_non_recurs = modified\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
if removed != \'\' and removed != \'none\':\n
commit_recurs = removed.split(\',\')\n
......
......@@ -66,15 +66,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n
svn_path = context.getPortalObject().portal_preferences.getPreference(\'subversion_working_copy\')\n
if not svn_path :\n
raise "Error: Please set Subversion working path in preferences"\n
if svn_path[-1]!=\'/\':\n
svn_path+=\'/\'\n
\n
file = svn_path + file\n
\n
<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
......@@ -84,8 +79,17 @@ 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
return context.asContext(log_list=log_list, file=file, edit_path=context.getPortalObject()["portal_subversion"].editPath(context, file)).BusinessTemplate_viewSvnLog()\n
</string> </value>
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>
......@@ -99,7 +103,7 @@ return context.asContext(log_list=log_list, file=file, edit_path=context.getPort
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>file</string> </value>
<value> <string>file,**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -126,16 +130,24 @@ return context.asContext(log_list=log_list, file=file, edit_path=context.getPort
<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>context</string>
<string>svn_path</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>
......
<?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