39 lines
1.1 KiB
Elixir
39 lines
1.1 KiB
Elixir
defmodule EzcontainerRailwayWeb.ContainerCreateLive do
|
|
alias Phoenix.Component
|
|
use Phoenix.LiveView
|
|
|
|
def render(assigns) do
|
|
~H"""
|
|
<%= live_flash(@flash, :error) %>
|
|
<%= live_flash(@flash, :info) %>
|
|
<dialog open class="modal">
|
|
<article class="modal-box">
|
|
<.form
|
|
for={@form}
|
|
method="post"
|
|
action="/container"
|
|
>
|
|
<label class="label">
|
|
<span class="label-text">Container Name</span>
|
|
<span class="label-text-alt mr-20">Tag</span>
|
|
</label>
|
|
|
|
<div class="grid grid-rows-1 grid-cols-4 gap-4">
|
|
<input class="input input-bordered inline col-span-3" name="container_name" />
|
|
<input class="input input-bordered inline" name="container_tag" />
|
|
</div>
|
|
<div class="text-center mt-6">
|
|
<button class="btn">Test</button>
|
|
</div>
|
|
</.form>
|
|
</article>
|
|
</dialog>
|
|
"""
|
|
end
|
|
|
|
def mount(_params, _session, socket) do
|
|
form = Component.to_form(%{"container_name" => "", "contianer_tag" => ""})
|
|
|
|
{:ok, socket |> assign(:form, form)}
|
|
end
|
|
end
|