Add button widget for forms
This widget will allow displaying HTML anchor buttons inside the forms. It uses by default the navigation instance template from the navigation app. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{% with widget.value as link %}
|
||||
{% include 'navigation/generic_link_instance.html' %}
|
||||
{% endwith %}
|
||||
@@ -9,6 +9,15 @@ from .icons import icon_fail as default_icon_fail
|
||||
from .icons import icon_ok as default_icon_ok
|
||||
|
||||
|
||||
class ButtonWidget(forms.widgets.Widget):
|
||||
template_name = 'common/forms/widgets/button_widget.html'
|
||||
|
||||
def format_value(self, value):
|
||||
if value == '' or value is None:
|
||||
return None
|
||||
return value
|
||||
|
||||
|
||||
class DisableableSelectWidget(forms.SelectMultiple):
|
||||
allow_multiple_selected = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user