Skip to content

Commit

Permalink
Merge pull request #25 from zacharyad/main
Browse files Browse the repository at this point in the history
Fix: Behavior in internal/templates/layout.templ by changing htmx targeting on logout button
  • Loading branch information
tomanagle committed Jun 5, 2024
2 parents b3c6f5a + 9399ec5 commit 0af29c4
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 25 deletions.
1 change: 1 addition & 0 deletions internal/handlers/gethome.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func (h *HomeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {

if !ok {
c := templates.GuestIndex()

err := templates.Layout(c, "My website").Render(r.Context(), w)

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/templates/About_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/templates/Index_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/templates/NotFound_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/templates/layout.templ
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ templ nav() {
<ol class="flex space-x-4">
if middleware.GetUser(ctx) != nil {
<li>
<button class="text-gray-200" hx-post="/logout">Logout</button>
<button class="text-gray-200" hx-target="body" hx-swap="innerHTML" hx-post="/logout">Logout</button>
</li>
} else {
<li>
Expand Down
56 changes: 38 additions & 18 deletions internal/templates/layout_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/templates/login_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/templates/register_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0af29c4

Please sign in to comment.