无法同时引用多个资源库的资源

dev_xiangzheng
cxt 10 years ago
parent 787b9af429
commit e43822cc30

@ -1,13 +1,13 @@
<% unless @attachments.empty?%>
<% @attachments.each_with_index do |attachment, i| %>
<% @attachments.each do |attachment| %>
$("#attachments_fields").append(
'<span id="attachments_p<%= i %>">'+
'<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => "filename link_file", :readonly=>"readonly")%>'+
'<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => "description", :style=>"display: inline-block;") %>'+
'<span id="attachments_p<%= attachment.id %>">'+
'<%= text_field_tag("attachments[p#{attachment.id}][filename]", attachment.filename, :class => "filename link_file", :readonly=>"readonly")%>'+
'<%= text_field_tag("attachments[p#{attachment.id}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => "description", :style=>"display: inline-block;") %>'+
'<span class="ispublic-label"><%= l(:field_is_public)%>:</span>'+
'<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => "is_public")%>'+
'<%= link_to("&nbsp;".html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => "js"), :method => "delete", :remote => true, :class => "remove-upload") unless attachment.id.nil? %>'+
'<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>'+
'<%= check_box_tag("attachments[p#{attachment.id}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => "is_public")%>'+
'<%= link_to("&nbsp;".html_safe, attachment_path(attachment, :attachment_id => "p#{attachment.id}", :format => "js"), :method => "delete", :remote => true, :class => "remove-upload") unless attachment.id.nil? %>'+
'<%= hidden_field_tag "attachments[p#{attachment.id}][token]", "#{attachment.token}" %>'+
'</span>'+
'<div class="cl"></div>')

Loading…
Cancel
Save