This repository has been archived on 2023-08-07. You can view files and clone it, but cannot push or open issues or pull requests.
temple/priv/templates/temple.gen.live/show.html.lexs
2020-06-30 20:43:04 -04:00

22 lines
866 B
Text

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)