Sha256: fc18dbe7795e8ddac94a7bba1745e48f2e7c78e81728561721b6ac74976d5648

Contents?: true

Size: 1.51 KB

Versions: 9

Compression:

Stored size: 1.51 KB

Contents

<div class="slice <%= file_name %>">
<% if form_slice? -%>
  <%%= form_for slice, url: slice.page.path do |f| %>
<% end -%>

  <!--
    Stick the HTML that should be rendered when your slice is displayed here.

    You can refer to data stored on your slice by calling slice.foo inside
    a normal ERB code block.

    <%- if form_slice? -%>
    For more information on available form helpers, see:
    http://guides.rubyonrails.org/form_helpers.html
    <%- end -%>
  -->

<% attributes.each do |attribute| -%>
<% case attribute.type
   when :attachments -%>
  <ul class="<%= attribute.name %>">
    <%%- slice.<%= attribute.name %>.each do |<%= attribute.name.singularize %>| -%>
      <li>
        <%%= image_if_present <%= attribute.name.singularize %>.asset, :original %>
        <div class="caption"><%%= markdown <%= attribute.name.singularize %>.caption %></div>
      </li>
    <%%- end -%>
  </ul>
<% when :date_time, :datetime, :date -%>
  <div class="<%= attribute.name %>"><%%=l slice.<%= attribute.name %> %></div>
<% when :string, :text -%>
  <div class="<%= attribute.name %>"><%%= markdown slice.<%= attribute.name %> %></div>
<% when :boolean -%>
  <%%- if slice.<%= attribute.name %>? -%>
    <div class="<%= attribute.name %>"><%= attribute.name.humanize %>!</div>
  <%%- end -%>
<% else -%>
  <div class="<%= attribute.name %>"><%%= slice.<%= attribute.name %> %></div>
<% end -%>

<% end -%>
  <p>Change me by editing app/slices/<%= file_name %>/views/show.html.erb</p>

<% if form_slice? -%>
  <%% end %>
<% end -%>
</div>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
slices-2.0.2 lib/generators/slice/templates/show.html.erb
slices-2.0.1 lib/generators/slice/templates/show.html.erb
slices-2.0.0 lib/generators/slice/templates/show.html.erb
slices-1.0.5 lib/generators/slice/templates/show.html.erb
slices-1.0.4 lib/generators/slice/templates/show.html.erb
slices-1.0.3 lib/generators/slice/templates/show.html.erb
slices-1.0.2 lib/generators/slice/templates/show.html.erb
slices-1.0.1 lib/generators/slice/templates/show.html.erb
slices-1.0.0 lib/generators/slice/templates/show.html.erb