diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb
index 73f83f692..c3791c4bf 100644
--- a/app/controllers/uploads_controller.rb
+++ b/app/controllers/uploads_controller.rb
@@ -52,7 +52,13 @@ class UploadsController < ApplicationController
flash[:notice] = @service.warnings.join(".\n \n")
end
- respond_with(@upload)
+ respond_with(@upload) do |format|
+ format.json do
+ return render json: {success: true, location: post_path(@upload.post_id), post_id: @upload.post_id} unless @upload.is_errored?
+ return render json: {success: false, reason: 'duplicate', location: post_path(@upload.duplicate_post_id), post_id: @upload.duplicate_post_id}, status: 412 if @upload.is_duplicate?
+ return render json: {success: false, reason: 'invalid', message: @upload.sanitized_status}, status: 412 if @upload.is_errored?
+ end
+ end
end
private
diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js
index bc1b3e499..c9fbeef34 100644
--- a/app/javascript/packs/application.js
+++ b/app/javascript/packs/application.js
@@ -45,4 +45,5 @@ export { default as Upload } from '../src/javascripts/uploads.js';
export { default as Utility } from '../src/javascripts/utility.js';
export { default as Ugoira } from '../src/javascripts/ugoira.js';
export { default as Takedown } from '../src/javascripts/takedowns.js';
-export { default as Thumbnails } from '../src/javascripts/thumbnails.js';
\ No newline at end of file
+export { default as Thumbnails } from '../src/javascripts/thumbnails.js';
+export { default as Uploader } from '../src/javascripts/uploader.js';
diff --git a/app/javascript/src/javascripts/uploader.js b/app/javascript/src/javascripts/uploader.js
new file mode 100644
index 000000000..42fcb3cc9
--- /dev/null
+++ b/app/javascript/src/javascripts/uploader.js
@@ -0,0 +1,12 @@
+import Uploader from './uploader.vue';
+import Vue from 'vue';
+
+export default {
+ init() {
+ const app = new Vue({
+ render: (h) => h(Uploader)
+ });
+
+ app.$mount('#uploader');
+ }
+}
diff --git a/app/javascript/src/javascripts/uploader.vue b/app/javascript/src/javascripts/uploader.vue
new file mode 100644
index 000000000..94230df73
--- /dev/null
+++ b/app/javascript/src/javascripts/uploader.vue
@@ -0,0 +1,898 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The direct URL entered has the following problem: {{ directURLProblem }}
+ You should review the sourcing guide.
+
+
+
+ Uploads from {{whitelist.domain}} are permitted.
+ Uploads from {{whitelist.domain}} are not permitted. (View whitelisted domains)
+
+
+
+
+
+
{{ previewDimensions }}
+
+
+
+
+
+
You should include: A link to the artists page where this was obtained, and a link to the
+ submission page
+ where this image was obtained. No available source should ONLY be used if the content has never
+ been posted
+ online anywhere else.
+
+
+
+
A source must be provided or
+ you must
+ select that there
+ is no available source.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Select (and write in) all that apply. Character sex is based only on what is visible in the
+ image.
+ Outside information or other images should not be used when deciding what tags are used.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ These allow users to find or blacklist content with ease. Make sure that you are tagging
+ these upon
+ initial upload.
+
+
+
+
+
+
+
+
+
+
+
Explicit tags include sex, pussy, penis, masturbation, fellatio, etc.
+ (<%= link_to "help", help_pages_path(title: 'ratings'), target: "_blank" %>)
+
+
+
+
+ You must select an appropriate rating for this image.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Separate tags with spaces. (<%= link_to "help", help_pages_path(title: 'tags'), target: "_blank"
+ %>)
+
+
+
+
+
{{ previewDimensions }}
+
+
+
+ You must provide at least {{4 - tagCount}} more tags. Tags in other sections count
+ towards this
+ total.
+
Before uploading, read
@@ -14,6 +9,7 @@
Unsure what to tag your post
with? <%= link_to "Tagging Checklist", help_pages_path(id: "tagging_checklist") %>
-
\ No newline at end of file
diff --git a/app/views/uploads/upload_partials/_uploader.html.erb b/app/views/uploads/upload_partials/_uploader.html.erb
deleted file mode 100644
index 0d59d4e1c..000000000
--- a/app/views/uploads/upload_partials/_uploader.html.erb
+++ /dev/null
@@ -1,228 +0,0 @@
-
-
-
-
-
-
-
- <% unless @upload.new_record? %>
-
-
This post was already uploaded
- (<%= link_to "post ##{@upload.id}", {action: "show", id: @upload.id}, target: "_blank" %>).
-
- <% end %>
-
-
-
-
-
-
-
-
-
-
-
- The direct URL entered has the following problem: {{ directURLProblem }}
- You should review the sourcing guide.
-
-
-
- Uploads from {{whitelist.domain}} are permitted.
- Uploads from {{whitelist.domain}} are not permitted. (View whitelisted domains)
-
-
-
-
-
-
{{ previewDimensions }}
-
-
-
-
-
-
You should include: A link to the artists page where this was obtained, and a link to the submission page
- where this image was obtained. No available source should ONLY be used if the content has never been posted
- online anywhere else.
-
-
-
-
A source must be provided or you must
- select that there
- is no available source.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Select (and write in) all that apply. Character sex is based only on what is visible in the image.
- Outside information or other images should not be used when deciding what tags are used.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- These allow users to find or blacklist content with ease. Make sure that you are tagging these upon
- initial upload.
-
-
-
-
-
-
-
-
-
-
-
Explicit tags include sex, pussy, penis, masturbation, fellatio, etc.
- (<%= link_to "help", help_pages_path(title: 'ratings'), target: "_blank" %>)
-
-
-
-
- You must select an appropriate rating for this image.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Separate tags with spaces. (<%= link_to "help", help_pages_path(title: 'tags'), target: "_blank" %>)
-
-
-
-
-
{{ previewDimensions }}
-
-
-
- You must provide at least {{4 - tagCount}} more tags. Tags in other sections count towards this
- total.
-