diff --git a/app/views/comment_votes/create.js.erb b/app/views/comment_votes/create.js.erb index ea87d20ea..1bf69a8af 100644 --- a/app/views/comment_votes/create.js.erb +++ b/app/views/comment_votes/create.js.erb @@ -2,12 +2,10 @@ Danbooru.error("<%= j @error.to_s %>"); <% elsif @comment_vote.errors.any? %> Danbooru.error("<%= j @comment_vote.errors.full_messages.join('; ') %>"); -<% else %> - <% if @comment_vote.is_negative? %> - $(".comment[data-comment-id=<%= @comment.id %>]").remove(); - <% end %> - - $("#comment-vote-up-link-for-<%= @comment.id %>").hide(); - $("#comment-vote-down-link-for-<%= @comment.id %>").hide(); - $("#comment-unvote-link-for-<%= @comment.id %>").show(); +<% elsif @comment_vote.is_negative? %> + $(".comment[data-comment-id=<%= @comment.id %>]").remove(); <% end %> + +$("#comment-vote-up-link-for-<%= @comment.id %>").hide(); +$("#comment-vote-down-link-for-<%= @comment.id %>").hide(); +$("#comment-unvote-link-for-<%= @comment.id %>").show(); diff --git a/lib/tasks/images.rake b/lib/tasks/images.rake index 682439b31..26daab670 100644 --- a/lib/tasks/images.rake +++ b/lib/tasks/images.rake @@ -17,7 +17,7 @@ namespace :images do Post.where("id >= ? and id <= ?", min_id, max_id).find_each do |post| key = File.basename(post.file_path) begin - client.copy_object(bucket: bucket, key: key, acl: "authenticated-read", storage_class: "STANDARD", copy_source: "/#{bucket}/#{key}", metadata_directive: "COPY") + client.copy_object(bucket: bucket, key: key, acl: "public-read", storage_class: "STANDARD", copy_source: "/#{bucket}/#{key}", metadata_directive: "COPY") puts "copied #{post.id}" rescue Aws::S3::Errors::InvalidObjectState puts "invalid state #{post.id}" @@ -41,7 +41,7 @@ namespace :images do bucket = Danbooru.config.aws_s3_bucket_name Post.where("id >= ? and id <= ?", min_id, max_id).find_each do |post| - key = File.basename(post.file_path) + key = "preview/" + File.basename(post.preview_file_path) begin client.restore_object( bucket: bucket, @@ -53,7 +53,7 @@ namespace :images do } } ) - puts "uploaded #{post.id}" + puts "restored #{post.id}" rescue Aws::S3::Errors::InvalidObjectState puts "already glaciered #{post.id}" rescue Aws::S3::Errors::NoSuchKey