forgejo/templates/repo/issue/milestone
Sai Nane 1e54e211ca Fix milestone assignment in New Issue
Avoids the use of HTMX on milestone assignment within a New Issue form.

The New Issue form doesn't have an issue ID to send to a milestone change URL,
which the backend expects in order to construct a proper reply. The frontend
template was also not built to use the new HTMX response. This resulted in a
backend error and a large warning whenever anyone tried to set a milestone
from within the New Issue form (new pull requests were also affected), rather
than from a View Issue page.

This introduces a new parameter into the `issue/milestone/select_menu`
template, "NewIssuePage".

When unset, the template produces the same results as before. Selection uses
`hx-post` to notify the server immediately, using the updated htmx fragment
from the reply.

When set to a truthy value, the old style of form is used. Selection uses
`data-id` and `data-href` to update the selected milestone locally, via
`selectItem` in `repo-legacy.js`, recreating the selected element and updating
the hidden form value.

Fixes #5176.
2024-09-17 17:45:02 +02:00
..
filter_list.tmpl Make it consistent with the other sorting filters 2024-07-22 15:01:36 +02:00
select_menu.tmpl Fix milestone assignment in New Issue 2024-09-17 17:45:02 +02:00