Sha256: 1774eeeaf3d5e8bb8afab0e32d589382498edb94390ad05d5033bb137513d1fe

Contents?: true

Size: 1.81 KB

Versions: 2

Compression:

Stored size: 1.81 KB

Contents

<%- if pagination? %>
<%%= paginate @<%= plural_table_name %>, :remote => remote %>
<%- end %>
<div class="separator"></div>

<table class='user' cellspacing='0'>
  <thead>
  <tr>
    <th>#</th>
<%- attributes.each do |attribute| -%>
<%- attr_name = case attribute.type when :references, :belongs_to then "#{attribute.name}_id" else attribute.name end -%>
    <th><%%= sortable :<%= attr_name %>, t('attributes.<%= singular_table_name %>.<%= attribute.name %>'), remote %></th>
<%- end -%>
    <th></th>
    <th></th>
    <th></th>
  </tr>
  </thead>
  <tbody>
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| -%>
  <tr id="tr<%%= <%= singular_table_name %>.id %>" class="<%%= cycle("odd", "even")%>">
    <td><%%= number_with_delimiter <%= singular_table_name %>.id %></td>
<%- attributes.each do |attribute| -%>
    <td><%= attribute_to_erb(attribute, singular_table_name) -%></td>
<%- end -%>
    <!-- Manage section, do not remove this tag -->
    <td><%%= link_to t(:show), <%= show_resource_path %><%= ", :remote => remote" if jquery_ui? %> %></td>
    <%- if authorization? -%>
    <%%- if can? :update, <%= singular_table_name %> -%>
    <%- end -%>
    <td><%%= link_to t(:edit), <%= edit_resource_path %> %></td>
    <%- if authorization? -%>
    <%%- end -%>
    <%- end -%>
    <%- if authorization? -%>
    <%%- if can? :destroy, <%= singular_table_name %> -%>
    <%- end -%>
    <td><%%= link_to t(:destroy), <%= destroy_resource_path %>, <%= key_value :confirm, "t(:sure?)" %>, <%= key_value :method, ":delete" %>, :remote => remote %></td>
    <%- if authorization? -%>
    <%%- end -%>
    <%- end -%>
  </tr>
<%% end -%>
  </tbody>
</table>

<div class="separator"></div>
<%- if pagination? -%>
<%%= paginate @<%= plural_table_name %>, :remote => remote %>
<%- end -%>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
leonardo-1.8.3 lib/generators/erb/leosca/templates/_list.erb
leonardo-1.8.2 lib/generators/erb/leosca/templates/_list.erb