diff --git a/app/models/upload.rb b/app/models/upload.rb index cac56aca2..b46f92dbf 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -4,7 +4,7 @@ require "tmpdir" class Upload < ActiveRecord::Base class Error < Exception ; end - attr_accessor :file, :image_width, :image_height, :file_ext, :md5, :file_size + attr_accessor :file, :image_width, :image_height, :file_ext, :md5, :file_size, :as_pending belongs_to :uploader, :class_name => "User" belongs_to :post before_validation :initialize_uploader, :on => :create @@ -62,7 +62,7 @@ class Upload < ActiveRecord::Base end module ConversionMethods - def process! force=false + def process!(force = false) return if !force && status =~ /processing|completed|error/ CurrentUser.scoped(uploader, uploader_ip_addr) do @@ -113,7 +113,7 @@ class Upload < ActiveRecord::Base p.uploader_ip_addr = uploader_ip_addr p.parent_id = parent_id - unless uploader.is_contributor? + if !uploader.is_contributor? || upload_as_pending? p.is_pending = true end end @@ -424,4 +424,8 @@ class Upload < ActiveRecord::Base def presenter @presenter ||= UploadPresenter.new(self) end + + def upload_as_pending? + as_pending == "1" + end end diff --git a/app/views/uploads/new.html.erb b/app/views/uploads/new.html.erb index bb9e8082b..00ca3fbb0 100644 --- a/app/views/uploads/new.html.erb +++ b/app/views/uploads/new.html.erb @@ -57,6 +57,15 @@ <%= button_tag "Copyrights", :id => "related-copyrights-button", :type => "button" %> + <% if CurrentUser.is_contributor? %> +
+ +
+ <% end %> +
<%= submit_tag "Submit", :class => "large" %>