forgejo/templates/repo/issue/view_content
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
..
add_reaction.tmpl Improve and fix bugs surrounding reactions (#24760) 2023-05-28 01:34:18 +00:00
attachments.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
comments.tmpl Fix rendering assignee changed comments without assignee (#27927) 2023-11-07 19:45:06 +01:00
comments_delete_time.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
context_menu.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
pull.tmpl Add Hide/Show all checks button to commit status check (#26284) 2023-11-02 14:49:02 +00:00
pull_merge_instruction.tmpl Improve pull request command line instructions (#27778) 2023-10-25 15:01:31 +00:00
reactions.tmpl Add non-JS fallback for reaction tooltips (#28785) 2024-01-15 09:42:59 +08:00
reference_issue_dialog.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
show_role.tmpl Add member, collaborator, contributor, and first-time contributor roles and tooltips (#26658) 2023-08-24 13:06:17 +08:00
sidebar.tmpl Don't do a full page load when clicking the subscribe button (#28871) 2024-01-20 20:44:51 +01:00
update_branch_by_merge.tmpl Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
watching.tmpl Don't do a full page load when clicking the subscribe button (#28871) 2024-01-20 20:44:51 +01:00