|
|
|
@ -1,6 +1,27 @@
|
|
|
|
|
<div class="fl">
|
|
|
|
|
<span id="attachments_fields<%= work.id%>" xmlns="http://www.w3.org/1999/html">
|
|
|
|
|
|
|
|
|
|
<% if defined?(score) && score && score.saved_attachments %>
|
|
|
|
|
<% score.attachments.each_with_index do |attachment, i| %>
|
|
|
|
|
<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 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(' '.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}" %>
|
|
|
|
|
</span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% score.saved_attachments.each_with_index do |attachment, i| %>
|
|
|
|
|
<span id="attachments_p<%= i %>">
|
|
|
|
|
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :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 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(' '.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}" %>
|
|
|
|
|
</span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</span>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<span class="add_attachment" style="font-weight:normal;">
|
|
|
|
|