gitea/templates/repo/issue
Yarden Shoham 14f6fcf448
Don't do a full page load when clicking the subscribe button (#28871)
- Refactor the form around the subscribe button into its own template
- Use htmx to perform the form submission
- `hx-boost="true"` to prevent the default form submission behavior of a
full page load
- `hx-sync="this:replace"` to replace the current request (in case the
button is clicked again before the response is returned)
  - `hx-target="this"` to replace the form tag with the new form tag
  - `hx-push-url="false"` to disable a change to the URL
  - `hx-swap="show:no-scroll"` to preserve the scroll position
- Change the backend response to return a `<form>` tag instead of a
redirect to the issue page
- Include `htmx.org` in javascript imports

This change introduces htmx with the hope we could use it to make Gitea
more reactive while keeping our "HTML rendered on the server" approach.

# Before


![before](https://github.com/go-gitea/gitea/assets/20454870/4ec3e81e-4dbf-4338-9968-b0655c276d4c)

# After


![after](https://github.com/go-gitea/gitea/assets/20454870/8c8841af-9bfe-40b2-b1cd-cd1f3c90ba4d)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-01-20 20:44:51 +01:00
..
fields Fix required checkboxes in issue forms (#27592) 2023-10-19 11:43:15 +00:00
labels Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) 2023-10-17 16:10:45 +02:00
milestone Improve the list header in milestone page (#27302) 2023-10-18 00:03:42 +00:00
view_content Don't do a full page load when clicking the subscribe button (#28871) 2024-01-20 20:44:51 +01:00
branch_selector_field.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
card.tmpl Fix links in issue card (#28806) 2024-01-15 22:38:13 +02:00
choose.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
comment_tab.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
filter_actions.tmpl Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) 2023-10-17 16:10:45 +02:00
filter_list.tmpl Improve the list header in milestone page (#27302) 2023-10-18 00:03:42 +00:00
filters.tmpl Refactor template empty checks (#28351) 2023-12-04 15:48:42 -06:00
label_precolors.tmpl Refactor some CSS styles and simplify code (#26771) 2023-08-28 22:14:51 +08:00
labels.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
list.tmpl Show total TrackedTime on issue/pull/milestone lists (#26672) 2023-10-19 14:08:31 +00:00
milestone_issues.tmpl Show total TrackedTime on issue/pull/milestone lists (#26672) 2023-10-19 14:08:31 +00:00
milestone_new.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
milestones.tmpl Improve the list header in milestone page (#27302) 2023-10-18 00:03:42 +00:00
navbar.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
new_form.tmpl [FIX] missing ctx in new_form (#27514) 2023-10-08 14:35:20 +08:00
new.tmpl Make Issue/PR/projects more compact, misc CSS tweaks (#24459) 2023-05-03 17:58:59 -04:00
openclose.tmpl Add ability to see open and closed issues at the same time (#28757) 2024-01-15 15:07:22 +00:00
search.tmpl Improve the list header in milestone page (#27302) 2023-10-18 00:03:42 +00:00
view_content.tmpl Remove "tabindex" from some form buttons (#27892) 2023-11-03 14:40:48 +00:00
view_title.tmpl Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
view.tmpl Make Issue/PR/projects more compact, misc CSS tweaks (#24459) 2023-05-03 17:58:59 -04:00