[gen] Allow to show transitions on 'view' and/or 'result' layout types.
This commit is contained in:
parent
e0cef5eed5
commit
da1f2699cd
7 changed files with 33 additions and 12 deletions
|
@ -21,7 +21,7 @@ input[type=checkbox] { border: 0; background: none; cursor: pointer }
|
|||
input[type=radio] { border: 0; background: none; cursor: pointer }
|
||||
input[type=file] { border: 0px solid #d0d0d0;
|
||||
background-color: #f8f8f8; cursor: pointer }
|
||||
input[type=button] { border: 1px solid #d0d0d0;
|
||||
input[type=button] { border: 1px solid #d0d0d0; margin: 0 3px;
|
||||
background-color: #f8f8f8; cursor: pointer }
|
||||
input[type=submit] { border: 1px solid #d0d0d0; background-color: #f8f8f8;
|
||||
cursor: pointer }
|
||||
|
|
|
@ -353,14 +353,14 @@ function submitAppyForm(button) {
|
|||
}
|
||||
|
||||
// Function used for triggering a workflow transition
|
||||
function triggerTransition(transitionId, msg) {
|
||||
var theForm = document.getElementById('triggerTransitionForm');
|
||||
function triggerTransition(formId, transitionId, msg) {
|
||||
var theForm = document.getElementById(formId);
|
||||
theForm.workflow_action.value = transitionId;
|
||||
if (!msg) {
|
||||
theForm.submit();
|
||||
}
|
||||
else { // Ask the user to confirm.
|
||||
askConfirm('form', 'triggerTransitionForm', msg, true);
|
||||
askConfirm('form', formId, msg, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -146,10 +146,10 @@
|
|||
This macro displays an object's transitions(s). It is used by macro "header" below.
|
||||
</tal:comment>
|
||||
<metal:transitions define-macro="transitions"
|
||||
tal:define="transitions contextObj/getAppyTransitions"
|
||||
tal:define="transitions targetObj/getAppyTransitions"
|
||||
tal:condition="transitions">
|
||||
<form id="triggerTransitionForm" method="post"
|
||||
tal:attributes="action python: contextObj.absolute_url() + '/do'">
|
||||
<form tal:define="formId python: 'trigger_%s' % targetObj.UID()" method="post"
|
||||
tal:attributes="id formId; action python: targetObj.absolute_url() + '/do'">
|
||||
<input type="hidden" name="action" value="Trigger"/>
|
||||
<input type="hidden" name="workflow_action"/>
|
||||
<table>
|
||||
|
@ -161,7 +161,7 @@
|
|||
<tal:comment replace="nothing">Real button</tal:comment>
|
||||
<input type="button" tal:condition="transition/may_trigger"
|
||||
tal:attributes="value transition/title;
|
||||
onClick python: 'triggerTransition(\'%s\',\'%s\')' % (transition['name'],transition['confirm']);"/>
|
||||
onClick python: 'triggerTransition(\'%s\',\'%s\',\'%s\')' % (formId,transition['name'],transition['confirm'])"/>
|
||||
<tal:comment replace="nothing">Fake button, explaining why the transition can't be triggered</tal:comment>
|
||||
<div class="fakeButton" tal:condition="not: transition/may_trigger">
|
||||
<acronym tal:content="transition/title"
|
||||
|
@ -323,7 +323,8 @@
|
|||
</tal:link>
|
||||
</td>
|
||||
<tal:comment replace="nothing">Workflow transitions</tal:comment>
|
||||
<td tal:condition="not: isEdit">
|
||||
<td tal:define="targetObj python: contextObj"
|
||||
tal:condition="python: targetObj.showTransitions(layoutType)">
|
||||
<metal:transitions use-macro="app/ui/page/macros/transitions"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
<table class="noStyle"
|
||||
tal:define="isBack appyType/isBack">
|
||||
<tr>
|
||||
<tal:comment replace="nothing">Workflow transitions</tal:comment>
|
||||
<td tal:condition="python: obj.showTransitions('result')">
|
||||
<tal:def define="targetObj python: obj">
|
||||
<metal:transitions use-macro="app/ui/page/macros/transitions"/>
|
||||
</tal:def>
|
||||
</td>
|
||||
<tal:comment replace="nothing">Edit</tal:comment>
|
||||
<td tal:condition="python: not appyType['noForm'] and obj.mayEdit() and appyType['delete']">
|
||||
<a tal:define="navInfo python:'ref.%s.%s:%s.%d.%d' % (contextObj.UID(), fieldName, appyType['pageName'], repeat['obj'].number()+startNumber, totalNumber);"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue