Improve icons, add homepage links to courses
All checks were successful
Build and Publish Docker Container / build (push) Successful in 5m28s
All checks were successful
Build and Publish Docker Container / build (push) Successful in 5m28s
This commit is contained in:
parent
b2d8ee0dd9
commit
f712837f91
@ -19,6 +19,10 @@ class Lecture < ApplicationRecord
|
||||
tracked_time_entries.where(kind: [:concurrent, :catchup]).any?
|
||||
end
|
||||
|
||||
def entirely_attended_in_person?
|
||||
!(tracked_time_entries.where(kind: [:catchup]).any?)
|
||||
end
|
||||
|
||||
def reviewed?
|
||||
tracked_time_entries.where(kind: [:review]).any?
|
||||
end
|
||||
|
||||
@ -6,7 +6,17 @@
|
||||
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
|
||||
<div class="inline-block py-2 align-middle px-6 lg:px-8">
|
||||
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 rounded-lg">
|
||||
<h2 class="text-2xl p-2 px-4"><%= course.title %></h2>
|
||||
<div class="flex flex-row justify-between items-center px-4 p-2">
|
||||
<h2 class="text-2xl">
|
||||
<%= course.title %>
|
||||
</h2>
|
||||
|
||||
<% if course.homepage.present? %>
|
||||
<a class="align-middle" href="<%= course.homepage %>">
|
||||
<i class="fa fa-link text-blue-600"></i>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<table class="border-t-2 divide-y divide-gray-300 w-full">
|
||||
<thead class="bg-gray-50">
|
||||
|
||||
@ -19,8 +19,12 @@
|
||||
<i class="fa fa-hourglass-start <%= prep_icon_class %>"></i>
|
||||
|
||||
<% if lecture.attended? %>
|
||||
<i class="fa fa-chalkboard-user text-green-700"></i>
|
||||
<% elsif lecture.live? %>
|
||||
<% if lecture.entirely_attended_in_person? %>
|
||||
<i class="fa fa-chalkboard-user text-green-700"></i>
|
||||
<% else %>
|
||||
<i class="fa fa-video text-green-700"></i>
|
||||
<% end %>
|
||||
<% elsif lecture.is_live? %>
|
||||
<i class="fa fa-video text-blue-700"></i>
|
||||
<% elsif lecture.start_time.past? %>
|
||||
<i class="fa fa-times text-red-700"></i>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<% if work_item.completed? %>
|
||||
<i class="fa fa-check text-green-700"></i>
|
||||
<% elsif work_item.started? %>
|
||||
<i class="fa fa-play text-blue-700"></i>
|
||||
<i class="fa fa-pen text-blue-700"></i>
|
||||
<% else %>
|
||||
<%# Symbol to show work has not started yet %>
|
||||
<i class="fa fa-clock text-blue-gray-700"></i>
|
||||
|
||||
5
db/migrate/20231008152722_add_moodle_link_to_course.rb
Normal file
5
db/migrate/20231008152722_add_moodle_link_to_course.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class AddMoodleLinkToCourse < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :courses, :homepage, :string
|
||||
end
|
||||
end
|
||||
3
db/schema.rb
generated
3
db/schema.rb
generated
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.1].define(version: 2023_10_08_145328) do
|
||||
ActiveRecord::Schema[7.1].define(version: 2023_10_08_152722) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
@ -22,6 +22,7 @@ ActiveRecord::Schema[7.1].define(version: 2023_10_08_145328) do
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.date "semester_start_date", default: "2023-10-02"
|
||||
t.string "homepage"
|
||||
end
|
||||
|
||||
create_table "lectures", force: :cascade do |t|
|
||||
|
||||
Loading…
Reference in New Issue
Block a user