diff --git a/app/views/attendance_tracker/index.html.erb b/app/views/attendance_tracker/index.html.erb index c841344..b48eee3 100644 --- a/app/views/attendance_tracker/index.html.erb +++ b/app/views/attendance_tracker/index.html.erb @@ -29,9 +29,13 @@
+ <% total_for_week = lectures.sum { |lecture| lecture.total_overall_time }.seconds %> <%# TODO: Improve this figure, atm it is for lectures in week, not time spent in week (ie prepping for lecture next week will count in next week not current week) %> - (Total <%= humanise_duration(lectures.sum { |lecture| lecture.total_overall_time }.seconds) %>) + <% if total_for_week > 0 %> + (Total <%= humanise_duration(lectures.sum { |lecture| lecture.total_overall_time }.seconds) %> + ) + <% end %>