Skip to content

TODO: overhaul forms #383

@tlambert03

Description

@tlambert03

Complete List of User-Facing Forms on FPbase

  1. Contact Form

    • URL: /contact/
    • Main view: fpbase/views.py:ContactView (lines 19-32)
    • Form class: fpbase/forms.py:ContactForm (lines 9-38)
    • Template: fpbase/templates/pages/contact.html
    • JavaScript: Google reCAPTCHA v3 integration
    • Frontend JS: None specific
  2. User Signup Form

    • URL: /accounts/signup/ (django-allauth)
    • Main view: allauth's SignupView (customized)
    • Form class: fpbase/forms.py:CustomSignupForm (lines 41-55)
    • Template: allauth templates
    • JavaScript: Optional reCAPTCHA
    • Frontend JS: None specific
  3. User Profile Update Form

    • URL: /users/~update/
    • Main view: fpbase/users/views.py:UserUpdateView (lines 20-32)
    • Form class: Auto-generated (UpdateView with fields=['name'])
    • Template: fpbase/templates/users/user_form.html
    • JavaScript: None
    • Frontend JS: None
  4. Protein Submit Form

    • URL: /submit/
    • Main view: proteins/views/protein.py:ProteinCreateView (lines 243-274)
    • Form classes: proteins/forms/forms.py:ProteinForm (lines 99-286), StateFormSet (line 354)
    • Template: proteins/templates/proteins/protein_form.html
    • JavaScript: django-autocomplete-light, crispy-forms, jquery.formset.js
    • Frontend JS: frontend/src/js/jquery.formset.js, frontend/src/js/project.js:99-106 (file input handling)
  5. Protein Update Form

    • URL: /protein//update/
    • Main view: proteins/views/protein.py:ProteinUpdateView (lines 277-356)
    • Supporting AJAX: proteins/views/ajax.py:add_protein_reference (lines 20-52), add_protein_excerpt (lines 55-90),
      update_transitions (lines 93-119)
    • Form classes: proteins/forms/forms.py:ProteinForm (lines 99-286), StateFormSet (line 354), StateTransitionFormSet
      (line 391)
    • Template: proteins/templates/proteins/protein_form.html, proteins/templates/proteins/forms/_transition_form.html
    • JavaScript: django-autocomplete-light, crispy-forms, jquery.formset.js
    • Frontend JS: frontend/src/js/jquery.formset.js
  6. Protein Bleach Measurements Form

    • URL: /protein//bleach/
    • Main view: proteins/views/protein.py:protein_bleach_formsets (lines 359-398) (AJAX)
    • Form class: BleachMeasurementFormSet (modelformset_factory, line 361)
    • Template: proteins/templates/proteins/protein_bleach_form.html
    • JavaScript: jquery.formset.js
    • Frontend JS: frontend/src/js/jquery.formset.js
  7. Bleach Comparison Form

    • URL: /bleach_comparison/ and /bleach_comparison//
    • Main view: proteins/views/protein.py:bleach_comparison (lines 401-457)
    • Form classes: proteins/forms/forms.py:BleachComparisonForm (lines 555-578), bleach_items_formset (lines 601-604)
    • Template: proteins/templates/proteins/bleach_comparison_form.html
    • JavaScript: jquery.formset.js, autocomplete
    • Frontend JS: frontend/src/js/jquery.formset.js
  8. Spectrum Submit Form

    • URL: /spectra/submit/ and /spectra/submit//
    • Main view: proteins/views/spectra.py:SpectrumCreateView (lines 167-231)
    • Supporting AJAX: proteins/views/ajax.py:validate_spectrumownername (lines 202-211), spectrum_preview (lines
      214-240), pending_spectrum_action (lines 243-268)
    • Form class: proteins/forms/spectrum.py:SpectrumForm (lines 21-124)
    • Template: proteins/templates/proteins/spectrum_form.html
    • JavaScript: File upload handling, spectrum preview
    • Frontend JS: frontend/src/js/project.js:99-106 (file input), AJAX calls for validation/preview
  9. Collection Create Form

    • URL: /collection/create/
    • Main view: proteins/views/collection.py:CollectionCreateView (lines 118-133)
    • Supporting AJAX: proteins/views/ajax.py:add_to_collection (lines 271-303), remove_from_collection (lines 306-338)
    • Form class: proteins/forms/forms.py:CollectionForm (lines 454-485)
    • Template: proteins/templates/proteins/proteincollection_form.html
    • JavaScript: django-autocomplete-light
    • Frontend JS: AJAX calls for adding/removing proteins
  10. Collection Update Form

    • URL: /collection//update/
    • Main view: proteins/views/collection.py:CollectionUpdateView (lines 136-161)
    • Supporting AJAX: Same as Collection Create
    • Form class: proteins/forms/forms.py:CollectionForm (lines 454-485)
    • Template: proteins/templates/proteins/proteincollection_form.html
    • JavaScript: django-autocomplete-light
    • Frontend JS: AJAX calls for adding/removing proteins
  11. Microscope Create Form

    • URL: /microscope/create/
    • Main view: proteins/views/microscope.py:MicroscopeCreateView (lines 104-117)
    • Form class: proteins/forms/microscope.py:MicroscopeForm (lines 120-268), OpticalConfigFormSet (line 271)
    • Template: proteins/templates/proteins/microscope_form.html, proteins/templates/proteins/forms/_oc_inline.html
    • JavaScript: jquery.formset.js, custom microscope parsing
    • Frontend JS: frontend/src/microscope-form.js, frontend/src/js/jquery.formset.js
  12. Microscope Update Form

    • URL: /microscope//update/
    • Main view: proteins/views/microscope.py:MicroscopeUpdateView (lines 120-134)
    • Form class: proteins/forms/microscope.py:MicroscopeForm (lines 120-268), OpticalConfigFormSet (line 271)
    • Template: proteins/templates/proteins/microscope_form.html, proteins/templates/proteins/forms/_oc_inline.html
    • JavaScript: jquery.formset.js, custom microscope parsing
    • Frontend JS: frontend/src/microscope-form.js, frontend/src/js/jquery.formset.js
  13. Reference Add Form (Admin/Staff)

    • URL: /reference/autocomplete/
    • Main view: references/views.py:ReferenceAutocomplete (lines 20-32)
    • Supporting AJAX: references/views.py:add_excerpt (lines 35-73)
    • Form class: references/forms.py:ReferenceForm (lines 28-64)
    • Template: django-autocomplete-light templates
    • JavaScript: django-autocomplete-light
    • Frontend JS: DAL autocomplete JS
  14. Author Form (Admin/Staff)

    • URL: Embedded in admin or reference forms
    • Main view: Django admin or custom reference views
    • Form class: references/forms.py:AuthorForm (lines 14-25)
    • Template: Admin templates
    • JavaScript: None specific
    • Frontend JS: None

Additional AJAX-Only Operations (not traditional forms but POST endpoints):

  • /ajax/add_taxonomy/ - proteins/views/ajax.py:122-142
  • /ajax/admin_approve_protein// - proteins/views/ajax.py:145-163
  • /ajax/validate_proteinname/ - proteins/views/ajax.py:166-199
  • /ajax/flag_object/ - proteins/views/ajax.py:341-371
  • /ajax/comparison/ - proteins/views/ajax.py:374-391
  • /ajax/lineage// - proteins/views/ajax.py:394-426

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions