Skip to content

Commit

Permalink
Merge pull request #375 from jovandeginste/templ-fixes
Browse files Browse the repository at this point in the history
Fix a few more template errors
  • Loading branch information
jovandeginste authored Jan 5, 2025
2 parents 174445a + 6cae0db commit 7312283
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 81 deletions.
2 changes: 1 addition & 1 deletion views/workouts/form.templ
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ templ Form(w *database.Workout) {
type="text"
name="distance"
id="distance"
value="{ helpers.HumanDistance(ctx, w.Distance) }"
value={ helpers.HumanDistance(ctx, w.Distance()) }
required
/>
<span>{ preferredUnits.Distance() }</span>
Expand Down
97 changes: 55 additions & 42 deletions views/workouts/form_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 views/workouts/item.templ
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ templ Item(w *database.Workout) {
</a>
</div>
<div class="text-right text-sm">
<a href="{{ RouteFor `user-show` .User.ID }}">
<a href={ templ.SafeURL(helpers.RouteFor(ctx, "user-show", w.User.ID)) }>
@helpers.IconFor("user")
{ w.User.Name }
</a>
Expand Down
29 changes: 19 additions & 10 deletions views/workouts/item_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 views/workouts/route_segments.templ
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ templ RouteSegments(segments []*database.RouteSegmentMatch) {
@helpers.IconFor("route-segment")
</td>
<td class="flex flex-wrap gap-1">
<a href="{{ RouteFor `route-segment-show` .RouteSegment.ID }}">{ s.RouteSegment.Name }</a>
<a href={ templ.SafeURL(helpers.RouteFor(ctx, "route-segment-show", s.RouteSegment.ID)) }>{ s.RouteSegment.Name }</a>
</td>
<td>
{ helpers.HumanDistance(ctx, s.Distance) } { pu.Distance() }
Expand Down
Loading

0 comments on commit 7312283

Please sign in to comment.