forked from shibao/cannery
add actions as render block in tag card
This commit is contained in:
@ -5,8 +5,8 @@ defmodule CanneryWeb.TagLive.Index do
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
import CanneryWeb.Components.TagCard
|
||||
alias Cannery.Tags
|
||||
alias Cannery.Tags.Tag
|
||||
alias Cannery.{Tags, Tags.Tag}
|
||||
alias CanneryWeb.Endpoint
|
||||
|
||||
@impl true
|
||||
def mount(_params, session, socket) do
|
||||
|
@ -22,7 +22,22 @@
|
||||
<% end %>
|
||||
<div class="flex flex-row flex-wrap">
|
||||
<%= for tag <- @tags do %>
|
||||
<.tag_card tag={tag} />
|
||||
<.tag_card tag={tag}>
|
||||
<%= live_patch to: Routes.tag_index_path(Endpoint, :edit, tag),
|
||||
class: "text-primary-500 link" do %>
|
||||
<i class="fa-fw fa-lg fas fa-edit"></i>
|
||||
<% end %>
|
||||
|
||||
<%= link to: "#",
|
||||
class: "text-primary-500 link",
|
||||
phx_click: "delete",
|
||||
phx_value_id: tag.id,
|
||||
data: [
|
||||
confirm: dgettext("prompts", "Are you sure you want to delete %{name}?", name: tag.name)
|
||||
] do %>
|
||||
<i class="fa-fw fa-lg fas fa-trash"></i>
|
||||
<% end %>
|
||||
</.tag_card>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user