Sha256: 50df65e353331003a9e9baa6bbfb927970607287238e46d1bb1943363743d07b

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 KB

Contents

%h1
  = <%= model_name(:ivar) %>.to_s

.tools
  = link_to 'All <%= model_name(:humans) %>', <%= wui.path(:index) %>, class: 'tools__button'
  = link_to 'Edit', <%= wui.path(:edit, model_name(:ivar)) %>, class: 'tools__button is_primary'
  = link_to 'Destroy', <%= wui.path(:destroy, model_name(:ivar)) %>, method: :delete, class: 'tools__button', confirm: 'Really destroy?'
<% wui.custom_actions.select(&:member?).each do |action| -%>
  = link_to '<%= action.name(:human).titleize %>', <%= wui.path(action, model_name(:ivar)) %>, class: 'tools__button'<%=
      ", method: :#{action.method}" unless action.get?
    %>
<% end -%>

%dl.values
<% wui.model.attrs.each do |attribute| -%>
  <%- model_attribute = "#{model_name(:ivar)}.#{attribute.name}" -%>
  %dt
    = <%= model_name(:class) %>.human_attribute_name(:<%= attribute.name %>)
  %dd
  <%- case attribute.type -%>
  <%- when :string -%>
    = <%= model_attribute %>
  <%- when :email -%>
    = mail_to <%= model_attribute %>, nil, class: 'hyperlink'
  <%- when :url -%>
    = link_to <%= model_attribute %>, <%= model_attribute %>, class: 'hyperlink'
  <%- when :integer -%>
    = <%= model_attribute %>
  <%- when :money -%>
    = <%= model_attribute %>
    €
  <%- when :text -%>
    = simple_format(<%= model_attribute %>)
  <%- when :markdown -%>
    = markdown(<%= model_attribute %>)
  <%- when :flag -%>
    = <%= model_attribute %> ? 'Yes' : 'No'
  <%- when :datetime -%>
    = l(<%= model_attribute %>) if <%= model_attribute %>
  <%- end -%>
<%- end -%>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
katapult-0.1.2 lib/generators/katapult/haml/templates/show.html.haml
katapult-0.1.1 lib/generators/katapult/haml/templates/show.html.haml