Skip to content
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

Move the custom html from the form template to a widget #745

Merged
merged 3 commits into from
May 27, 2024

Conversation

ale-rt
Copy link
Member

@ale-rt ale-rt commented May 24, 2024

The reason is that we want to be able to customize that form without rewriting the whole template.

@ale-rt
Copy link
Member Author

ale-rt commented May 24, 2024

Copy link
Contributor

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work, and is in line with your earlier PRs from this week.

One small inline suggestion, but I am not sure it is needed. I added a breakpoint there, but it did not get triggered in my test.

@adapter(Interface)
class SurveySourceSelectionAdaptedContext:
def __init__(self, context):
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it would be useful to save the context so it remains available:

Suggested change
pass
self.context = context

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code before was not storing this kind of information as well.
I agree, it might be interesting to store it.
But, in that case, the most natural thing becomes moving the fields either to a behavior or to the existing content type schema.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case, if you feel this should be added feel free to add open an issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the point where I added the breakpoint and nothing happened. So the __init__ does not seem to get called. Maybe I tried on the wrong url.

@ale-rt
Copy link
Member Author

ale-rt commented May 27, 2024

One small inline suggestion, but I am not sure it is needed. I added a breakpoint there, but it did not get triggered in my test.

Where did you put the breakpoint?

@ale-rt ale-rt merged commit 36c0c34 into main May 27, 2024
2 checks passed
@ale-rt ale-rt deleted the better-z3c-form-support branch May 27, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants