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

Use shared form partial for admin/announcements views #29608

Merged

Conversation

mjankowski
Copy link
Contributor

Both of these views had repeated markup to generate the form. Changes:

  • Pull out the common form tags to a new partial - the only difference here was the check for published? in the edit view. This is preserved in the form partial, and since published? will always be false on the new view, it works there too.
  • In both views, switch the inner form variable from f to form which lets us do a nicer shorthand render form for the partial (auto-chooses file name and assigns correct local var)
  • In both views, instead of doing the explicit path/method setup on the form, use the array/namespace option to simple_for and generate it that way. This puts the correct http method in the form as well.

@mjankowski mjankowski force-pushed the admin-announcements-form-partial branch 2 times, most recently from 638225b to 1afc027 Compare March 20, 2024 13:58
@mjankowski mjankowski force-pushed the admin-announcements-form-partial branch from 1afc027 to 7fe67d8 Compare April 12, 2024 21:23
@mjankowski mjankowski force-pushed the admin-announcements-form-partial branch from 7fe67d8 to 6d683f0 Compare April 19, 2024 13:13
@ClearlyClaire ClearlyClaire added this pull request to the merge queue Apr 19, 2024
Merged via the queue into mastodon:main with commit 4837bfc Apr 19, 2024
27 checks passed
@mjankowski mjankowski deleted the admin-announcements-form-partial branch April 19, 2024 14:24
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.

None yet

2 participants