darkreactions / DRP

http://darkreactions.haverford.edu
57 stars 16 forks source link

Crispy Forms - Bootstrap Buttons #10

Open cpbarretthc opened 4 years ago

cpbarretthc commented 4 years ago

Hey, The buttons for "Register" and "Login" aren't rendered in Bootstrap 4, and instead use Django's default style. This is unusual because the "Contact" page's form works correctly.

Each page is rendered using Bootstrap 4 by using Crispy Form's FormHelper class, a la https://github.com/darkreactions/DRP/blob/419fe62bcbd06590b8cd5b344576f88b05b24d5b/DRP/forms/contact.py#L14 This helper class renders the button with all the other fields, instead of the previous system that added the input button as a separate tag in the template files.

Login's form uses a modified AuthenticationForm from forms.py, which is installed with Django (which I just found out doesn't push with the other edited documents, is it feasible to allow me to edit the default forms and store them elsewhere?)

Register's base form: https://github.com/darkreactions/DRP/blob/419fe62bcbd06590b8cd5b344576f88b05b24d5b/DRP/forms/authentication.py#L28

Contact.py's working button: https://github.com/darkreactions/DRP/blob/419fe62bcbd06590b8cd5b344576f88b05b24d5b/DRP/forms/contact.py#L18