feature: hide field of science with setting #797
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the setting FIELD_OF_SCIENCE_HIDE that removes or hides references to Field of Science from all pages when True. It defaults to False, so that the default behavior of Coldfront does not change. It does not remove the field of science field from the Project model.
In many cases, references to the field of science were removed by simply adding conditional inclusion of the field on respective templates. This includes the allocations by field of science graphic on the center-summary page. Additionally, references to relevant fields in javascript are also handled.
In the cases of the ProjectSearchForm and the ProjectCreationForm (renamed ProjectUpdateForm), the django crispy-forms FormHelper object was used to dynamically include/exclude the Field of Science search field.
The ProjectUpdateView was assigned the same form_class as the ProjectCreateView so that they share fields.
Tests test inclusion or exclusion of the Field of Science depending on the setting using the @override_settings decorator.