#26 Annual conservation reports

* enhances TimespanReportForm control rendering
* adds/updates translations
This commit is contained in:
2021-10-20 13:41:32 +02:00
parent c45198e825
commit 6b152616dd
6 changed files with 47 additions and 41 deletions

View File

@@ -37,12 +37,14 @@ class BaseForm(forms.Form):
"""
template = None
action_url = None
action_btn_label = _("Save")
form_title = None
cancel_redirect = None
form_caption = None
instance = None # The data holding model object
form_attrs = {} # Holds additional attributes, that can be used in the template
has_required_fields = False # Automatically set. Triggers hint rendering in templates
show_cancel_btn = True
def __init__(self, *args, **kwargs):
self.instance = kwargs.pop("instance", None)
@@ -189,6 +191,7 @@ class BaseModalForm(BaseForm, BSModalForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.action_btn_label = _("Continue")
def process_request(self, request: HttpRequest, msg_success: str = _("Object removed"), msg_error: str = FORM_INVALID, redirect_url: str = None):
""" Generic processing of request