diff --git a/app/controllers/attendance_tracker_controller.rb b/app/controllers/attendance_tracker_controller.rb index 6dce48b..0a2c075 100644 --- a/app/controllers/attendance_tracker_controller.rb +++ b/app/controllers/attendance_tracker_controller.rb @@ -1,11 +1,6 @@ class AttendanceTrackerController < ApplicationController before_action :refresh_toggl - def index - @courses = Course.active.sort_by(&:title) - @current_lecture = get_current_lecture - end - def overview @courses = Course.active.sort_by(&:title) @current_lecture = get_current_lecture @@ -13,9 +8,9 @@ class AttendanceTrackerController < ApplicationController def today @courses = Course.active.sort_by(&:title) - @date = Date.today + @date = Date.tomorrow @current_lecture = get_current_lecture - @lectures = @courses.flat_map { |course| course.lectures.filter { |a| a.start_time.today? } }.sort_by { |l| l.start_time } + @lectures = @courses.flat_map { |course| course.lectures.filter { |a| a.start_time.to_date == @date } }.sort_by { |l| l.start_time } end def course_focus diff --git a/app/views/attendance_tracker/_course_table.erb b/app/views/attendance_tracker/_course_table.erb index a144479..732e508 100644 --- a/app/views/attendance_tracker/_course_table.erb +++ b/app/views/attendance_tracker/_course_table.erb @@ -8,7 +8,7 @@ <% course.lectures.sort_by(&:start_time).group_by(&:week_number).each do |(week_number, lectures)| %> -
| Lecture | -Date | -Status | -Action | -- |
|---|---|---|---|---|
|
-
-
-
- Week <%= week_number %>
-
-
-
- <% 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) %>
- <% if total_for_week > 0 %>
- (Total <%= humanise_duration(lectures.sum { |lecture| lecture.total_overall_time }.seconds) %>
- )
- <% end %>
-
- |
- ||||