app/views/shared/show.html.erb in adminpanel-1.0.0 vs app/views/shared/show.html.erb in adminpanel-1.1.0

- old
+ new

@@ -10,54 +10,62 @@ <div class="row-fluid"> <div class="widget span6"> <div class="widget-header"> <%= content_tag(:i, nil, :class => @model.icon) %> <h5><%= @model.display_name.humanize %> - <%= link_to content_tag(:i, nil, :class => 'icon-pencil'), [:edit, resource], :title => t("action.edit") + " #{@model.display_name}" %> + <%= link_to content_tag(:i, nil, :class => 'icon-pencil'), [:edit, resource], :title => t("action.update") + " #{@model.display_name}" %> </h5> </div> <div class="widget-body"> <div class="widget-tickets widget-tickets-large clearfix"><ul> - <% @model.form_attributes.each do |fields| %> + <% @model.display_attributes.each do |fields| %> <% fields.each do |attribute, properties| %> - <% if properties["type"] != "adminpanel_file_field" %> - <li class="priority-high"> - <div class="span3"> - <h6><%= properties["name"] %></h6> - </div> - <div class="span8"> - <% if properties["type"] == "wysiwyg_field" %> - <%= resource.send(attribute).html_safe -%> - <% else %> - <%= resource.send(attribute) -%> - <% end %> - </div> - </li> + <% if properties["type"] != "adminpanel_file_field" %> + <li class="priority-high"> + <div class="span3"> + <h6><%= properties["name"] %></h6> + </div> + <div class="span8"> + <% if properties["type"] == "wysiwyg_field" %> + <%= resource.send(attribute).html_safe -%> + <% elsif properties["type"] == "belongs_to" %> + <%= parent_object_name(resource, properties["model"]) %> + + <% elsif properties["type"] == "has_many" %> + <ul> + <% resource.send("#{pluralize_model(properties["model"])}").each do |member| %> + <li class="priority-low"><%= member.name %></li> + <% end %> + </ul> + <% else %> + <%= resource.send(attribute) -%> + <% end %> + </div> + </li> + <% end %> <% end %> <% end %> - <% end %> - </ul> + </ul></div> </div> </div> - </div> - <% if @model.has_images? %> - <div class="widget widget-padding span6"> - <div class="widget-header"> - <%= content_tag(:i, nil, :class => @model.icon) %> - <h5>GalerĂ­a: <%= @model.display_name.humanize %> - <%= link_to content_tag(:i, nil, :class => 'icon-pencil'), [:edit, resource], :title => t("action.edit") + " #{@model.display_name}" %> - </h5> - </div> - <div class="widget-body row-fluid"> - <div id="gallery-container" class="js-masonry" - data-masonry-options='{ "columnWidth": 3, "itemSelector": ".gallery-item" }'> - <% resource.images.each do |image|%> - <div class="gallery-item"> - <%= link_to (image_tag image.file_url(:thumb)), image.file.to_s, :rel => "group", :name => @model.display_name %> + <% if @model.has_images? %> + <div class="widget widget-padding span6"> + <div class="widget-header"> + <%= content_tag(:i, nil, :class => @model.icon) %> + <h5><%= I18n.t("Gallery") %>: <%= @model.display_name.humanize %> + <%= link_to content_tag(:i, nil, :class => 'icon-pencil'), [:edit, resource], :title => t("action.update") + " #{@model.display_name}" %> + </h5> </div> - <% end %> + <div class="widget-body row-fluid"> + <div id="gallery-container" class="js-masonry" + data-masonry-options='{ "columnWidth": 3, "itemSelector": ".gallery-item" }'> + <% resource.images.each do |image|%> + <div class="gallery-item"> + <%= link_to (image_tag image.file_url(:thumb)), image.file.to_s, :rel => "group", :name => @model.display_name %> + </div> + <% end %> + </div> </div> </div> -</div> -<% end %> + <% end %> </div> \ No newline at end of file