Compare commits
9 commits
Author | SHA1 | Date | |
---|---|---|---|
9a41ca7e98 | |||
4ef23a5ec9 | |||
a724826a59 | |||
c60a5e0f12 | |||
223939da6f | |||
d5f7ddf250 | |||
f18fc0ab63 | |||
41c67fe35e | |||
ff9a3a8e92 |
8 changed files with 107 additions and 32 deletions
12
README.md
12
README.md
|
@ -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
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
2
mix.exs
2
mix.exs
|
@ -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,
|
||||
|
|
|
@ -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 ""
|
||||
|
|
|
@ -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 ""
|
||||
|
|
|
@ -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 "Зарегестрироваться"
|
||||
|
|
Loading…
Reference in a new issue