create gists
This commit is contained in:
parent
79a17290d5
commit
43a8412f06
90 changed files with 1777 additions and 2107 deletions
42
lib/zoeyscomputer_web/live/gist_live/index.html.heex
Normal file
42
lib/zoeyscomputer_web/live/gist_live/index.html.heex
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<.header>
|
||||
Listing Gists
|
||||
<:actions>
|
||||
<.link patch={~p"/gists/new"}>
|
||||
<.button>New Gist</.button>
|
||||
</.link>
|
||||
</:actions>
|
||||
</.header>
|
||||
|
||||
<.table
|
||||
id="gists"
|
||||
rows={@streams.gists}
|
||||
row_click={fn {_id, gist} -> JS.navigate(~p"/gists/#{gist}") end}
|
||||
>
|
||||
<:col :let={{_id, gist}} label="Code"><%= gist.code %></:col>
|
||||
<:col :let={{_id, gist}} label="Lang"><%= gist.lang %></:col>
|
||||
<:action :let={{_id, gist}}>
|
||||
<div class="sr-only">
|
||||
<.link navigate={~p"/gists/#{gist}"}>Show</.link>
|
||||
</div>
|
||||
<.link patch={~p"/gists/#{gist}/edit"}>Edit</.link>
|
||||
</:action>
|
||||
<:action :let={{id, gist}}>
|
||||
<.link
|
||||
phx-click={JS.push("delete", value: %{id: gist.id}) |> hide("##{id}")}
|
||||
data-confirm="Are you sure?"
|
||||
>
|
||||
Delete
|
||||
</.link>
|
||||
</:action>
|
||||
</.table>
|
||||
|
||||
<.modal :if={@live_action in [:new, :edit]} id="gist-modal" show on_cancel={JS.patch(~p"/gists")}>
|
||||
<.live_component
|
||||
module={ZoeyscomputerWeb.GistLive.FormComponent}
|
||||
id={@gist.id || :new}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
gist={@gist}
|
||||
patch={~p"/gists"}
|
||||
/>
|
||||
</.modal>
|
||||
Loading…
Add table
Add a link
Reference in a new issue