[gen] Improvements in the rendering of buttons throughout the web UI. [gen] Ref field and Search: added param 'showActions' allowing to show or not the range of icons and buttons below or besides every tied or queried object.

This commit is contained in:
Gaetan Delannay 2015-01-19 15:44:09 +01:00
parent a905aaa139
commit 34cafcdbc1
10 changed files with 171 additions and 163 deletions

View file

@ -463,22 +463,18 @@ class Transition:
class UiTransition:
'''Represents a widget that displays a transition.'''
pxView = Px('''<x var="buttonCss = (buttonsMode == 'small') and \
'buttonSmall button' or 'button'">
pxView = Px('''
<x var="label=transition.title;
css=ztool.getButtonCss(label, buttonsMode == 'small')">
<!-- Real button -->
<input if="transition.mayTrigger" type="button" class=":buttonCss"
var2="label=transition.title"
style=":'%s; %s' % (url(transition.icon, bg=True), \
ztool.getButtonWidth(label))"
value=":label"
<input if="transition.mayTrigger" type="button" class=":css"
style=":url(transition.icon, bg=True)" value=":label"
onclick=":'triggerTransition(%s,%s,%s)' % (q(formId), \
q(transition.name), q(transition.confirm))"/>
<!-- Fake button, explaining why the transition can't be triggered -->
<input if="not transition.mayTrigger" type="button"
class=":'fake ' + buttonCss" var2="label=transition.title"
style=":'%s; %s' % (url('fake', bg=True),
ztool.getButtonWidth(label))"
class=":'fake %s' % css" style=":url('fake', bg=True)"
value=":label" title=":transition.reason"/></x>''')
def __init__(self, name, transition, obj, mayTrigger, ):