From 3deeafd0843a18e29cf3ebe9050e0546c61faba1 Mon Sep 17 00:00:00 2001 From: Vladimir Rubin Date: Mon, 23 Dec 2024 19:02:18 +0200 Subject: [PATCH] style(calendar): make the size persistent --- lib/exmr_web/components/core_components.ex | 2 +- lib/exmr_web/live/exam_live/index.html.heex | 39 +++++++++------ priv/gettext/default.pot | 55 +++++++++++++++++---- priv/gettext/en/LC_MESSAGES/default.po | 55 +++++++++++++++++---- priv/gettext/ru/LC_MESSAGES/default.po | 50 ++++++++++++++----- 5 files changed, 154 insertions(+), 47 deletions(-) diff --git a/lib/exmr_web/components/core_components.ex b/lib/exmr_web/components/core_components.ex index 8640e92..a9fb3fc 100644 --- a/lib/exmr_web/components/core_components.ex +++ b/lib/exmr_web/components/core_components.ex @@ -436,7 +436,7 @@ defmodule ExmrWeb.CoreComponents do ~H"""
-

+

{render_slot(@inner_block)}

diff --git a/lib/exmr_web/live/exam_live/index.html.heex b/lib/exmr_web/live/exam_live/index.html.heex index 2827539..d51dfb1 100644 --- a/lib/exmr_web/live/exam_live/index.html.heex +++ b/lib/exmr_web/live/exam_live/index.html.heex @@ -1,12 +1,19 @@ <.header> {gettext("Listing Exams")}

- - | - -
@@ -22,10 +29,10 @@
-
{exam.subject}
-
+
{exam.subject}
+
{exam.date} | - + {case Date.diff(exam.date, Date.utc_today()) do 0 -> gettext("Today") 1 -> gettext("Tommorow") @@ -38,14 +45,14 @@ @@ -74,7 +81,8 @@
- <%= 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 %>
{day}
<% end %> @@ -88,15 +96,16 @@ <% {:ok, date} = Date.new(@current_month.year, @current_month.month, day) %>
-
{day}
+
{day}
- <% IO.puts("Date: #{date}") %> - <% IO.inspect(Map.get(@events, date)) %> <%= case Map.get(@events, date) do %> <% nil -> %> diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 2d64c9a..0c9d511 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -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 "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 43eca18..a3d3c74 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -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 "" diff --git a/priv/gettext/ru/LC_MESSAGES/default.po b/priv/gettext/ru/LC_MESSAGES/default.po index 0b2f75b..91b3441 100644 --- a/priv/gettext/ru/LC_MESSAGES/default.po +++ b/priv/gettext/ru/LC_MESSAGES/default.po @@ -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 \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 "Ср"