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

new looks

parent 12d915dd
No related branches found
No related tags found
No related merge requests found
......@@ -72,3 +72,9 @@ select {
.past {
@apply opacity-50 hover:opacity-100;
}
.field {
@apply my-2;
label {
@apply block;
}
}
......@@ -13,4 +13,10 @@ class ConferencesController < ApplicationController
end
@users = User.all
end
def edit
end
def update
end
end
<div>
<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>
<table class="border *:border">
<thead>
<tr class="*:font-bold *:border">
<th>Date</th>
<th>Starts</th>
<th>Ends</th>
<th>Stage</th>
<th>Session</th>
<th>Collaborators</th>
<h1 class="text-xl my-4">
Assignments for
<%= link_to @user.name, user_assignments_path(@user) %>
<span class="text-base ml-2 mb-2 inline p-2 border bg-slate-50 hover:bg-slate-100 border-slate-200 hover:border-slate-200 shadow font-normal rounded-md"><%= link_to user_assignments_path(@user, format: 'ics') do %><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 24" fill="currentColor" aria-hidden="true" class="size-6 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> iCal<% end %></span>
</h1>
<% now = Time.now %>
<div>
<h2 class="text-lg my-4">List View</h2>
<% @user.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 < now ? "past" : "future" %>"><%= date %></h5>
<ol class="list-inside">
<% assignments_on_date.each do |assignment| %>
<li class="<%= assignment.session.starts_at < now ? "past" : "future" %>">
<span class="tabular-nums"><%= assignment.session.starts_at.strftime('%H:%M') %> &ndash; <%= assignment.session.ends_at.strftime('%H:%M') %></span>:
<%= link_to assignment.session.title, assignment.session %> @ <%= assignment.session.stage.name %>
<small><% assignment.session.assignments.map(&:user).each do |other_user| %>
<%= render partial: 'application/user_avatar', locals: { user: other_user } %>
<% end %></small>
</li>
<% end %>
</ol>
<% end %>
</div>
<div>
<h2 class="text-lg my-4">Table View</h2>
<table class="border *:border">
<thead>
<tr class="*:font-bold *:border">
<th>Date</th>
<th>Starts</th>
<th>Ends</th>
<th>Stage</th>
<th>Session</th>
<th>Collaborators</th>
</tr>
</thead>
<tbody>
<% @user.assignments.includes(:session, session: :conference).order('sessions.starts_at').each do |assignment| %>
<tr class="*:border *:p-1 <%= assignment.session.starts_at < Time.now ? "past" : "future" %>">
<td><%= assignment.session.starts_at.strftime('%Y-%m-%d') %></td>
<td><%= assignment.session.starts_at.strftime('%H:%M') %></td>
<td><%= assignment.session.ends_at.strftime('%H:%M') %></td>
<td><%= assignment.session.stage.name %></td>
<td><%= link_to assignment.session.title, assignment.session.url, target: "_top" %></td>
<td><% assignment.session.assignments.map(&:user).each do |other_user| %><%= render partial: 'application/user_avatar', locals: { user: other_user } %><% end %></td>
</tr>
</thead>
<tbody>
<% @user.assignments.includes(:session, session: :conference).order('sessions.starts_at').each do |assignment| %>
<tr class="*:border *:p-1 <%= assignment.session.starts_at < Time.now ? "past" : "future" %>">
<td><%= assignment.session.starts_at.strftime('%Y-%m-%d') %></td>
<td><%= assignment.session.starts_at.strftime('%H:%M') %></td>
<td><%= assignment.session.ends_at.strftime('%H:%M') %></td>
<td><%= assignment.session.stage.name %></td>
<td><%= link_to assignment.session.title, assignment.session.url, target: "_top" %></td>
<td><% assignment.session.assignments.map(&:user).each do |other_user| %><%= render partial: 'application/user_avatar', locals: { user: other_user } %><% end %></td>
</tr>
<% end %>
</table>
<% end %>
</table>
</div>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment