Commit d4743f20 authored by Jérome Perrin's avatar Jérome Perrin

xhtml_style: support form_dialog without action

In that case the action button is not displayed.
If there's an update action defined on the form settings, update button is
displayed.
Cancel button is displayed using the same rule as any dialogs (ie. everytime
there's a cancel_url in request)
parent 1a3efb85
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</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>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testFormDialogWithOnlyUpdate</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Form Dialog with only Update Button</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Form Dialog with only Update Button</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/foo_module/1/view</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_action</td>
<td>Dialog with only Update</td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//button[@id='dialog_update_button']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//button[@id='dialog_cancel_button']</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//button[@id='dialog_submit_button']</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@id='dialog_update_button']</td>
<td></td>
</tr>
<tr>
<td>assertLocation</td>
<td>glob:${base_url}/foo_module/1/Foo_viewDialogWithOnlyUpdate*</td>
<td></td>
</tr>
<tr>
<td>assertTextNotPresent</td>
<td>Error</td>
<td></td>
</tr>
</body>
</html>
\ No newline at end of file
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<span i18n:translate="" i18n:domain="ui" <span i18n:translate="" i18n:domain="ui"
tal:content="python:here.Base_getFormViewDialogActionButtonUpdateActionTitle(form)">Update</span> tal:content="python:here.Base_getFormViewDialogActionButtonUpdateActionTitle(form)">Update</span>
</button> </button>
<button accesskey="V" <button tal:condition="form/action|nothing" accesskey="V"
id="dialog_submit_button" name="Base_callDialogMethod:method" id="dialog_submit_button" name="Base_callDialogMethod:method"
type="submit" class="bt-med dialog_submit_button"> type="submit" class="bt-med dialog_submit_button">
<span i18n:translate="" i18n:domain="ui" <span i18n:translate="" i18n:domain="ui"
......
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