Further simplify form generation #264
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha#264
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the newtext refactor, we changed form generation to use
hypha_substitute, passing a list of variables. These variables are typically class constants with field names, or translations with labels and titles. For example in text:PlanBCode/hypha@be51f688ed/system/datatypes/text.php (L90-L104)In article, this list of variable will be even longer.
We can probably clean this up a lot by making two changes:
FIELD_*static variables in an array or inner class, so we can pass all of them tohypha_substitutein one go (rather than selecting just the ones needed). In the HTML string, you can then use e.g.[[FIELD_NAME_PAGE_NAME]]directly.hypha_substituteto recognize translations directly, using some special syntax. Perhaps something like[[__title]]or something to mimic__(...)syntax. It is probably good to keep the[[]], so that this the single special syntax inside these strings.Maybe also a syntax for creating infoboxes?