Move templates to components
This commit is contained in:
parent
4fb1e200f1
commit
cd1e5887c5
12 changed files with 15 additions and 14 deletions
23
lib/nulla_web/components/templates/user/index.html.heex
Normal file
23
lib/nulla_web/components/templates/user/index.html.heex
Normal file
|
@ -0,0 +1,23 @@
|
|||
<.header>
|
||||
Listing Users
|
||||
<:actions>
|
||||
<.link href={~p"/users/new"}>
|
||||
<.button>New User</.button>
|
||||
</.link>
|
||||
</:actions>
|
||||
</.header>
|
||||
|
||||
<.table id="users" rows={@users} row_click={&JS.navigate(~p"/users/#{&1}")}>
|
||||
<:col :let={user} label="Username">{user.username}</:col>
|
||||
<:action :let={user}>
|
||||
<div class="sr-only">
|
||||
<.link navigate={~p"/users/#{user}"}>Show</.link>
|
||||
</div>
|
||||
<.link navigate={~p"/users/#{user}/edit"}>Edit</.link>
|
||||
</:action>
|
||||
<:action :let={user}>
|
||||
<.link href={~p"/users/#{user}"} method="delete" data-confirm="Are you sure?">
|
||||
Delete
|
||||
</.link>
|
||||
</:action>
|
||||
</.table>
|
Loading…
Add table
Add a link
Reference in a new issue