lib/generators/admin/scaffold_controller/templates/views/erb/index.html.erb.erb in admin_help-0.1.3 vs lib/generators/admin/scaffold_controller/templates/views/erb/index.html.erb.erb in admin_help-0.1.4

- old
+ new

@@ -1,31 +1,33 @@ -<p id="notice"><%%= notice %></p> +<div class="panel"> + <h1 class="title--actions"> + <%%= <%= singular_table_name.classify %>.model_name.human %> + <%%= link_to t('actions.new') + <%= singular_table_name.classify %>.model_name.human, new_<%= prefixed_plain_model_url %>_path, class: "button button--primary" %> + </h1> -<h1><%= plural_table_name_camelcase %></h1> - -<table> - <thead> - <tr> -<% attributes.reject(&:password_digest?).each do |attribute| -%> - <th><%= attribute.human_name %></th> -<% end -%> - <th colspan="3"></th> - </tr> - </thead> - - <tbody> - <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> + <table class="table table--horizontal"> + <thead> <tr> -<% attributes.reject(&:password_digest?).each do |attribute| -%> - <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td> -<% end -%> - <td><%%= link_to 'Show', <%= "[:#{prefix}, #{singular_table_name}]" %> %></td> - <td><%%= link_to 'Edit', edit_<%= prefixed_plain_model_url %>_path(<%= singular_table_name %>) %></td> - <td><%%= link_to 'Destroy', <%= "[:#{prefix}, #{singular_table_name}]" %>, method: :delete, data: { confirm: 'Are you sure?' } %></td> + <% attributes.reject(&:password_digest?).each do |attribute| -%> + <th><%%= <%= singular_table_name.classify %>.human_attribute_name(:<%= attribute.name %>) %></th> + <% end -%> + <th></th> </tr> - <%% end %> - </tbody> -</table> + </thead> -<br> + <tbody> + <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> + <tr> + <% attributes.reject(&:password_digest?).each do |attribute| -%> + <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td> + <% end -%> + <td> + <%%= link_to <%= "[:#{prefix}, #{singular_table_name}]" %>, title: t('actions.show'), class: "button--tiny button--primary" do -%><i class="fa fa-file"></i><%% end %> + <%%= link_to edit_<%= prefixed_plain_model_url %>_path(<%= singular_table_name %>), title: t('actions.edit'), class: "button--tiny button--warning" do -%><i class="fa fa-pencil"></i><%% end %> + <%%= link_to <%= "[:#{prefix}, #{singular_table_name}]" %>, method: :delete, data: { confirm: 'Are you sure?' }, title: t('actions.destroy'), class: "button--tiny button--danger" do -%><i class="fa fa-times"></i><%% end %> + </td> + </tr> + <%% end %> + </tbody> + </table> -<%%= link_to 'New <%= human_name %>', new_<%= prefixed_plain_model_url %>_path %> +</div>