Skip to content
Snippets Groups Projects
Commit b50e73ef authored by Teal's avatar Teal
Browse files

grey out past sessions instead

parent 245d5cad
No related branches found
No related tags found
No related merge requests found
......@@ -69,3 +69,6 @@ select {
@apply underline hover:text-blue-600 hover:border-blue-600;
}
}
.past {
@apply opacity-50;
}
<% now = Time.now %>
<div>
<% @assignments.future.group_by(&:user).each do |user, assignments| %>
<% @assignments.group_by(&:user).each do |user, assignments| %>
<div class="my-8">
<h4 class="text-xl my-2"><%= link_to user.name, user_assignments_path(user) %> <span class="font-normal"><%= link_to user_assignments_path(user, format: 'ics') do %><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="ml-2 mb-1 size-4 inline-block stroke-slate-400 fill-slate-400"><path fill-rule="evenodd" d="M5.75 2a.75.75 0 01.75.75V4h7V2.75a.75.75 0 011.5 0V4h.25A2.75 2.75 0 0118 6.75v8.5A2.75 2.75 0 0115.25 18H4.75A2.75 2.75 0 012 15.25v-8.5A2.75 2.75 0 014.75 4H5V2.75A.75.75 0 015.75 2zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75z" clip-rule="evenodd"></path></svg><% end %></span></h4>
<% assignments.group_by { |a| a.session.starts_at.strftime('%Y-%m-%d') }.each do |date, assignments_on_date| %>
<h5 class="text-base mt-2"><%= date %></h5>
<h5 class="text-base mt-2 <%= date < now ? "past" : "future" %>"><%= date %></h5>
<ol class="list-inside">
<% assignments_on_date.each do |assignment| %>
<li>
<li class="<%= assignment.session.starts_at < now ? "past" : "future" %>">
<%= assignment.session.starts_at.strftime('%H:%M') %> @ <%= assignment.session.stage.name %>:
<%= link_to assignment.session.title, assignment.session %>
<small><% assignment.session.assignments.map(&:user).reject{ |u| u == user }.each do |other_user| %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment