diff --git a/lib/exmr_web/live/exam_live/index.html.heex b/lib/exmr_web/live/exam_live/index.html.heex index 6d69e74..2c12037 100644 --- a/lib/exmr_web/live/exam_live/index.html.heex +++ b/lib/exmr_web/live/exam_live/index.html.heex @@ -27,28 +27,40 @@ {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} + 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"} /> + <.live_component + module={ExmrWeb.ExamLive.FormComponent} + id={@exam.id || :new} + title={@page_title} + action={@live_action} + exam={@exam} + patch={~p"/exams"} + />
@@ -64,35 +76,35 @@ <%= for day <- ~w(Sun Mon Tue Wed Thu Fri Sat) do %>
{day}
- <% end %> + <% end %> + + + <%= for _ <- 1..(Date.day_of_week(@current_month)) do %> +
+ <% end %> + + + <%= for day <- 1..Date.days_in_month(@current_month) do %> + <% {:ok, date} = Date.new(@current_month.year, @current_month.month, day) %> - - <%= for _ <- 1..(Date.day_of_week(@current_month)) do %> -
- <% end %> +
+
{day}
+ + - - <%= for day <- 1..Date.days_in_month(@current_month) do %> - <% {:ok, date}=Date.new(@current_month.year, @current_month.month, day) %> - -
-
{day}
- - - - <% IO.puts("Date: #{date}") %> - <% IO.inspect(Map.get(@events, date)) %> - <%= case Map.get(@events, date) do %> - <% nil -> %> - - <% events -> %> -
    - <%= for event <- events do %> -
  • {event.subject}
  • - <% end %> -
- <% end %> -
- <% end %> + <% IO.puts("Date: #{date}") %> + <% IO.inspect(Map.get(@events, date)) %> + <%= case Map.get(@events, date) do %> + <% nil -> %> + + <% events -> %> + + <% end %> +
+ <% end %>