@@ -464,7 +464,8 @@ def actions(label='', buttons=None, name=None, help_text=None):
464464 "label":(str) button label,
465465 "value":(object) button value,
466466 "type":(str, optional) button type,
467- "disabled":(bool, optional) whether the button is disabled
467+ "disabled":(bool, optional) whether the button is disabled,
468+ "color":(str, optional) button color
468469 }
469470
470471 When ``type='reset'/'cancel'`` or ``disabled=True``, ``value`` can be omitted
@@ -485,6 +486,9 @@ def actions(label='', buttons=None, name=None, help_text=None):
485486 Note: After clicking the ``type=reset`` button, the form will not be submitted,
486487 and the ``actions()`` call will not return
487488
489+ The ``color`` of button can be one of: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `light`,
490+ `dark`.
491+
488492 :param - label, name, help_text: Those arguments have the same meaning as for `input()`
489493 :return: If the user clicks the ``type=submit`` button to submit the form,
490494 return the value of the button clicked by the user.
@@ -525,8 +529,8 @@ def actions(label='', buttons=None, name=None, help_text=None):
525529 actions('actions', [
526530 {'label': 'Save', 'value': 'save'},
527531 {'label': 'Save and add next', 'value': 'save_and_continue'},
528- {'label': 'Reset', 'type': 'reset'},
529- {'label': 'Cancel', 'type': 'cancel'},
532+ {'label': 'Reset', 'type': 'reset', 'color': 'warning' },
533+ {'label': 'Cancel', 'type': 'cancel', 'color': 'danger' },
530534 ], name='action', help_text='actions'),
531535 ])
532536 put_code('info = ' + json.dumps(info, indent=4))
0 commit comments