Skip to content

Commit

Permalink
Merge pull request #82 from jovandeginste/remove-toplevel-data-per-km
Browse files Browse the repository at this point in the history
Remove redundant workout statistics from workouts handlers and templates
  • Loading branch information
jovandeginste authored Apr 11, 2024
2 parents 2c63542 + 36c419b commit e2391da
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions pkg/app/workouts_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ func (a *App) workoutsShowHandler(c echo.Context) error {
}

data["workout"] = w
data["workoutStatisticsPerKM"] = w.StatisticsPerKilometer()
data["workoutStatisticsPerMin"] = w.StatisticsPerMinute()

return c.Render(http.StatusOK, "workouts_show.html", data)
}
Expand Down Expand Up @@ -128,8 +126,6 @@ func (a *App) workoutsEditHandler(c echo.Context) error {
}

data["workout"] = workout
data["workoutStatisticsPerKM"] = workout.StatisticsPerKilometer()
data["workoutStatisticsPerMin"] = workout.StatisticsPerMinute()

return c.Render(http.StatusOK, "workouts_edit.html", data)
}
2 changes: 1 addition & 1 deletion views/workouts/workouts_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h2 class="{{ IconFor .Type.String }}">
</div>
<div class="basis-1/4">
<div class="inner-form">
{{ template "workout_breakdown" $.workoutStatisticsPerKM }}
{{ template "workout_breakdown" .StatisticsPerKilometer }}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/workouts/workouts_show.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h2 class="{{ IconFor .Type.String }}">
</div>
<div class="basis-1/4">
<div class="inner-form">
{{ template "workout_breakdown" $.workoutStatisticsPerKM }}
{{ template "workout_breakdown" .StatisticsPerKilometer }}
</div>
</div>
</div>
Expand Down

0 comments on commit e2391da

Please sign in to comment.