Orbit/app/views/admin/designs/_design_file.html.erb

25 lines
820 B
Plaintext
Raw Normal View History

2011-07-20 09:05:28 +00:00
<% item_destroy ||= false %>
<% item_snapshot ||= false %>
<% li_class = ''%>
2011-07-20 06:04:16 +00:00
<% fieldname_p = fieldname.pluralize %>
<%= f.label "fieldname", t('admin.'+fieldname) %>
<ul>
<% object.send(fieldname_p).each do |t| %>
2011-07-20 09:05:28 +00:00
<% li_class += 'r_destroy ' if item_destroy %>
<% li_class += 'r_snapshot ' if item_snapshot %>
<li class="<%= li_class %>"> <%= t.file_filename %>
<% if item_destroy %>
<%=fields_for "design["+fieldname_p+"][]",t,:index=>nil do |f| %>
2011-07-20 06:04:16 +00:00
<%= f.hidden_field :id %>
<%= f.hidden_field :to_destroy %>
<%end%>
2011-07-20 09:05:28 +00:00
<a class="remove_mark" href="#"><%= t('Delete') %></a>
<% end %>
2011-07-20 06:04:16 +00:00
</li>
<% end %>
</ul>
2011-07-20 09:05:28 +00:00
<%= fields_for "design["+fieldname_p+"][]", object, :index => nil do |f| %>
2011-07-20 06:04:16 +00:00
<%= f.file_field :file ,{:class=>"multi_files",:rtype=>rtype}%>
<% end %>