<.header> {gettext("Listing Exams")}
<:actions> <.link patch={~p"/exams/new"}> <.button class="dark:bg-sky-300 text-white dark:text-black/80 dark:hover:bg-sky-400"> {gettext("New Exam")}
{exam.subject}
{exam.date} | {case Date.diff(exam.date, Date.utc_today()) do 0 -> gettext("Today") 1 -> gettext("Tommorow") x when x > 1 -> ngettext("Tomorrow", "%{count} days left", x) x when x < 0 -> ngettext("Yesterday", "%{count} days passed", x * -1) end}
<.modal :if={@live_action in [:new, :edit]} id="exam-modal" show on_cancel={JS.patch(~p"/exams")}> <.live_component module={ExmrWeb.ExamLive.FormComponent} id={@exam.id || :new} title={@page_title} action={@live_action} exam={@exam} patch={~p"/exams"} />
<%= for weekday <- ~w(#{gettext("Sun")} #{gettext("Mon")} #{gettext("Tue")} #{gettext("Wed")} #{gettext("Thu")} #{gettext("Fri")} #{gettext("Sat")}) do %>
{weekday}
<% end %> <%= for _ <- 1..(Date.day_of_week(Date.new!(@current_month.year, @current_month.month, 1))) do %>
<% end %> <%= for day <- 1..Date.days_in_month(@current_month) do %> <% {:ok, date} = Date.new(@current_month.year, @current_month.month, day) %>
{day}
<%= if Map.has_key?(@events, date) do %>
    <%= for event <- @events[date] do %>
  • {event.subject}
  • <% end %>
<% end %>
<% end %>