|
|
|
@ -134,21 +134,29 @@ end
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="small-12 medium-4 cell">
|
|
|
|
|
<div class="grid-x small-up-4">
|
|
|
|
|
<div class="cell">
|
|
|
|
|
<%= link "edit", to: Routes.thing_path(@conn, :edit, @thing),
|
|
|
|
|
class: "button primary expanded" %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cell">
|
|
|
|
|
<%= link "insert", to: Routes.thing_path(@conn, :insert, @thing),
|
|
|
|
|
class: "button secondary expanded" %>
|
|
|
|
|
</div>
|
|
|
|
|
<%= if @thing.container do %>
|
|
|
|
|
<div class="cell">
|
|
|
|
|
<%= link "next_to", to: Routes.thing_path(@conn, :insert, @thing.container),
|
|
|
|
|
class: "button expanded" %>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cell">
|
|
|
|
|
<%= link "move", to: Routes.thing_path(@conn, :move, @thing),
|
|
|
|
|
class: "button success expanded" %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<iframe src="https://www.youtube.com/embed/VFZNvj-HfBU" frameborder="0" allow="picture-in-picture" allowfullscreen></iframe>
|
|
|
|
|
|
|
|
|
|
<div class="grid-x">
|
|
|
|
|
<div class="small-4 cell">
|
|
|
|
|
<%= link "edit", to: Routes.thing_path(@conn, :edit, @thing),
|
|
|
|
|
class: "button primary expanded" %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="small-4 cell">
|
|
|
|
|
<%= link "insert", to: Routes.thing_path(@conn, :insert, @thing),
|
|
|
|
|
class: "button secondary expanded" %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="small-4 cell">
|
|
|
|
|
<%= link "move", to: Routes.thing_path(@conn, :move, @thing),
|
|
|
|
|
class: "button success expanded" %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
#+end_src
|
|
|
|
@ -207,7 +215,13 @@ end
|
|
|
|
|
#+begin_src web :tangle lib/poka_ijo_web/templates/thing/edit.html.eex :mkdirp yes
|
|
|
|
|
<div class="grid-x grid-padding-x">
|
|
|
|
|
<div class="small-12 medium-8 cell">
|
|
|
|
|
<h2>New Thing</h2>
|
|
|
|
|
<h2>
|
|
|
|
|
<%= if @changeset.data.name do %>
|
|
|
|
|
Editing <%= @changeset.data.name %>
|
|
|
|
|
<% else %>
|
|
|
|
|
New Thing
|
|
|
|
|
<% end %>
|
|
|
|
|
</h2>
|
|
|
|
|
|
|
|
|
|
<%= if assigns[:container] do %>
|
|
|
|
|
will be stored in
|
|
|
|
@ -222,7 +236,7 @@ end
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<%# if it's shown in the UI and the changeset has the ID: %>
|
|
|
|
|
<%= if assigns[:container] && @changeset.changes.container_id do %>
|
|
|
|
|
<%= if assigns[:container] && Map.get(@changeset.data, :container_id) do %>
|
|
|
|
|
<%= hidden_input f, :container_id %>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
@ -426,6 +440,7 @@ def edit(conn, %{"id" => id}) do
|
|
|
|
|
|> put_view(PokaIjoWeb.ThingView)
|
|
|
|
|
|> render(:edit,
|
|
|
|
|
thing: thing,
|
|
|
|
|
container: thing.container,
|
|
|
|
|
changeset: changeset,
|
|
|
|
|
page_title: "Poka Ijo: #{thing.name}"
|
|
|
|
|
)
|
|
|
|
|