[django-x509] Add a javascript switcher which hides/shows different fields depending if the user is importing a certificate/CA or creating a new one
Django-x509 mplements features of a Public Key Infrastructure as a django reusable app, it is one of the OpenWISP 2 base modules.
We need to improve the UX in the Ca
and Cert
admin, so that the difference between creating and importing CAs and Certs is clear without needing further explaination.
A CharField
named operation_type
(suggestions for better names are welcome) at the ModelForm
level should be added, this field should use a select widget having 2 options:
- (empty string, default)
- new
- import
Case 1: empty
With the default option, all the fields except the name should be hidden.
Case 2: new
When "new" is selected, all the hidden fields except certificate
and private_key
will be shown.
When you are ready, send a pull request on github and fix an issue highlighted by your mentors during the review.
Don't forget to start and fork the django-x509 repository and read the instructions in the README regarding how to install for development and the contributing guidelines