Better public create ticket form with the initialization of the datepicker for due date as a media.

Reformat code to improve readability.
Add an include to get an alert when there are errors in a form.
This commit is contained in:
bbe
2020-10-23 16:23:47 +02:00
parent ab5e07e295
commit 4ee74e6667
9 changed files with 188 additions and 164 deletions

View File

@ -137,6 +137,12 @@ class SuccessIframeView(TemplateView):
class CreateTicketView(BaseCreateTicketView):
template_name = 'helpdesk/public_create_ticket.html'
def get_form(self, form_class=None):
form = super().get_form(form_class)
# Add the CSS error class to the form in order to better see them in the page
form.error_css_class = 'text-danger'
return form
class Homepage(CreateTicketView):
template_name = 'helpdesk/public_homepage.html'