mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Remove unused helper methods
This commit is contained in:
parent
042696caeb
commit
f4687a101c
2 changed files with 1 additions and 19 deletions
|
|
@ -99,24 +99,6 @@ module ApplicationHelper
|
|||
current_user&.theme == 'light' ? 'light' : 'dark'
|
||||
end
|
||||
|
||||
def sidebar_distance(distance_meters)
|
||||
return unless distance_meters
|
||||
|
||||
# Convert from stored meters to user's preferred unit for display
|
||||
user_unit = current_user.safe_settings.distance_unit
|
||||
converted_distance = Stat.convert_distance(distance_meters, user_unit)
|
||||
"#{converted_distance.round(2)} #{user_unit}"
|
||||
end
|
||||
|
||||
def sidebar_points(points)
|
||||
return unless points
|
||||
|
||||
points_number = points.size
|
||||
points_pluralized = pluralize(points_number, 'point')
|
||||
|
||||
"(#{points_pluralized})"
|
||||
end
|
||||
|
||||
def active_class?(link_path)
|
||||
'btn-active' if current_page?(link_path)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="stats stats-vertical lg:stats-horizontal shadow w-full bg-base-200">
|
||||
<div class="stat text-center">
|
||||
<div class="stat-value text-primary">
|
||||
<%= number_with_delimiter(current_user.total_distance) %> <%= current_user.safe_settings.distance_unit %>
|
||||
<%= number_with_delimiter(current_user.total_distance.round) %> <%= current_user.safe_settings.distance_unit %>
|
||||
</div>
|
||||
<div class="stat-title">Total distance</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue