bookmarks!

This commit is contained in:
2022-08-03 16:01:41 +02:00
parent 4bd3634abb
commit ae1dc3a216
5 changed files with 49 additions and 4 deletions

View File

@ -2,22 +2,23 @@ defmodule SomethingErlangWeb.BookmarksLive.Show do
use SomethingErlangWeb, :live_view
on_mount SomethingErlangWeb.UserLiveAuth
#alias SomethingErlang.Grover
alias SomethingErlang.Grover
require Logger
@impl true
def mount(_params, _session, socket) do
#Grover.mount(socket.assigns.current_user, id)
Grover.mount(socket.assigns.current_user)
{:ok, socket}
end
@impl true
def handle_params(%{"page" => page}, _, socket) do
#thread = Grover.get_thread!(id, page |> String.to_integer())
bookmarks = Grover.get_bookmarks!(page |> String.to_integer())
{:noreply,
socket
|> assign(:page_title, "bookmarks")}
|> assign(:page_title, "bookmarks")
|> assign(:bookmarks, bookmarks)}
end
@impl true

View File

@ -0,0 +1,16 @@
<table class="table w-full">
<thead>
<tr>
<th></th>
<th>Title</th>
</tr>
</thead>
<tbody>
<%= for thread <- @bookmarks do %>
<tr>
<th><%= raw thread.icon %></th>
<td><%= raw thread.title %></td>
</tr>
<% end %>
</tbody>
</table>