forgejo/templates
Yarden Shoham 1df06e3f39
Don't do a full page load when clicking the follow button ()
- 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](86899d15-41c9-42ed-bd85-253b9caac7f8)

# After

![after](59455d96-548c-4a81-a5b0-fab1dc1e87ef)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-01-20 23:37:22 +01:00
..
admin Add support for sha256 repositories () 2024-01-19 17:05:02 +01:00
api/packages/pypi Remove incorrect HTML self close tag () 2023-03-27 18:05:51 +02:00
base Move the captcha script loader to the template which really needs it () 2024-01-07 15:41:46 +00:00
code Fix 500 error of searching commits () 2023-12-21 23:09:14 +00:00
custom Add footer extra links template () 2020-01-03 20:41:56 +02:00
devtest Improve CSS helper naming () 2024-01-12 20:28:01 +08:00
explore Add support for sha256 repositories () 2024-01-19 17:05:02 +01:00
mail Update team invitation email link () 2023-08-31 16:26:13 +00:00
org Fix button size in "attached header right" () 2024-01-12 14:43:40 +00:00
package Fix some RPM registry flaws () 2024-01-19 11:37:10 +00:00
projects Use full width for project boards () 2023-11-27 17:43:52 +00:00
repo Don't do a full page load when clicking the subscribe button () 2024-01-20 20:44:51 +01:00
shared Don't do a full page load when clicking the follow button () 2024-01-20 23:37:22 +01:00
status Clean up template locale usage () 2023-10-31 22:11:48 +08:00
swagger Add support for sha256 repositories () 2024-01-19 17:05:02 +01:00
user Rework markup link rendering () 2024-01-15 08:49:24 +00:00
webhook Extract common code to new template () 2023-09-06 10:11:06 +00:00
home.tmpl Fix more "locale" usages () 2023-09-25 20:42:40 +08:00
install.tmpl Fix more "locale" usages () 2023-09-25 20:42:40 +08:00
post-install.tmpl Always use ctx.Locale.Tr inside templates () 2023-09-25 08:56:50 +00:00