diff --git a/app/controllers/artist_commentaries_controller.rb b/app/controllers/artist_commentaries_controller.rb
deleted file mode 100644
index 5d5b7161a..000000000
--- a/app/controllers/artist_commentaries_controller.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-class ArtistCommentariesController < ApplicationController
- respond_to :html, :json, :js
- before_action :admin_only
-
- def index
- @commentaries = ArtistCommentary.search(search_params).paginate(params[:page], :limit => params[:limit])
- respond_with(@commentaries)
- end
-
- def show
- if params[:id]
- @commentary = ArtistCommentary.find(params[:id])
- else
- @commentary = ArtistCommentary.find_by_post_id!(params[:post_id])
- end
-
- respond_with(@commentary) do |format|
- format.html { redirect_to post_path(@commentary.post) }
- end
- end
-
- def create_or_update
- @artist_commentary = ArtistCommentary.find_or_initialize_by(post_id: params.dig(:artist_commentary, :post_id))
- @artist_commentary.update(commentary_params)
- respond_with(@artist_commentary)
- end
-
- def revert
- @artist_commentary = ArtistCommentary.find_by_post_id!(params[:id])
- @version = @artist_commentary.versions.find(params[:version_id])
- @artist_commentary.revert_to!(@version)
- end
-
-private
-
- def commentary_params
- params.fetch(:artist_commentary, {}).except(:post_id).permit(%i[
- original_description original_title translated_description translated_title
- ])
- end
-end
diff --git a/app/controllers/artist_commentary_versions_controller.rb b/app/controllers/artist_commentary_versions_controller.rb
deleted file mode 100644
index fc2c3f91e..000000000
--- a/app/controllers/artist_commentary_versions_controller.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class ArtistCommentaryVersionsController < ApplicationController
- respond_to :html, :json
- before_action :admin_only
-
- def index
- @commentary_versions = ArtistCommentaryVersion.search(search_params).paginate(params[:page], :limit => params[:limit])
- respond_with(@commentary_versions)
- end
-end
diff --git a/app/javascript/src/javascripts/autocomplete.js.erb b/app/javascript/src/javascripts/autocomplete.js.erb
index 86eb116c5..e3aec4a0e 100644
--- a/app/javascript/src/javascripts/autocomplete.js.erb
+++ b/app/javascript/src/javascripts/autocomplete.js.erb
@@ -103,7 +103,6 @@ Autocomplete.initialize_tag_autocomplete = function() {
case "comm":
case "noter":
case "noteupdater":
- case "artcomm":
case "fav":
case "favoritedby":
case "appealer":
diff --git a/app/javascript/src/javascripts/uploads.js b/app/javascript/src/javascripts/uploads.js
index dd624cda8..4100dc3fd 100644
--- a/app/javascript/src/javascripts/uploads.js
+++ b/app/javascript/src/javascripts/uploads.js
@@ -16,11 +16,6 @@ Upload.initialize_all = function() {
}
this.initialize_similar();
this.initialize_submit();
-
- $("#toggle-artist-commentary").on("click.danbooru", function(e) {
- Upload.toggle_commentary();
- e.preventDefault();
- });
}
if ($("#iqdb-similar").length) {
@@ -95,16 +90,6 @@ Upload.initialize_image = function() {
$("#image-resize-to-window-link").on("click.danbooru", Upload.update_scale);
}
-Upload.toggle_commentary = function() {
- if ($(".artist-commentary").is(":visible")) {
- $("#toggle-artist-commentary").text("show »");
- } else {
- $("#toggle-artist-commentary").text("« hide");
- }
-
- $(".artist-commentary").slideToggle();
-};
-
$(function() {
Upload.initialize_all();
});
diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb
index 508b1e06d..1780f317b 100644
--- a/app/logical/post_query_builder.rb
+++ b/app/logical/post_query_builder.rb
@@ -421,14 +421,6 @@ class PostQueryBuilder
when "note_asc"
relation = relation.order("posts.last_noted_at ASC NULLS FIRST")
- when "artcomm"
- relation = relation.joins("INNER JOIN artist_commentaries ON artist_commentaries.post_id = posts.id")
- relation = relation.order("artist_commentaries.updated_at DESC")
-
- when "artcomm_asc"
- relation = relation.joins("INNER JOIN artist_commentaries ON artist_commentaries.post_id = posts.id")
- relation = relation.order("artist_commentaries.updated_at ASC")
-
when "mpixels", "mpixels_desc"
relation = relation.where(Arel.sql("posts.image_width is not null and posts.image_height is not null"))
# Use "w*h/1000000", even though "w*h" would give the same result, so this can use
diff --git a/app/models/artist_commentary.rb b/app/models/artist_commentary.rb
deleted file mode 100644
index 2632d4a7d..000000000
--- a/app/models/artist_commentary.rb
+++ /dev/null
@@ -1,139 +0,0 @@
-class ArtistCommentary < ApplicationRecord
- class RevertError < Exception ; end
-
- before_validation :trim_whitespace
- validates :post_id, uniqueness: true
- validates :original_title, length: { maximum: 150 }
- validates :translated_title, length: { maximum: 150 }
- validates :original_description, length: { maximum: Danbooru.config.wiki_page_max_size }
- validates :translated_description, length: { maximum: Danbooru.config.wiki_page_max_size }
- belongs_to :post, required: true
- has_many :versions, -> {order("artist_commentary_versions.id ASC")}, :class_name => "ArtistCommentaryVersion", :dependent => :destroy, :foreign_key => :post_id, :primary_key => :post_id
- has_one :previous_version, -> {order(id: :desc)}, :class_name => "ArtistCommentaryVersion", :foreign_key => :post_id, :primary_key => :post_id
- after_save :create_version
-
- module SearchMethods
- def text_matches(query)
- query = "*#{query}*" unless query =~ /\*/
- escaped_query = query.to_escaped_for_sql_like
- where("original_title ILIKE ? ESCAPE E'\\\\' OR original_description ILIKE ? ESCAPE E'\\\\' OR translated_title ILIKE ? ESCAPE E'\\\\' OR translated_description ILIKE ? ESCAPE E'\\\\'", escaped_query, escaped_query, escaped_query, escaped_query)
- end
-
- def post_tags_match(query)
- where(post_id: PostQueryBuilder.new(query).build.reorder(""))
- end
-
- def deleted
- where(original_title: "", original_description: "", translated_title: "", translated_description: "")
- end
-
- def undeleted
- where("original_title != '' OR original_description != '' OR translated_title != '' OR translated_description != ''")
- end
-
- def search(params)
- q = super
-
- if params[:text_matches].present?
- q = q.text_matches(params[:text_matches])
- end
-
- if params[:post_id].present?
- q = q.where(post_id: params[:post_id].split(",").map(&:to_i))
- end
-
- if params[:original_present].to_s.truthy?
- q = q.where("(original_title != '') or (original_description != '')")
- elsif params[:original_present].to_s.falsy?
- q = q.where("(original_title = '') and (original_description = '')")
- end
-
- if params[:translated_present].to_s.truthy?
- q = q.where("(translated_title != '') or (translated_description != '')")
- elsif params[:translated_present].to_s.falsy?
- q = q.where("(translated_title = '') and (translated_description = '')")
- end
-
- if params[:post_tags_match].present?
- q = q.post_tags_match(params[:post_tags_match])
- end
-
- q = q.deleted if params[:is_deleted] == "yes"
- q = q.undeleted if params[:is_deleted] == "no"
-
- q.apply_default_order(params)
- end
- end
-
- def trim_whitespace
- self.original_title = (original_title || '').gsub(/\A[[:space:]]+|[[:space:]]+\z/, "")
- self.translated_title = (translated_title || '').gsub(/\A[[:space:]]+|[[:space:]]+\z/, "")
- self.original_description = (original_description || '').gsub(/\A[[:space:]]+|[[:space:]]+\z/, "")
- self.translated_description = (translated_description || '').gsub(/\A[[:space:]]+|[[:space:]]+\z/, "")
- end
-
- def original_present?
- original_title.present? || original_description.present?
- end
-
- def translated_present?
- translated_title.present? || translated_description.present?
- end
-
- def any_field_present?
- original_present? || translated_present?
- end
-
- module VersionMethods
- def create_version
- return unless saved_changes?
-
- if merge_version?
- merge_version
- else
- create_new_version
- end
- end
-
- def merge_version?
- previous_version && previous_version.updater == CurrentUser.user && previous_version.updated_at > 1.hour.ago
- end
-
- def merge_version
- previous_version.update(
- original_title: original_title,
- original_description: original_description,
- translated_title: translated_title,
- translated_description: translated_description,
- )
- end
-
- def create_new_version
- versions.create(
- :original_title => original_title,
- :original_description => original_description,
- :translated_title => translated_title,
- :translated_description => translated_description
- )
- end
-
- def revert_to(version)
- if post_id != version.post_id
- raise RevertError.new("You cannot revert to a previous artist commentary of another post.")
- end
-
- self.original_description = version.original_description
- self.original_title = version.original_title
- self.translated_description = version.translated_description
- self.translated_title = version.translated_title
- end
-
- def revert_to!(version)
- revert_to(version)
- save!
- end
- end
-
- extend SearchMethods
- include VersionMethods
-end
diff --git a/app/models/artist_commentary_version.rb b/app/models/artist_commentary_version.rb
deleted file mode 100644
index 806eadabc..000000000
--- a/app/models/artist_commentary_version.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class ArtistCommentaryVersion < ApplicationRecord
- belongs_to :post
- belongs_to_updater
- scope :for_user, ->(user_id) {where("updater_id = ?", user_id)}
-
- def self.search(params)
- q = super
-
- if params[:updater_id]
- q = q.where("updater_id = ?", params[:updater_id].to_i)
- end
-
- if params[:post_id]
- q = q.where("post_id = ?", params[:post_id].to_i)
- end
-
- q.apply_default_order(params)
- end
-end
diff --git a/app/models/tag.rb b/app/models/tag.rb
index 6e7ca1a79..2f2c96085 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -14,7 +14,7 @@ class Tag < ApplicationRecord
]
METATAGS = %w[
- -user user -approver approver commenter comm noter noteupdater artcomm
+ -user user -approver approver commenter comm noter noteupdater
-pool pool ordpool -fav fav -favoritedby favoritedby md5 -rating rating note -note
-locked locked width height mpixels ratio score favcount filesize source
-source id -id date age order limit -status status tagcount parent -parent
@@ -24,7 +24,7 @@ class Tag < ApplicationRecord
deletedby -deletedby votedup voteddown -votedup -voteddown duration
] + TagCategory.short_name_list.map {|x| "#{x}tags"} + COUNT_METATAGS + BOOLEAN_METATAGS
- SUBQUERY_METATAGS = %w[commenter comm noter noteupdater artcomm flagger -flagger appealer -appealer]
+ SUBQUERY_METATAGS = %w[commenter comm noter noteupdater flagger -flagger appealer -appealer]
ORDER_METATAGS = %w[
id id_desc
@@ -35,7 +35,6 @@ class Tag < ApplicationRecord
comment comment_asc
comment_bumped comment_bumped_asc
note note_asc
- artcomm artcomm_asc
mpixels mpixels_asc
portrait landscape
filesize filesize_asc
diff --git a/app/views/artist_commentaries/_form.html.erb b/app/views/artist_commentaries/_form.html.erb
deleted file mode 100644
index efc8918c1..000000000
--- a/app/views/artist_commentaries/_form.html.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-
If the artist of this image posted some interesting additional information about this work, you can copy it here. <%= link_to "View help.", help_page_path(id: "artist_commentary") %>