Added upload commentary enhancements

- Can now translate commentary from the upload page
- Can now add commentary tags with a checkbox
This commit is contained in:
BrokenEagle
2020-01-14 23:37:21 +00:00
parent 34c3df78d9
commit 82b621d87d
7 changed files with 68 additions and 12 deletions

View File

@@ -65,10 +65,6 @@ class UploadService
return @post.warnings.full_messages
end
def include_artist_commentary?
params[:include_artist_commentary].to_s.truthy?
end
def create_post_from_upload(upload)
@post = convert_to_post(upload)
@post.save!
@@ -81,10 +77,12 @@ class UploadService
)
end
if include_artist_commentary?
if upload.include_artist_commentary
@post.create_artist_commentary(
:original_title => params[:artist_commentary_title],
:original_description => params[:artist_commentary_desc]
:original_title => upload.artist_commentary_title,
:original_description => upload.artist_commentary_desc,
:translated_title => upload.translated_commentary_title,
:translated_description => upload.translated_commentary_desc
)
end
@@ -113,6 +111,11 @@ class UploadService
if !upload.uploader.can_upload_free? || upload.upload_as_pending?
p.is_pending = true
end
p.add_tag("commentary") if upload.add_commentary_tag
p.add_tag("commentary_request") if upload.add_commentary_request_tag
p.add_tag("commentary_check") if upload.add_commentary_check_tag
p.add_tag("partial_commentary") if upload.add_partial_commentary_tag
end
end
end