app/views/guts/contents/index.html.erb in guts-1.0.8 vs app/views/guts/contents/index.html.erb in guts-1.1.0
- old
+ new
@@ -1,9 +1,9 @@
<div class="row">
<div class="small-12 columns">
<h1><%= @type.title.pluralize 2 %></h1>
- <%= link_to "New #{@type.title}", new_content_path(type: @type.slug), class: "button" %>
+ <%= link_to "New #{@type.title}", new_content_path(type: @type.slug), class: 'button' %>
</div>
</div>
<% if notice %>
<div class="row">
@@ -15,24 +15,28 @@
</div>
<% end %>
<div class="row">
<div class="small-12 columns">
- <table>
- <tbody>
- <% @contents.each do |content| %>
- <tr>
- <td><%= content.title %><% if content.visible == 0 %> <i class="fa fa-eye-slash"></i><% end %></td>
- <td><small>Created on <%= content.created_at.strftime("%b #{content.created_at.day.ordinalize}, %Y") %></small></td>
- <td><small>Updated at <%= content.updated_at.strftime("%b #{content.updated_at.day.ordinalize}, %Y") %></small></td>
- <td align="right" class="action_links">
- <%= link_to "Edit", edit_content_path(content) %>
- <%= link_to_destroy "Destroy", content %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
+ <% if @contents.size > 0 %>
+ <table>
+ <tbody>
+ <% @contents.each do |content| %>
+ <tr>
+ <td><%= content.title %><% if content.visible == 0 %> <i class="fa fa-eye-slash"></i><% end %></td>
+ <td><small>Created on <%= content.created_at.strftime("%b #{content.created_at.day.ordinalize}, %Y") %></small></td>
+ <td><small>Updated at <%= content.updated_at.strftime("%b #{content.updated_at.day.ordinalize}, %Y") %></small></td>
+ <td align="right" class="action_links">
+ <%= link_to 'Edit', edit_content_path(content) %>
+ <%= link_to_destroy 'Destroy', content %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ <% else %>
+ <p>No <%= @type.title.pluralize(2).downcase %> content has been added.</p>
+ <% end %>
</div>
</div>
<div class="row">
<div class="small-12 columns">
\ No newline at end of file