Added page chooser to settings footer links #188
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.
Hi,
In this pull request I have added the possibility to use the Page chooser to set the link destination for footer links.
Model Field:
Added a new field for the page to link to in the FooterLinks class.
Validation
I also added some extra validation to make sure either link url or a page is selected.
It also validates that if link_url is entered then link_label is required.
If a page is selected then it's optional but you can also use link_label to override the page title.
Templates
The footer tags nhsukfrontendsettings_tags.py has been adjusted to pass though the new field and updated the template file footer_link.html to work with the new field.
Tests
I have ran ./dumpdata.sh and written a test for the new feature.
If there's anything else I should do to make this useful, happy to work on it.