Current section
Files
Jump to
Current section
Files
priv/templates/temple.gen.live/show.html.lexs
h1 do: "Show <%= schema.human_singular %>"
if @live_action in [:edit] do
live_modal @socket, <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web_namespace, schema.alias) %>Live.FormComponent,
id: @<%= schema.singular %>.id,
title: @page_title,
action: @live_action,
<%= schema.singular %>: @<%= schema.singular %>,
return_to: Routes.<%= schema.route_helper %>_show_path(@socket, :show, @<%= schema.singular %>)
end
ul do
<%= for {k, _} <- schema.attrs do %>
li do
strong do: "<%= Phoenix.Naming.humanize(Atom.to_string(k)) %>:"
@<%= schema.singular %>.<%= k %>
end
<% end %>
end
span do: live_patch "Edit", to: Routes.<%= schema.route_helper %>_show_path(@socket, :edit, @<%= schema.singular %>), class: "button"
span do: live_redirect "Back", to: Routes.<%= schema.route_helper %>_index_path(@socket, :index)