@@ -464,7 +464,8 @@ def actions(label='', buttons=None, name=None, help_text=None):
464
464
"label":(str) button label,
465
465
"value":(object) button value,
466
466
"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
468
469
}
469
470
470
471
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):
485
486
Note: After clicking the ``type=reset`` button, the form will not be submitted,
486
487
and the ``actions()`` call will not return
487
488
489
+ The ``color`` of button can be one of: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `light`,
490
+ `dark`.
491
+
488
492
:param - label, name, help_text: Those arguments have the same meaning as for `input()`
489
493
:return: If the user clicks the ``type=submit`` button to submit the form,
490
494
return the value of the button clicked by the user.
@@ -525,8 +529,8 @@ def actions(label='', buttons=None, name=None, help_text=None):
525
529
actions('actions', [
526
530
{'label': 'Save', 'value': 'save'},
527
531
{'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' },
530
534
], name='action', help_text='actions'),
531
535
])
532
536
put_code('info = ' + json.dumps(info, indent=4))
0 commit comments