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"""
<header class={[@actions != [] && "flex items-center justify-between gap-6", @class]}>
<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)}
</h1>
<p :if={@subtitle != []} class="mt-2 text-sm leading-6 text-zinc-600 dark:text-zinc-100">

View file

@ -1,12 +1,19 @@
<.header>
{gettext("Listing Exams")}
<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")}
</button>
<a>|</a>
<button phx-click="sort" phx-value-by="date" class="font-light">
<a class="invisible lg:visible">|</a>
<button
phx-click="sort"
phx-value-by="date"
class="font-light text-xs md:text-sm lg:text-base"
>
{gettext("Sort by Date")}
</button>
</div>
@ -22,10 +29,10 @@
<div class="divide-y">
<div :for={exam <- @exams} class="py-2 flex gap-2">
<div class="grow">
<div class="font-bold">{exam.subject}</div>
<div class="font-sm">
<div class="font-bold text-xs md:text-sm lg:text-base">{exam.subject}</div>
<div class="text-xs md:text-sm lg:text-base">
{exam.date} |
<b>
<b class="text-xs md:text-sm lg:text-base">
{case Date.diff(exam.date, Date.utc_today()) do
0 -> gettext("Today")
1 -> gettext("Tommorow")
@ -38,14 +45,14 @@
<button
phx-click="edit"
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")}
</button>
<button
phx-click="remove"
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")}
</button>
@ -74,7 +81,8 @@
<!-- Calendar -->
<div class="grid grid-cols-7 gap-1">
<!-- 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>
<% end %>
@ -88,15 +96,16 @@
<% {:ok, date} = Date.new(@current_month.year, @current_month.month, day) %>
<div class={[
"border rounded p-3 dark:border-zinc-400",
@current_month == date && "bg-zinc-200 dark:bg-zinc-800"
"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 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 -->
<% IO.puts("Date: #{date}") %>
<% IO.inspect(Map.get(@events, date)) %>
<%= case Map.get(@events, date) do %>
<% nil -> %>
<!-- No events for this day -->

View file

@ -31,7 +31,7 @@ msgstr ""
msgid "Built using Phoenix LiveView, Ecto, and TailwindCSS by @vavakado"
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
msgid "Edit"
msgstr ""
@ -51,13 +51,13 @@ msgstr ""
msgid "Hang in there while we get back on track"
msgstr ""
#: lib/exmr_web/live/exam_live/index.ex:32
#: lib/exmr_web/live/exam_live/index.html.heex:16
#: lib/exmr_web/live/exam_live/index.ex:34
#: lib/exmr_web/live/exam_live/index.html.heex:23
#, elixir-autogen, elixir-format
msgid "New Exam"
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
msgid "Remove"
msgstr ""
@ -67,12 +67,12 @@ msgstr ""
msgid "Something went wrong!"
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
msgid "Sort by Date"
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
msgid "Sort by Subject"
msgstr ""
@ -82,12 +82,12 @@ msgstr ""
msgid "Success!"
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
msgid "Today"
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
msgid "Tomorrow"
msgid_plural "%{count} days left"
@ -212,14 +212,14 @@ msgstr ""
msgid "Saving..."
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
msgid "Yesterday"
msgid_plural "%{count} days passed"
msgstr[0] ""
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
msgid "Tommorow"
msgstr ""
@ -233,3 +233,38 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Register"
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"
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
msgid "Edit"
msgstr ""
@ -51,13 +51,13 @@ msgstr ""
msgid "Hang in there while we get back on track"
msgstr ""
#: lib/exmr_web/live/exam_live/index.ex:32
#: lib/exmr_web/live/exam_live/index.html.heex:16
#: lib/exmr_web/live/exam_live/index.ex:34
#: lib/exmr_web/live/exam_live/index.html.heex:23
#, elixir-autogen, elixir-format
msgid "New Exam"
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
msgid "Remove"
msgstr ""
@ -67,12 +67,12 @@ msgstr ""
msgid "Something went wrong!"
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
msgid "Sort by Date"
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
msgid "Sort by Subject"
msgstr ""
@ -82,12 +82,12 @@ msgstr ""
msgid "Success!"
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
msgid "Today"
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
msgid "Tomorrow"
msgid_plural "%{count} days left"
@ -212,14 +212,14 @@ msgstr ""
msgid "Saving..."
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
msgid "Yesterday"
msgid_plural "%{count} days passed"
msgstr[0] ""
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
msgid "Tommorow"
msgstr ""
@ -233,3 +233,38 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Register"
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 ""
"Project-Id-Version: unnamed project\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"
"Language-Team: Russian\n"
"Language: ru\n"
@ -42,7 +42,7 @@ msgstr ""
"Создано с использованием Phoenix LiveView, Ecto и TailwindCSS в исполнении "
"@vavakado"
#: lib/exmr_web/live/exam_live/index.html.heex:43
#: lib/exmr_web/live/exam_live/index.html.heex:50
msgid "Edit"
msgstr "Изменить"
@ -58,12 +58,12 @@ msgstr "Экзамены"
msgid "Hang in there while we get back on track"
msgstr "Держитесь, пока мы не вернемся в строй"
#: lib/exmr_web/live/exam_live/index.ex:32
#: lib/exmr_web/live/exam_live/index.html.heex:16
#: lib/exmr_web/live/exam_live/index.ex:34
#: lib/exmr_web/live/exam_live/index.html.heex:23
msgid "New Exam"
msgstr "Новый экзамен"
#: lib/exmr_web/live/exam_live/index.html.heex:50
#: lib/exmr_web/live/exam_live/index.html.heex:57
msgid "Remove"
msgstr "Удалить"
@ -71,11 +71,11 @@ msgstr "Удалить"
msgid "Something went wrong!"
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"
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"
msgstr "Сортировать по предмету"
@ -83,11 +83,11 @@ msgstr "Сортировать по предмету"
msgid "Success!"
msgstr "Успех!"
#: lib/exmr_web/live/exam_live/index.html.heex:30
#: lib/exmr_web/live/exam_live/index.html.heex:37
msgid "Today"
msgstr "Сегодня"
#: lib/exmr_web/live/exam_live/index.html.heex:32
#: lib/exmr_web/live/exam_live/index.html.heex:39
msgid "Tomorrow"
msgid_plural "%{count} days left"
msgstr[0] "%{count} день остался"
@ -194,14 +194,14 @@ msgstr "Сохранить экзамен"
msgid "Saving..."
msgstr "Сохранение..."
#: lib/exmr_web/live/exam_live/index.html.heex:33
#: lib/exmr_web/live/exam_live/index.html.heex:40
msgid "Yesterday"
msgid_plural "%{count} days passed"
msgstr[0] "%{count} день прошёл"
msgstr[1] "%{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"
msgstr "Завтра"
@ -212,3 +212,31 @@ msgstr "Зайти в аккаунт"
#: lib/exmr_web/components/layouts/root.html.heex:51
msgid "Register"
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 "Ср"