You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/templates
Yarden Shoham 1df06e3f39
Don't do a full page load when clicking the follow button (#28872)
- Use htmx to perform the button request
- `hx-headers='{"x-csrf-token": "{{.CsrfToken}}"}'` to authenticate (we
should probably learn to reuse this)
- `hx-post="{{.ContextUser.HomeLink}}?action=follow"` to send a POST
request to follow the user
- `hx-target="#profile-avatar-card"` to target the card div for
replacement
- `hx-swap="outerHTML"` to replace the card (as opposed to its inner
content) with the new card that shows the new follower count and button
color
- Change the backend response to return a `<div>` tag (the card) instead
of a redirect to the user page

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/86899d15-41c9-42ed-bd85-253b9caac7f8)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/59455d96-548c-4a81-a5b0-fab1dc1e87ef)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
1 year ago
..
admin Add support for sha256 repositories (#23894) 1 year ago
api/packages/pypi Remove incorrect HTML self close tag (#23748) 2 years ago
base Move the captcha script loader to the template which really needs it (#28718) 1 year ago
code Fix 500 error of searching commits (#28576) 1 year ago
custom Add footer extra links template (#9576) 5 years ago
devtest Improve CSS helper naming (#28769) 1 year ago
explore Add support for sha256 repositories (#23894) 1 year ago
mail Update team invitation email link (#26550) 2 years ago
org Fix button size in "attached header right" (#28770) 1 year ago
package Fix some RPM registry flaws (#28782) 1 year ago
projects Use full width for project boards (#28225) 1 year ago
repo Don't do a full page load when clicking the subscribe button (#28871) 1 year ago
shared Don't do a full page load when clicking the follow button (#28872) 1 year ago
status Clean up template locale usage (#27856) 1 year ago
swagger Add support for sha256 repositories (#23894) 1 year ago
user Rework markup link rendering (#26745) 1 year ago
webhook Extract common code to new template (#26933) 2 years ago
home.tmpl Fix more "locale" usages (#27259) 2 years ago
install.tmpl Fix more "locale" usages (#27259) 2 years ago
post-install.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 2 years ago