diff --git a/fields/action.py b/fields/action.py index ecdf479..c1db238 100644 --- a/fields/action.py +++ b/fields/action.py @@ -28,20 +28,20 @@ class Action(Field): # PX for viewing the Action button. pxView = pxCell = Px('''
+ value=":label" + style=":'%s; %s' % (url('action', bg=True), buttonWidth)"/>
''') # It is not possible to edit an action, not to search it. diff --git a/fields/ref.py b/fields/ref.py index 9d877b5..bb46894 100644 --- a/fields/ref.py +++ b/fields/ref.py @@ -56,23 +56,26 @@ class Ref(Field): # objects (delete many, unlink many,...) pxGlobalActions = Px(''' - + style=":'%s; %s' % (url('linkMany', bg=True), \ + ztool.getButtonWidth(label))"/> + style=":'%s; %s' % (url(imgName, bg=True), \ + ztool.getButtonWidth(label))"/> + style=":'%s; %s' % (url('deleteMany', bg=True), \ + ztool.getButtonWidth(label))"/> ''') # This PX displays icons for triggering actions on a given referenced object @@ -152,9 +155,10 @@ class Ref(Field): '%d,%s' % (startNumber, q('CreateWithoutForm'))); noFormCall=not field.addConfirm and noFormCall or \ 'askConfirm(%s, %s, %s)' % (q('script'), q(noFormCall), \ - q(addConfirmMsg))" - style=":url('buttonAdd', bg=True)" value=":_('add_ref')" - onclick=":field.noForm and noFormCall or formCall"/>''') + q(addConfirmMsg)); + label=_('add_ref')" + style=":'%s; %s' % (url('add', bg=True), ztool.getButtonWidth(label))" + value=":label" onclick=":field.noForm and noFormCall or formCall"/>''') # This PX displays, in a cell header from a ref table, icons for sorting the # ref field according to the field that corresponds to this column. @@ -215,7 +219,9 @@ class Ref(Field): :field.pxAdd @@ -235,7 +241,7 @@ class Ref(Field): + align=":column.align" var2="refField=column.field"> :_(refField.labelId) :field.pxSortIcons - + ''') def __init__(self, name, transition, obj, mayTrigger, ): diff --git a/gen/layout.py b/gen/layout.py index 140b625..b3d3874 100644 --- a/gen/layout.py +++ b/gen/layout.py @@ -211,15 +211,10 @@ class Table: # Some base layouts to use, for fields and pages ------------------------------- # The default layouts for pages. defaultPageLayouts = { - 'view': Table('w|-b|', align="center"), - 'edit': Table('w|-b|', width=None)} + 'view': Table('w-b'), 'edit': Table('w-b', width=None)} # A layout for pages, containing the page summary. -summaryPageLayouts = {'view': Table('s-w|-b|', align="center"), - 'edit': Table('w|-b|', width=None)} -widePageLayouts = { - 'view': Table('w|-b|', align="center"), - 'edit': Table('w|-b|') -} +summaryPageLayouts = {'view': Table('s-w-b'), 'edit': Table('w-b', width=None)} +widePageLayouts = {'view': Table('w-b'), 'edit': Table('w-b')} centeredPageLayouts = { 'view': Table('w|-b|', align="center"), 'edit': Table('w|-b|', width=None, align='center') diff --git a/gen/mixins/ToolMixin.py b/gen/mixins/ToolMixin.py index a8a960d..aef6be8 100644 --- a/gen/mixins/ToolMixin.py +++ b/gen/mixins/ToolMixin.py @@ -1352,4 +1352,15 @@ class ToolMixin(BaseMixin): "s.parentNode.insertBefore(ga, s);\n" \ "})();\n" % gaId return code + + def getButtonWidth(self, label): + '''Determine button width, in pixels, corresponding to the button + p_label.''' + l = len(label) + if l < 10: + width = '130px' + else: + # Consider 1 char = 6 pixels wide. + width = '%dpx' % (130 + ((l-10)*4)) + return 'width:%s' % width # ------------------------------------------------------------------------------ diff --git a/gen/mixins/__init__.py b/gen/mixins/__init__.py index 3dd8e2d..90d2aec 100644 --- a/gen/mixins/__init__.py +++ b/gen/mixins/__init__.py @@ -855,7 +855,7 @@ class BaseMixin: can't trigger, but for which he needs to know for what reason he can't trigger it; * if p_includeNotShowable is True, it includes transitions for which - show=False. Indeed, because "showability" is only a GUI concern, + show=False. Indeed, because "showability" is only a UI concern, and not a security concern, in some cases it has sense to set includeNotShowable=True, because those transitions are triggerable from a security point of view. diff --git a/gen/ui/action.png b/gen/ui/action.png new file mode 100644 index 0000000..e8f3107 Binary files /dev/null and b/gen/ui/action.png differ diff --git a/gen/ui/add.png b/gen/ui/add.png new file mode 100644 index 0000000..580ef51 Binary files /dev/null and b/gen/ui/add.png differ diff --git a/gen/ui/appy.css b/gen/ui/appy.css index 9659ca9..7cdd033 100644 --- a/gen/ui/appy.css +++ b/gen/ui/appy.css @@ -66,9 +66,11 @@ img { border: 0; vertical-align: middle } background-color: #dbdde1; font-weight: bold } .navigate td { padding: 4px 9px } .login { margin: 3px; color: black } -input.button { border-width: 0 !important; color: #666666; height: 24px; - width: 150px; cursor:pointer; font-size: 90%; padding: 1px 0 0 10px; - background-color: transparent !important } +input.button { color: #666666; height: 20px; width: 130px; + cursor:pointer; font-size: 90%; padding-left: 10px; + background-color: white; background-repeat: no-repeat; + background-position: 5% 25%; box-shadow: 2px 2px 2px #888888} +.fakeButton { background-color: #e6e6e6 !important ; cursor:help !important } .buttons { margin-left: 4px } .message { position: absolute; top: -40px; left: 50%; font-size: 90%; width: 600px; border: 1px #F0C36D solid; padding: 6px; diff --git a/gen/ui/buttonAction.png b/gen/ui/buttonAction.png deleted file mode 100644 index 298d49d..0000000 Binary files a/gen/ui/buttonAction.png and /dev/null differ diff --git a/gen/ui/buttonAdd.png b/gen/ui/buttonAdd.png deleted file mode 100644 index b0a08be..0000000 Binary files a/gen/ui/buttonAdd.png and /dev/null differ diff --git a/gen/ui/buttonCancel.png b/gen/ui/buttonCancel.png deleted file mode 100644 index ebd145c..0000000 Binary files a/gen/ui/buttonCancel.png and /dev/null differ diff --git a/gen/ui/buttonEdit.png b/gen/ui/buttonEdit.png deleted file mode 100644 index d0b94f2..0000000 Binary files a/gen/ui/buttonEdit.png and /dev/null differ diff --git a/gen/ui/buttonFake.png b/gen/ui/buttonFake.png deleted file mode 100644 index bb31c6a..0000000 Binary files a/gen/ui/buttonFake.png and /dev/null differ diff --git a/gen/ui/buttonNext.png b/gen/ui/buttonNext.png deleted file mode 100644 index 714433a..0000000 Binary files a/gen/ui/buttonNext.png and /dev/null differ diff --git a/gen/ui/buttonPrevious.png b/gen/ui/buttonPrevious.png deleted file mode 100644 index c55618a..0000000 Binary files a/gen/ui/buttonPrevious.png and /dev/null differ diff --git a/gen/ui/buttonSave.png b/gen/ui/buttonSave.png deleted file mode 100644 index 9896c2e..0000000 Binary files a/gen/ui/buttonSave.png and /dev/null differ diff --git a/gen/ui/buttonSearch.png b/gen/ui/buttonSearch.png deleted file mode 100644 index 12f4fb8..0000000 Binary files a/gen/ui/buttonSearch.png and /dev/null differ diff --git a/gen/ui/buttonTransition.png b/gen/ui/buttonTransition.png deleted file mode 100644 index 966e394..0000000 Binary files a/gen/ui/buttonTransition.png and /dev/null differ diff --git a/gen/ui/cancel.png b/gen/ui/cancel.png index cb7ffc7..57357b8 100644 Binary files a/gen/ui/cancel.png and b/gen/ui/cancel.png differ diff --git a/gen/ui/deleteMany.png b/gen/ui/deleteMany.png index 6d23f2d..1c01cd7 100644 Binary files a/gen/ui/deleteMany.png and b/gen/ui/deleteMany.png differ diff --git a/gen/ui/fake.png b/gen/ui/fake.png new file mode 100644 index 0000000..594c200 Binary files /dev/null and b/gen/ui/fake.png differ diff --git a/gen/ui/linkMany.png b/gen/ui/linkMany.png index 8b2b1c0..1082de7 100644 Binary files a/gen/ui/linkMany.png and b/gen/ui/linkMany.png differ diff --git a/gen/ui/next.png b/gen/ui/next.png new file mode 100644 index 0000000..d2c3c2c Binary files /dev/null and b/gen/ui/next.png differ diff --git a/gen/ui/previous.png b/gen/ui/previous.png new file mode 100644 index 0000000..f547183 Binary files /dev/null and b/gen/ui/previous.png differ diff --git a/gen/ui/save.png b/gen/ui/save.png new file mode 100644 index 0000000..d20f1c5 Binary files /dev/null and b/gen/ui/save.png differ diff --git a/gen/ui/search.gif b/gen/ui/search.gif deleted file mode 100644 index c08147e..0000000 Binary files a/gen/ui/search.gif and /dev/null differ diff --git a/gen/ui/transition.png b/gen/ui/transition.png new file mode 100644 index 0000000..6614062 Binary files /dev/null and b/gen/ui/transition.png differ diff --git a/gen/ui/unlinkMany.png b/gen/ui/unlinkMany.png index 07c4ad9..cc809b2 100644 Binary files a/gen/ui/unlinkMany.png and b/gen/ui/unlinkMany.png differ diff --git a/gen/ui/unlinkManyUp.png b/gen/ui/unlinkManyUp.png index 1bdc8b3..7252c23 100644 Binary files a/gen/ui/unlinkManyUp.png and b/gen/ui/unlinkManyUp.png differ diff --git a/gen/wrappers/ToolWrapper.py b/gen/wrappers/ToolWrapper.py index 7be81cf..1cb057a 100644 --- a/gen/wrappers/ToolWrapper.py +++ b/gen/wrappers/ToolWrapper.py @@ -192,7 +192,9 @@ class ToolWrapper(AbstractWrapper): @@ -209,7 +211,7 @@ class ToolWrapper(AbstractWrapper): - @@ -521,8 +523,10 @@ class ToolWrapper(AbstractWrapper):


- +

''', template=AbstractWrapper.pxTemplate, hook='content') diff --git a/gen/wrappers/__init__.py b/gen/wrappers/__init__.py index 7427c73..a8b1889 100644 --- a/gen/wrappers/__init__.py +++ b/gen/wrappers/__init__.py @@ -370,7 +370,7 @@ class AbstractWrapper(object): - +
- -
@@ -448,31 +448,36 @@ class AbstractWrapper(object): pageInfo=phaseObj.pagesInfo[page]">
+ - + style=":'%s; %s' % (url('previous', bg=True), buttonWidth)"/> - + var="label=_('object_save')" value=":label" + style=":'%s; %s' % (url('save', bg=True), \ + ztool.getButtonWidth(label))" /> + var="label=_('object_cancel')" value=":label" + style=":'%s; %s' % (url('cancel', bg=True), \ + ztool.getButtonWidth(label))"/> @@ -496,20 +503,23 @@ class AbstractWrapper(object): + onclick=":'onUnlockPage(%s,%s)' % (q(zobj.id), q(page))"/> + + style=":'%s; %s' % (url('next', bg=True), buttonWidth)" + value=":label"/> -