0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-12 03:51:16 +01:00
gitea/routers/web
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
..
admin Fix some RPM registry flaws (#28782) 2024-01-19 11:37:10 +00:00
auth Normalize oauth email username (#28561) 2024-01-03 18:48:20 -06:00
devtest
events
explore Allow to set explore page default sort (#27951) 2023-11-09 10:11:45 +00:00
feed Set the isPermaLink attribute to false in the guid sub-element (#28860) 2024-01-20 02:38:16 +00:00
healthcheck Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
misc Refactor CORS handler (#28587) 2023-12-25 20:13:18 +08:00
org Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
repo Don't do a full page load when clicking the subscribe button (#28871) 2024-01-20 20:44:51 +01:00
shared Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
user Fix some RPM registry flaws (#28782) 2024-01-19 11:37:10 +00:00
base.go
githttp.go Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
goget.go
home.go Enhanced auth token / remember me (#27606) 2023-10-14 00:56:41 +00:00
metrics.go
nodeinfo.go
swagger_json.go
web.go Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
webfinger.go