38 lines
784 B
Elixir
38 lines
784 B
Elixir
defmodule ComfycampWeb.NotesHTML do
|
||
@moduledoc """
|
||
This module contains pages rendered by NotesController.
|
||
"""
|
||
use ComfycampWeb, :html
|
||
|
||
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
|
||
end
|