diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index f34a0e4e7..f05c4e9b0 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -1,10 +1,10 @@ <% if defined?(container) && container && container.saved_attachments %> - <% container.saved_attachments.each_with_index do |attachment, i| %> - - <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename', :maxlength => 10)%> - - <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 155, :placeholder => l(:label_optional_description), :class => 'description') + + <% container.attachments.each_with_index do |attachment, 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 => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> diff --git a/app/views/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb index fe6f35fb3..6d9230a91 100644 --- a/app/views/bids/_homework_form.html.erb +++ b/app/views/bids/_homework_form.html.erb @@ -37,5 +37,5 @@ <%= hidden_field_tag 'course_id', @project_id %> <%= l(:label_attachment_plural) %> -<%= render :partial => 'attachments/form', :locals => {:container => @homework} %> +<%= render :partial => 'attachments/form', :locals => {:container => @bid} %> \ No newline at end of file
<%= hidden_field_tag 'course_id', @project_id %>
<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>
<%= render :partial => 'attachments/form', :locals => {:container => @bid} %>