diff --git a/app/controllers/artist_commentaries_controller.rb b/app/controllers/artist_commentaries_controller.rb index ddcfd912d..e532653a8 100644 --- a/app/controllers/artist_commentaries_controller.rb +++ b/app/controllers/artist_commentaries_controller.rb @@ -40,8 +40,8 @@ private def commentary_params params.fetch(:artist_commentary, {}).except(:post_id).permit(%i[ original_description original_title translated_description translated_title - remove_commentary_tag remove_commentary_request_tag remove_commentary_check_tag - add_commentary_tag add_commentary_request_tag add_commentary_check_tag + remove_commentary_tag remove_commentary_request_tag remove_commentary_check_tag remove_partial_commentary_tag + add_commentary_tag add_commentary_request_tag add_commentary_check_tag add_partial_commentary_tag ]) end end diff --git a/app/models/artist_commentary.rb b/app/models/artist_commentary.rb index 5d8a59885..39fd8f607 100644 --- a/app/models/artist_commentary.rb +++ b/app/models/artist_commentary.rb @@ -1,8 +1,8 @@ class ArtistCommentary < ApplicationRecord class RevertError < Exception ; end - attr_accessor :remove_commentary_tag, :remove_commentary_request_tag, :remove_commentary_check_tag - attr_accessor :add_commentary_tag, :add_commentary_request_tag, :add_commentary_check_tag + attr_accessor :remove_commentary_tag, :remove_commentary_request_tag, :remove_commentary_check_tag, :remove_partial_commentary_tag + attr_accessor :add_commentary_tag, :add_commentary_request_tag, :add_commentary_check_tag, :add_partial_commentary_tag before_validation :trim_whitespace validates_uniqueness_of :post_id belongs_to :post, required: true @@ -108,6 +108,14 @@ class ArtistCommentary < ApplicationRecord post.add_tag("check_commentary") end + if remove_partial_commentary_tag == "1" + post.remove_tag("partial_commentary") + end + + if add_partial_commentary_tag == "1" + post.add_tag("partial_commentary") + end + post.save if post.tag_string_changed? end diff --git a/app/views/artist_commentaries/_form.html.erb b/app/views/artist_commentaries/_form.html.erb index 01967ca01..537e42b1a 100644 --- a/app/views/artist_commentaries/_form.html.erb +++ b/app/views/artist_commentaries/_form.html.erb @@ -80,4 +80,20 @@ <% end %> + + <% if post.has_tag?("partial_commentary") %> +