Compare commits

...

9 commits
v0.1.4 ... main

Author SHA1 Message Date
9a41ca7e98
style: mix format
All checks were successful
Checks / check (push) Successful in -6m22s
Build and Push Docker Image / Build and Push Image (push) Successful in -6m16s
2024-12-23 00:13:58 +02:00
4ef23a5ec9
fix: dark mode for calendar
Some checks failed
Build and Push Docker Image / Build and Push Image (push) Waiting to run
Checks / check (push) Has been cancelled
2024-12-23 00:13:29 +02:00
a724826a59
style: mix format 2024-12-23 00:10:10 +02:00
c60a5e0f12
fix: wrong day of the week
Some checks failed
Checks / check (push) Failing after -6m21s
Build and Push Docker Image / Build and Push Image (push) Successful in -6m4s
2024-12-22 22:53:56 +02:00
223939da6f
feat: calendar view
Some checks failed
Checks / check (push) Failing after -6m20s
Build and Push Docker Image / Build and Push Image (push) Has been cancelled
2024-12-22 22:52:30 +02:00
d5f7ddf250
chore: update README
All checks were successful
Checks / check (push) Successful in -5m35s
Build and Push Docker Image / Build and Push Image (push) Successful in -6m50s
2024-12-22 22:18:23 +02:00
f18fc0ab63
chore: bump to 0.2.0
All checks were successful
Checks / check (push) Successful in -4m26s
Build and Push Docker Image / Build and Push Image (push) Successful in -3m52s
i finally remembered that with each feat commit you're supposed to bump
the minor, not the patch. so i bumped to 0.2.0
2024-12-14 00:35:26 +02:00
41c67fe35e
style: remove "Phoenix Framework" from tab title 2024-12-14 00:34:04 +02:00
ff9a3a8e92
trans: Translate Register and Log in
kinda forgot about those
2024-12-14 00:33:01 +02:00
8 changed files with 107 additions and 32 deletions

View file

@ -9,12 +9,8 @@ To start your Phoenix server:
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
## TODO
## Learn more
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix
- [ ] Add tests
- [ ] Add a proper readme
- [ ] Add a calendar view

View file

@ -4,8 +4,8 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="csrf-token" content={get_csrf_token()} />
<.live_title suffix=" · Phoenix Framework">
{assigns[:page_title] || "Exmr"}
<.live_title>
{assigns[:page_title] || "ExMR"}
</.live_title>
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
<script>
@ -48,7 +48,7 @@
href={~p"/users/register"}
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700 dark:text-zinc-300 dark:hover:text-zinc-100"
>
Register
{gettext("Register")}
</.link>
</li>
<li>
@ -56,7 +56,7 @@
href={~p"/users/log_in"}
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700 dark:text-zinc-300 dark:hover:text-zinc-100"
>
Log in
{gettext("Log in")}
</.link>
</li>
<% end %>

View file

@ -12,6 +12,8 @@ defmodule ExmrWeb.ExamLive.Index do
|> assign(:sort_by, "date")
|> assign(:live_action, :index)
|> assign(exam: %{})
|> assign(events: Enum.group_by(Exams.list_exams(), & &1.date))
|> assign(current_month: Date.utc_today())
{:ok, socket}
end

View file

@ -62,3 +62,52 @@
patch={~p"/exams"}
/>
</.modal>
<div>
<!-- Navigation -->
<!-- <div class="flex justify-between mb-4"> -->
<!-- <button phx-click="previous_month" class="px-2 py-1 bg-blue-200">Previous</button> -->
<!-- <h2>{@current_month |> Date.to_string() |> String.replace("-", " ")}</h2> -->
<!-- <button phx-click="next_month" class="px-2 py-1 bg-blue-200">Next</button> -->
<!-- </div> -->
<!-- Calendar -->
<div class="grid grid-cols-7 gap-1">
<!-- Weekdays -->
<%= for day <- ~w(Sun Mon Tue Wed Thu Fri Sat) do %>
<div class="font-bold text-center">{day}</div>
<% end %>
<!-- Empty spaces for previous month -->
<%= for _ <- 1..(Date.day_of_week(@current_month)) do %>
<div></div>
<% end %>
<!-- Days of the month -->
<%= for day <- 1..Date.days_in_month(@current_month) do %>
<% {: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"
]}>
<div class="text-sm 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 -->
<% events -> %>
<ul class="mt-2 text-xs">
<%= for event <- events do %>
<li>{event.subject}</li>
<% end %>
</ul>
<% end %>
</div>
<% end %>
</div>
</div>

View file

@ -4,7 +4,7 @@ defmodule Exmr.MixProject do
def project do
[
app: :exmr,
version: "0.1.4",
version: "0.2.0",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,

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:44
#: lib/exmr_web/live/exam_live/index.html.heex:43
#, elixir-autogen, elixir-format
msgid "Edit"
msgstr ""
@ -57,7 +57,7 @@ msgstr ""
msgid "New Exam"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:51
#: lib/exmr_web/live/exam_live/index.html.heex:50
#, elixir-autogen, elixir-format
msgid "Remove"
msgstr ""
@ -82,12 +82,12 @@ msgstr ""
msgid "Success!"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:31
#: lib/exmr_web/live/exam_live/index.html.heex:30
#, elixir-autogen, elixir-format
msgid "Today"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:33
#: lib/exmr_web/live/exam_live/index.html.heex:32
#, elixir-autogen, elixir-format
msgid "Tomorrow"
msgid_plural "%{count} days left"
@ -212,14 +212,24 @@ msgstr ""
msgid "Saving..."
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:34
#: lib/exmr_web/live/exam_live/index.html.heex:33
#, elixir-autogen, elixir-format
msgid "Yesterday"
msgid_plural "%{count} days passed"
msgstr[0] ""
msgstr[1] ""
#: lib/exmr_web/live/exam_live/index.html.heex:32
#: lib/exmr_web/live/exam_live/index.html.heex:31
#, elixir-autogen, elixir-format
msgid "Tommorow"
msgstr ""
#: lib/exmr_web/components/layouts/root.html.heex:59
#, elixir-autogen, elixir-format
msgid "Log in"
msgstr ""
#: lib/exmr_web/components/layouts/root.html.heex:51
#, elixir-autogen, elixir-format
msgid "Register"
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:44
#: lib/exmr_web/live/exam_live/index.html.heex:43
#, elixir-autogen, elixir-format
msgid "Edit"
msgstr ""
@ -57,7 +57,7 @@ msgstr ""
msgid "New Exam"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:51
#: lib/exmr_web/live/exam_live/index.html.heex:50
#, elixir-autogen, elixir-format
msgid "Remove"
msgstr ""
@ -82,12 +82,12 @@ msgstr ""
msgid "Success!"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:31
#: lib/exmr_web/live/exam_live/index.html.heex:30
#, elixir-autogen, elixir-format
msgid "Today"
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:33
#: lib/exmr_web/live/exam_live/index.html.heex:32
#, elixir-autogen, elixir-format
msgid "Tomorrow"
msgid_plural "%{count} days left"
@ -212,14 +212,24 @@ msgstr ""
msgid "Saving..."
msgstr ""
#: lib/exmr_web/live/exam_live/index.html.heex:34
#: lib/exmr_web/live/exam_live/index.html.heex:33
#, elixir-autogen, elixir-format
msgid "Yesterday"
msgid_plural "%{count} days passed"
msgstr[0] ""
msgstr[1] ""
#: lib/exmr_web/live/exam_live/index.html.heex:32
#: lib/exmr_web/live/exam_live/index.html.heex:31
#, elixir-autogen, elixir-format, fuzzy
msgid "Tommorow"
msgstr ""
#: lib/exmr_web/components/layouts/root.html.heex:59
#, elixir-autogen, elixir-format
msgid "Log in"
msgstr ""
#: lib/exmr_web/components/layouts/root.html.heex:51
#, elixir-autogen, elixir-format
msgid "Register"
msgstr ""

View file

@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: unnamed project\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2024-12-12 18:19+0200\n"
"PO-Revision-Date: 2024-12-14 00:27+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:44
#: lib/exmr_web/live/exam_live/index.html.heex:43
msgid "Edit"
msgstr "Изменить"
@ -63,7 +63,7 @@ msgstr "Держитесь, пока мы не вернемся в строй"
msgid "New Exam"
msgstr "Новый экзамен"
#: lib/exmr_web/live/exam_live/index.html.heex:51
#: lib/exmr_web/live/exam_live/index.html.heex:50
msgid "Remove"
msgstr "Удалить"
@ -83,11 +83,11 @@ msgstr "Сортировать по предмету"
msgid "Success!"
msgstr "Успех!"
#: lib/exmr_web/live/exam_live/index.html.heex:31
#: lib/exmr_web/live/exam_live/index.html.heex:30
msgid "Today"
msgstr "Сегодня"
#: lib/exmr_web/live/exam_live/index.html.heex:33
#: lib/exmr_web/live/exam_live/index.html.heex:32
msgid "Tomorrow"
msgid_plural "%{count} days left"
msgstr[0] "%{count} день остался"
@ -194,13 +194,21 @@ msgstr "Сохранить экзамен"
msgid "Saving..."
msgstr "Сохранение..."
#: lib/exmr_web/live/exam_live/index.html.heex:34
#: lib/exmr_web/live/exam_live/index.html.heex:33
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:32
#: lib/exmr_web/live/exam_live/index.html.heex:31
msgid "Tommorow"
msgstr "Завтра"
#: lib/exmr_web/components/layouts/root.html.heex:59
msgid "Log in"
msgstr "Зайти в аккаунт"
#: lib/exmr_web/components/layouts/root.html.heex:51
msgid "Register"
msgstr "Зарегестрироваться"