67 lines
1.6 KiB
Plaintext
67 lines
1.6 KiB
Plaintext
<h1>Listing Notes</h1>
|
|
|
|
<%= if @live_action in [:new, :edit] do %>
|
|
<.modal return_to={Routes.note_index_path(@socket, :index)}>
|
|
<.live_component
|
|
module={MemexWeb.NoteLive.FormComponent}
|
|
id={@note.id || :new}
|
|
title={@page_title}
|
|
action={@live_action}
|
|
note={@note}
|
|
return_to={Routes.note_index_path(@socket, :index)}
|
|
/>
|
|
</.modal>
|
|
<% end %>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Title</th>
|
|
<th>Content</th>
|
|
<th>Tag</th>
|
|
<th>Visibility</th>
|
|
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="notes">
|
|
<%= for note <- @notes do %>
|
|
<tr id={"note-#{note.id}"}>
|
|
<td><%= note.title %></td>
|
|
<td><%= note.content %></td>
|
|
<td><%= note.tag %></td>
|
|
<td><%= note.visibility %></td>
|
|
|
|
<td>
|
|
<span>
|
|
<.link navigate={Routes.note_show_path(@socket, :show, note)}>
|
|
<%= dgettext("actions", "Show") %>
|
|
</.link>
|
|
</span>
|
|
<span>
|
|
<.link patch={Routes.note_index_path(@socket, :edit, note)}>
|
|
<%= dgettext("actions", "Edit") %>
|
|
</.link>
|
|
</span>
|
|
<span>
|
|
<.link
|
|
href="#"
|
|
phx-click="delete"
|
|
phx-value-id={note.id}
|
|
data-confirm={dgettext("prompts", "Are you sure?")}
|
|
>
|
|
<%= dgettext("actions", "Delete") %>
|
|
</.link>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<span>
|
|
<.link patch={Routes.note_index_path(@socket, :new)}>
|
|
<%= dgettext("actions", "New Note") %>
|
|
</.link>
|
|
</span>
|