[gen] Added, on edit.pt (the unique Appy form) a handler window.onbeforeunload to warn the user that data can be lost or a lock can stay on the object.

This commit is contained in:
Gaetan Delannay 2013-01-18 14:32:29 +01:00
parent d42dffacad
commit b3ff087e8f
11 changed files with 76 additions and 60 deletions

View file

@ -1,17 +1,17 @@
<tal:comment replace="nothing">View macro for a Computed.</tal:comment>
<metal:view define-macro="view">
<tal:sync condition="sync">
<span tal:condition="widget/plainText" tal:replace="value"/>
<span tal:condition="not: widget/plainText" tal:replace="structure value"/>
</tal:sync>
<tal:async condition="not: sync">
<div tal:define= "ajaxHookId python: contextObj.UID() + name"
tal:attributes = "id ajaxHookId">
<script language="javascript"
tal:content="python: 'askComputedField(\'%s\',\'%s\',\'%s\')' % (ajaxHookId, contextObj.absolute_url(), name)">
</script>
</div>
</tal:async>
<tal:sync condition="sync">
<span tal:condition="widget/plainText" tal:replace="value"/>
<span tal:condition="not: widget/plainText" tal:replace="structure value"/>
</tal:sync>
<tal:async condition="not: sync">
<div tal:define= "ajaxHookId python: contextObj.UID() + name"
tal:attributes = "id ajaxHookId">
<script type="text/javascript"
tal:content="python: 'askComputedField(\'%s\',\'%s\',\'%s\')' % (ajaxHookId, contextObj.absolute_url(), name)">
</script>
</div>
</tal:async>
</metal:view>
<tal:comment replace="nothing">Ajax-called view content of a non sync Computed field.</tal:comment>

View file

@ -42,7 +42,7 @@
<tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment>
<input type="hidden" tal:attributes="id name; name name"/>
<img tal:attributes="id string:${name}_img; src string: $appUrl/ui/calendar.gif"/>
<script tal:content="python: contextObj.getCalendarInit(name, years)"></script>
<script type="text/javascript" tal:content="python: contextObj.getCalendarInit(name, years)"></script>
<tal:hour condition="python: widget['format'] == 0">
<select tal:define="hours python:range(0,24);"
@ -109,7 +109,7 @@
<tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment>
<input type="hidden" tal:attributes="id fromName; name fromName"/>
<img tal:attributes="id string:${fromName}_img; src string: $appUrl/ui/calendar.gif"/>
<script tal:content="python: tool.getCalendarInit(fromName, years)"></script>
<script type="text/javascript" tal:content="python: tool.getCalendarInit(fromName, years)"></script>
</td>
</tr>
<tal:comment replace="nothing">To</tal:comment>
@ -140,7 +140,7 @@
<tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment>
<input type="hidden" tal:attributes="id toName; name toName"/>
<img tal:attributes="id string:${toName}_img; src string: $appUrl/ui/calendar.gif"/>
<script tal:content="python: tool.getCalendarInit(toName, years)"></script>
<script type="text/javascript" tal:content="python: tool.getCalendarInit(toName, years)"></script>
</td>
</tr>
</table>

View file

@ -164,7 +164,7 @@
</td>
</tr>
</table>
<script language="javascript"
<script type="text/javascript"
tal:content="python: 'initTab(\'tab_%s\', \'%s_1_%d\')' % (widget['name'], widget['name'], len(widget['widgets']))"></script>
</tal:asTabs>
</metal:group>