2024-07-29 16:19:47 +05:00
|
|
|
|
defmodule ComfycampWeb.NotesHTML do
|
2024-07-29 18:07:44 +05:00
|
|
|
|
@moduledoc """
|
2024-08-25 23:58:22 +05:00
|
|
|
|
This module contains pages rendered by NotesController.
|
2024-07-29 18:07:44 +05:00
|
|
|
|
"""
|
2024-07-29 16:19:47 +05:00
|
|
|
|
use ComfycampWeb, :html
|
|
|
|
|
|
2024-08-25 23:58:22 +05:00
|
|
|
|
def index(assigns) do
|
|
|
|
|
~H"""
|
|
|
|
|
<div>
|
|
|
|
|
<h1>Заметки</h1>
|
|
|
|
|
|
|
|
|
|
<%= for note <- @notes do %>
|
|
|
|
|
<div>
|
|
|
|
|
<.link href={~p"/notes/#{note}"}>
|
|
|
|
|
<h2><%= note.title %></h2>
|
|
|
|
|
</.link>
|
|
|
|
|
<%= note.inserted_at %>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
"""
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def show(assigns) do
|
|
|
|
|
~H"""
|
|
|
|
|
<div>
|
|
|
|
|
<h1><%= @note.title %></h1>
|
|
|
|
|
|
|
|
|
|
<.back navigate={~p"/notes"}>К списку заметок</.back>
|
|
|
|
|
|
|
|
|
|
<p>Создана: <%= @note.inserted_at %></p>
|
|
|
|
|
<p>Обновлена: <%= @note.updated_at %></p>
|
|
|
|
|
|
|
|
|
|
<%= raw(@note_body) %>
|
|
|
|
|
</div>
|
|
|
|
|
"""
|
|
|
|
|
end
|
2024-07-29 16:19:47 +05:00
|
|
|
|
end
|