app/views/shared/index.html.erb in adminpanel-1.0.0 vs app/views/shared/index.html.erb in adminpanel-1.1.0
- old
+ new
@@ -1,20 +1,19 @@
<% provide(:page_title, @model.display_name) -%>
<div class="row-fluid">
<%=
link_to(
content_tag(:div,
- content_tag(:i, nil, :class => 'icon-plus-sign icon-2x') + content_tag(:span, "Crear #{@model.display_name}", nil),
+ content_tag(:i, nil, :class => 'icon-plus-sign icon-2x') + content_tag(:span, I18n.t("action.create") + " #{@model.display_name}", nil),
:class => "btn btn-box span2"),
{
:controller => params[:controller],
:action => "new"
}
)
%>
</div>
-
<div class="row-fluid">
<div class="widget widget-padding span12">
<div class="widget-header">
<%= content_tag(:i, nil, :class => @model.icon) %>
<h5>
@@ -24,28 +23,32 @@
<div class="widget-body">
<div class="dataTables_wrapper form-inline">
<table id="information-table" class="table table-striped table-bordered dataTable">
<thead><!-- model attributes -->
<tr>
- <% @model.form_attributes.each do |fields| %>
+ <% @model.display_attributes.each do |fields| %>
<% fields.each do |attribute, properties| %>
- <% if properties["type"] != "adminpanel_file_field" %>
+ <% if properties["type"] != "adminpanel_file_field" && properties["type"] != "has_many" %>
<th><%= properties["name"] %></th>
<% end %>
<% end %>
<% end %>
<th><%= I18n.t("actions") %></th>
</tr>
</thead><!-- Ends model attributes -->
<tbody>
<% collection.each do |member| %>
<tr>
- <% @model.form_attributes.each do |fields| %>
+ <% @model.display_attributes.each do |fields| %>
<% fields.each do |attribute, properties| %>
<% if properties["type"] == "wysiwyg_field" %>
<td><%= member.send(attribute).html_safe -%></td>
- <% elsif properties["type"] != "adminpanel_file_field" %>
+ <% elsif properties["type"] == "belongs_to" %>
+ <td>
+ <%= parent_object_name(member, properties["model"]) %>
+ </td>
+ <% elsif properties["type"] != "adminpanel_file_field" && properties["type"] != "has_many" %>
<td><%= member.send(attribute) -%></td>
<% end %>
<% end %>
<% end %>
<td>
@@ -59,11 +62,11 @@
<%=
link_to(
content_tag(:i, nil, :class => 'icon-pencil'),
[:edit, member],
- :title => t("action.edit")
+ :title => t("action.update") + " #{@model.display_name}"
)
%>
<%=
link_to(
@@ -72,10 +75,10 @@
nil,
:class => 'icon-remove'
),
[member],
:title => I18n.t("action.delete"),
- :id => "category-delete",
+ :id => "resource-delete",
:method => :delete,
:data => { :confirm => "Eliminar #{@model.display_name}?" }
)
%>
</td>
\ No newline at end of file