diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js index 19d1d91..f13bc87 100644 --- a/app/javascript/controllers/index.js +++ b/app/javascript/controllers/index.js @@ -6,7 +6,7 @@ import { application } from "controllers/application" import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" eagerLoadControllersFrom("controllers", application) -import { Popover } from "tailwindcss-stimulus-components" +import Popover from 'stimulus-popover' application.register('popover', Popover) // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) diff --git a/app/models/attendance.rb b/app/models/attendance.rb index b822bc7..c7647af 100644 --- a/app/models/attendance.rb +++ b/app/models/attendance.rb @@ -5,4 +5,9 @@ class Attendance < ApplicationRecord :concurrent, :catchup ] + + def duration + toggl_data['time_entries'].sum { |entry| entry['seconds'] } + .seconds + end end diff --git a/app/views/attendance_tracker/index.html.erb b/app/views/attendance_tracker/index.html.erb index 48f3b6a..82bc029 100644 --- a/app/views/attendance_tracker/index.html.erb +++ b/app/views/attendance_tracker/index.html.erb @@ -58,8 +58,8 @@ <% else %> - -
+ +
<% if lecture.attendance.nil? %> <% elsif lecture.attendance.kind == 'concurrent' %> @@ -69,6 +69,14 @@ <% else %> <% lecture.attendance.kind %> <% end %> + + <% if lecture.attendance.present? %> + + <% end %>
diff --git a/config/importmap.rb b/config/importmap.rb index 9519791..d0c9a86 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -5,4 +5,4 @@ pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true pin_all_from "app/javascript/controllers", under: "controllers" -pin "tailwindcss-stimulus-components", to: "https://ga.jspm.io/npm:tailwindcss-stimulus-components@4.0.4/dist/tailwindcss-stimulus-components.module.js" +pin "stimulus-popover", to: "https://ga.jspm.io/npm:stimulus-popover@6.2.0/dist/stimulus-popover.mjs"