can't resist
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 lines
2.2 KiB

<div class="grid grid-cols-5 gap-4">
<%= live_component @socket, TomieWeb.BookmarkLive.SidebarComponent %>
<div class="col-span-4">
<nav>
<ul>
<li><%= live_redirect to: Routes.link_path(@socket, :redirect, @bookmark, Slugger.slugify(@bookmark.source)), target: "_blank" do %>
<span class="icon">
<%= IconView.icon(:link) %>
</span>
<span>Visit</span>
<% end %></li>
<li><%= live_redirect to: Routes.live_path(@socket, BookmarkLive.Edit, @bookmark) do %>
<span class="icon">
<%= IconView.icon(:edit) %>
</span>
<span>Edit</span>
<% end %></li>
<li><%= link to: "#", phx_click: "toggle_favorite", phx_value_id: @bookmark.id do %>
<span class="icon">
<%= IconView.icon(:heart) %>
</span>
<span><%= favorite_action(@bookmark) %></span>
<% end %></li>
<li><%= link to: "#", phx_click: "toggle_archived", phx_value_id: @bookmark.id do %>
<span class="icon">
<%= IconView.icon(:box) %>
</span>
<span><%= archive_action(@bookmark) %></span>
<% end %></li>
<li><%= link to: "#", phx_click: "delete_bookmark", phx_value_id: @bookmark.id, data: [confirm: "Are you sure?"] do %>
<span class="icon">
<%= IconView.icon(:close_outline) %>
</span>
<span>Delete</span>
<% end %></li>
</ul>
</nav>
<article class="card">
<div class="content">
<h1>
<%= if @bookmark.is_favorite do %>
<span class="icon text-secondary"><%= IconView.icon(:heart) %></span>
<% end %>
<%= @bookmark.title || @bookmark.source %>
</h1>
<div class="markdown">
<%= raw(@bookmark.content_html) %>
</div>
<div class="meta">
<span><%= Timex.from_now(@bookmark.inserted_at) %></span>
<%= for tag <- @bookmark.tags do %>
<span class="tag">
<%= live_patch tag.name, to: Routes.live_path(@socket, TomieWeb.TagLive.Show, tag.id) %>
</span>
<% end %>
</div>
</div>
</article>
</div>
</div>