New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add subject and body to mailto links #10920
Conversation
Manage this branch in SquashTest this branch here: https://topdevpros5950-au4a8.squash.io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well, thank you. Thanks also for adding robust tests.
I have one line of feedback, but can add this easily in the PR when merging.
When you save an email address, then edit, then switch to a non-email field, you get the raw link in the other sections. I think this is fine but just calling this out. I see that we do this for the reverse (kind of), when a non-email link has been added.
No action needed on this, just leaving notes for future self if we want to change this behaviour one day.
wagtail/admin/forms/choosers.py
Outdated
@@ -44,6 +44,8 @@ class AnchorLinkChooserForm(forms.Form): | |||
class EmailLinkChooserForm(forms.Form): | |||
email_address = forms.EmailField(required=True) | |||
link_text = forms.CharField(required=False) | |||
subject = forms.CharField(required=False) | |||
body = forms.CharField(required=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please make this work as a multi-line field, something like...
body = forms.CharField(required=False) | |
body = forms.CharField(required=False, widget=forms.Textarea(attrs={"rows": 3})) |
Closes wagtail#5950 Rework of PR wagtail#6451
Rebased/formatted files, added the textarea widget and pushed. Will review the CI and merge in if all good. |
@lb, thank you! |
Fixes #5950. Updated code from PR #6451 which was abandoned 3 years ago. Added more comprehensive tests.