style(calendar): make the size persistent
All checks were successful
Checks / check (push) Successful in -6m13s
Build and Push Docker Image / Build and Push Image (push) Successful in -6m9s

This commit is contained in:
Vladimir Rubin 2024-12-23 19:02:18 +02:00
parent 9a41ca7e98
commit 3deeafd084
Signed by: vavakado
GPG key ID: CAB744727F36B524
5 changed files with 154 additions and 47 deletions

View file

@ -436,7 +436,7 @@ defmodule ExmrWeb.CoreComponents do
~H""" ~H"""
<header class={[@actions != [] && "flex items-center justify-between gap-6", @class]}> <header class={[@actions != [] && "flex items-center justify-between gap-6", @class]}>
<div> <div>
<h1 class="text-lg font-semibold leading-8 text-zinc-800 dark:text-zinc-200"> <h1 class="text-lg font-semibold leading-none text-zinc-800 dark:text-zinc-200">
{render_slot(@inner_block)} {render_slot(@inner_block)}
</h1> </h1>
<p :if={@subtitle != []} class="mt-2 text-sm leading-6 text-zinc-600 dark:text-zinc-100"> <p :if={@subtitle != []} class="mt-2 text-sm leading-6 text-zinc-600 dark:text-zinc-100">

View file

@ -1,12 +1,19 @@
<.header> <.header>
{gettext("Listing Exams")} {gettext("Listing Exams")}
<div> <div>
<button phx-click="sort" phx-value-by="subject" class="font-light"> <button
phx-click="sort"
phx-value-by="subject"
class="font-light text-xs md:text-sm lg:text-base"
>
{gettext("Sort by Subject")} {gettext("Sort by Subject")}
</button> </button>
<a>|</a> <a class="invisible lg:visible">|</a>
<button
<button phx-click="sort" phx-value-by="date" class="font-light"> phx-click="sort"
phx-value-by="date"
class="font-light text-xs md:text-sm lg:text-base"
>
{gettext("Sort by Date")} {gettext("Sort by Date")}
</button> </button>
</div> </div>
@ -22,10 +29,10 @@
<div class="divide-y"> <div class="divide-y">
<div :for={exam <- @exams} class="py-2 flex gap-2"> <div :for={exam <- @exams} class="py-2 flex gap-2">
<div class="grow"> <div class="grow">
<div class="font-bold">{exam.subject}</div> <div class="font-bold text-xs md:text-sm lg:text-base">{exam.subject}</div>
<div class="font-sm"> <div class="text-xs md:text-sm lg:text-base">
{exam.date} | {exam.date} |
<b> <b class="text-xs md:text-sm lg:text-base">
{case Date.diff(exam.date, Date.utc_today()) do {case Date.diff(exam.date, Date.utc_today()) do
0 -> gettext("Today") 0 -> gettext("Today")
1 -> gettext("Tommorow") 1 -> gettext("Tommorow")
@ -38,14 +45,14 @@
<button <button
phx-click="edit" phx-click="edit"
phx-value-id={exam.id} phx-value-id={exam.id}
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-3 rounded-md" class="bg-blue-500 hover:bg-blue-700 text-white font-bold p-1 text-xs md:text-sm lg:py-2 lg:px-3 rounded-md"
> >
{gettext("Edit")} {gettext("Edit")}
</button> </button>
<button <button
phx-click="remove" phx-click="remove"
phx-value-id={exam.id} phx-value-id={exam.id}
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-3 rounded-md" class="bg-red-500 hover:bg-red-700 text-white font-bold p-1 text-xs md:text-sm lg:py-2 lg:px-3 rounded-md"
> >
{gettext("Remove")} {gettext("Remove")}
</button> </button>
@ -74,7 +81,8 @@
<!-- Calendar --> <!-- Calendar -->
<div class="grid grid-cols-7 gap-1"> <div class="grid grid-cols-7 gap-1">
<!-- Weekdays --> <!-- Weekdays -->
<%= for day <- ~w(Sun Mon Tue Wed Thu Fri Sat) do %> <%= for day <- ~w(#{gettext("Sun")} #{gettext("Mon")} #{gettext("Tue")} #{gettext("Wed")} #{gettext("Thu")}
#{gettext("Fri")} #{gettext("Sat")}) do %>
<div class="font-bold text-center">{day}</div> <div class="font-bold text-center">{day}</div>
<% end %> <% end %>
@ -88,15 +96,16 @@
<% {:ok, date} = Date.new(@current_month.year, @current_month.month, day) %> <% {:ok, date} = Date.new(@current_month.year, @current_month.month, day) %>
<div class={[ <div class={[
"border rounded p-3 dark:border-zinc-400", "border rounded p-0.5 md:p-2 lg:p-3 w-full h-12 md:h-20 hover:scale-125 transition-transform ease-in-out duration-100",
@current_month == date && "bg-zinc-200 dark:bg-zinc-800" @current_month == date &&
"bg-zinc-200 dark:bg-zinc-800 border-green-500 dark:border-green-300",
@current_month != date &&
"bg-white dark:bg-zinc-950 dark:border-zinc-400 "
]}> ]}>
<div class="text-sm font-bold">{day}</div> <div class="text-xs md:text-sm lg:text-base font-bold">{day}</div>
<!-- Render events for the current day --> <!-- Render events for the current day -->
<% IO.puts("Date: #{date}") %>
<% IO.inspect(Map.get(@events, date)) %>
<%= case Map.get(@events, date) do %> <%= case Map.get(@events, date) do %>
<% nil -> %> <% nil -> %>
<!-- No events for this day --> <!-- No events for this day -->

View file

@ -31,7 +31,7 @@ msgstr ""
msgid "Built using Phoenix LiveView, Ecto, and TailwindCSS by @vavakado" msgid "Built using Phoenix LiveView, Ecto, and TailwindCSS by @vavakado"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:43 #: lib/exmr_web/live/exam_live/index.html.heex:50
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
@ -51,13 +51,13 @@ msgstr ""
msgid "Hang in there while we get back on track" msgid "Hang in there while we get back on track"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.ex:32 #: lib/exmr_web/live/exam_live/index.ex:34
#: lib/exmr_web/live/exam_live/index.html.heex:16 #: lib/exmr_web/live/exam_live/index.html.heex:23
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "New Exam" msgid "New Exam"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:50 #: lib/exmr_web/live/exam_live/index.html.heex:57
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Remove" msgid "Remove"
msgstr "" msgstr ""
@ -67,12 +67,12 @@ msgstr ""
msgid "Something went wrong!" msgid "Something went wrong!"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:10 #: lib/exmr_web/live/exam_live/index.html.heex:17
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Sort by Date" msgid "Sort by Date"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:5 #: lib/exmr_web/live/exam_live/index.html.heex:9
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Sort by Subject" msgid "Sort by Subject"
msgstr "" msgstr ""
@ -82,12 +82,12 @@ msgstr ""
msgid "Success!" msgid "Success!"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:30 #: lib/exmr_web/live/exam_live/index.html.heex:37
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Today" msgid "Today"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:32 #: lib/exmr_web/live/exam_live/index.html.heex:39
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Tomorrow" msgid "Tomorrow"
msgid_plural "%{count} days left" msgid_plural "%{count} days left"
@ -212,14 +212,14 @@ msgstr ""
msgid "Saving..." msgid "Saving..."
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:33 #: lib/exmr_web/live/exam_live/index.html.heex:40
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Yesterday" msgid "Yesterday"
msgid_plural "%{count} days passed" msgid_plural "%{count} days passed"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: lib/exmr_web/live/exam_live/index.html.heex:31 #: lib/exmr_web/live/exam_live/index.html.heex:38
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Tommorow" msgid "Tommorow"
msgstr "" msgstr ""
@ -233,3 +233,38 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Register" msgid "Register"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:85
#, elixir-autogen, elixir-format
msgid "Fri"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Mon"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:85
#, elixir-autogen, elixir-format
msgid "Sat"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Sun"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Thu"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Tue"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Wed"
msgstr ""

View file

@ -31,7 +31,7 @@ msgstr ""
msgid "Built using Phoenix LiveView, Ecto, and TailwindCSS by @vavakado" msgid "Built using Phoenix LiveView, Ecto, and TailwindCSS by @vavakado"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:43 #: lib/exmr_web/live/exam_live/index.html.heex:50
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
@ -51,13 +51,13 @@ msgstr ""
msgid "Hang in there while we get back on track" msgid "Hang in there while we get back on track"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.ex:32 #: lib/exmr_web/live/exam_live/index.ex:34
#: lib/exmr_web/live/exam_live/index.html.heex:16 #: lib/exmr_web/live/exam_live/index.html.heex:23
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "New Exam" msgid "New Exam"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:50 #: lib/exmr_web/live/exam_live/index.html.heex:57
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Remove" msgid "Remove"
msgstr "" msgstr ""
@ -67,12 +67,12 @@ msgstr ""
msgid "Something went wrong!" msgid "Something went wrong!"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:10 #: lib/exmr_web/live/exam_live/index.html.heex:17
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Sort by Date" msgid "Sort by Date"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:5 #: lib/exmr_web/live/exam_live/index.html.heex:9
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Sort by Subject" msgid "Sort by Subject"
msgstr "" msgstr ""
@ -82,12 +82,12 @@ msgstr ""
msgid "Success!" msgid "Success!"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:30 #: lib/exmr_web/live/exam_live/index.html.heex:37
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Today" msgid "Today"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:32 #: lib/exmr_web/live/exam_live/index.html.heex:39
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Tomorrow" msgid "Tomorrow"
msgid_plural "%{count} days left" msgid_plural "%{count} days left"
@ -212,14 +212,14 @@ msgstr ""
msgid "Saving..." msgid "Saving..."
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:33 #: lib/exmr_web/live/exam_live/index.html.heex:40
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Yesterday" msgid "Yesterday"
msgid_plural "%{count} days passed" msgid_plural "%{count} days passed"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: lib/exmr_web/live/exam_live/index.html.heex:31 #: lib/exmr_web/live/exam_live/index.html.heex:38
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Tommorow" msgid "Tommorow"
msgstr "" msgstr ""
@ -233,3 +233,38 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Register" msgid "Register"
msgstr "" msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:85
#, elixir-autogen, elixir-format
msgid "Fri"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Mon"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:85
#, elixir-autogen, elixir-format
msgid "Sat"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Sun"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Thu"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Tue"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:84
#, elixir-autogen, elixir-format
msgid "Wed"
msgstr ""

View file

@ -13,7 +13,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: unnamed project\n" "Project-Id-Version: unnamed project\n"
"POT-Creation-Date: \n" "POT-Creation-Date: \n"
"PO-Revision-Date: 2024-12-14 00:27+0200\n" "PO-Revision-Date: 2024-12-23 19:01+0200\n"
"Last-Translator: Vladimir Rubin <vavakado@proton.me>\n" "Last-Translator: Vladimir Rubin <vavakado@proton.me>\n"
"Language-Team: Russian\n" "Language-Team: Russian\n"
"Language: ru\n" "Language: ru\n"
@ -42,7 +42,7 @@ msgstr ""
"Создано с использованием Phoenix LiveView, Ecto и TailwindCSS в исполнении " "Создано с использованием Phoenix LiveView, Ecto и TailwindCSS в исполнении "
"@vavakado" "@vavakado"
#: lib/exmr_web/live/exam_live/index.html.heex:43 #: lib/exmr_web/live/exam_live/index.html.heex:50
msgid "Edit" msgid "Edit"
msgstr "Изменить" msgstr "Изменить"
@ -58,12 +58,12 @@ msgstr "Экзамены"
msgid "Hang in there while we get back on track" msgid "Hang in there while we get back on track"
msgstr "Держитесь, пока мы не вернемся в строй" msgstr "Держитесь, пока мы не вернемся в строй"
#: lib/exmr_web/live/exam_live/index.ex:32 #: lib/exmr_web/live/exam_live/index.ex:34
#: lib/exmr_web/live/exam_live/index.html.heex:16 #: lib/exmr_web/live/exam_live/index.html.heex:23
msgid "New Exam" msgid "New Exam"
msgstr "Новый экзамен" msgstr "Новый экзамен"
#: lib/exmr_web/live/exam_live/index.html.heex:50 #: lib/exmr_web/live/exam_live/index.html.heex:57
msgid "Remove" msgid "Remove"
msgstr "Удалить" msgstr "Удалить"
@ -71,11 +71,11 @@ msgstr "Удалить"
msgid "Something went wrong!" msgid "Something went wrong!"
msgstr "Что-то пошло не так!" msgstr "Что-то пошло не так!"
#: lib/exmr_web/live/exam_live/index.html.heex:10 #: lib/exmr_web/live/exam_live/index.html.heex:17
msgid "Sort by Date" msgid "Sort by Date"
msgstr "Сортировать по дате" msgstr "Сортировать по дате"
#: lib/exmr_web/live/exam_live/index.html.heex:5 #: lib/exmr_web/live/exam_live/index.html.heex:9
msgid "Sort by Subject" msgid "Sort by Subject"
msgstr "Сортировать по предмету" msgstr "Сортировать по предмету"
@ -83,11 +83,11 @@ msgstr "Сортировать по предмету"
msgid "Success!" msgid "Success!"
msgstr "Успех!" msgstr "Успех!"
#: lib/exmr_web/live/exam_live/index.html.heex:30 #: lib/exmr_web/live/exam_live/index.html.heex:37
msgid "Today" msgid "Today"
msgstr "Сегодня" msgstr "Сегодня"
#: lib/exmr_web/live/exam_live/index.html.heex:32 #: lib/exmr_web/live/exam_live/index.html.heex:39
msgid "Tomorrow" msgid "Tomorrow"
msgid_plural "%{count} days left" msgid_plural "%{count} days left"
msgstr[0] "%{count} день остался" msgstr[0] "%{count} день остался"
@ -194,14 +194,14 @@ msgstr "Сохранить экзамен"
msgid "Saving..." msgid "Saving..."
msgstr "Сохранение..." msgstr "Сохранение..."
#: lib/exmr_web/live/exam_live/index.html.heex:33 #: lib/exmr_web/live/exam_live/index.html.heex:40
msgid "Yesterday" msgid "Yesterday"
msgid_plural "%{count} days passed" msgid_plural "%{count} days passed"
msgstr[0] "%{count} день прошёл" msgstr[0] "%{count} день прошёл"
msgstr[1] "%{count} дня прошло" msgstr[1] "%{count} дня прошло"
msgstr[2] "%{count} дней прошло" msgstr[2] "%{count} дней прошло"
#: lib/exmr_web/live/exam_live/index.html.heex:31 #: lib/exmr_web/live/exam_live/index.html.heex:38
msgid "Tommorow" msgid "Tommorow"
msgstr "Завтра" msgstr "Завтра"
@ -212,3 +212,31 @@ msgstr "Зайти в аккаунт"
#: lib/exmr_web/components/layouts/root.html.heex:51 #: lib/exmr_web/components/layouts/root.html.heex:51
msgid "Register" msgid "Register"
msgstr "Зарегестрироваться" msgstr "Зарегестрироваться"
#: lib/exmr_web/live/exam_live/index.html.heex:85
msgid "Fri"
msgstr "Пт"
#: lib/exmr_web/live/exam_live/index.html.heex:84
msgid "Mon"
msgstr "Пн"
#: lib/exmr_web/live/exam_live/index.html.heex:85
msgid "Sat"
msgstr "Сб"
#: lib/exmr_web/live/exam_live/index.html.heex:84
msgid "Sun"
msgstr "Вс"
#: lib/exmr_web/live/exam_live/index.html.heex:84
msgid "Thu"
msgstr "Чт"
#: lib/exmr_web/live/exam_live/index.html.heex:84
msgid "Tue"
msgstr "Вт"
#: lib/exmr_web/live/exam_live/index.html.heex:84
msgid "Wed"
msgstr "Ср"