Sha256: e6d6ce71c0f5fd875af9c7fbb42b7b8d740a49f80f23d29da8ead3fe49bae5f0

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

<%- object = model_name(:ivar) -%>
.action-bar.-main.btn-group
  = link_to 'All <%= model_name(:humans) %>', <%= web_ui.path(:index) %>, class: 'btn btn-default'
  = link_to 'Edit', <%= web_ui.path(:edit, object) %>, class: 'btn btn-default'
<% web_ui.custom_actions.select(&:member?).each do |action| -%>
  = link_to '<%= action.name(:human).titleize %>', <%= web_ui.path(action, object) %>, class: 'btn btn-default'<%=
    ", method: :#{action.method}" unless action.get?
    %>
<% end -%>

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

%dl
<% web_ui.model.renderable_attrs.each do |attribute| -%>
  <%- model_attribute = "#{object}.#{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
  <%- when :url -%>
    = link_to <%= model_attribute %>, <%= model_attribute %>
  <%- when :integer -%>
    = <%= model_attribute %>
  <%- when :money -%>
    = <%= model_attribute %>
    €
  <%- when :text -%>
    = simple_format(<%= model_attribute %>)
  <%- when :flag -%>
    = <%= model_attribute %> ? 'Yes' : 'No'
  <%- when :datetime -%>
    = l(<%= model_attribute %>.to_date) if <%= model_attribute %>
  <%- end -%>
<%- end -%>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
katapult-0.3.0 lib/generators/katapult/views/templates/show.html.haml