This artist has requested removal of their information.
+ <% if wiki_content.artist %>
+
<%= link_to "View artist", wiki_content.artist %>
<% end %>
+
+ <%= wiki_page_alias_and_implication_list(wiki_content) %>
<%= wiki_page_post_previews(wiki_content) %>
diff --git a/db/fixes/123_convert_staffnote_to_deleted_feedback.rb b/db/fixes/123_convert_staffnote_to_deleted_feedback.rb
index 420e05fa2..77c698afa 100755
--- a/db/fixes/123_convert_staffnote_to_deleted_feedback.rb
+++ b/db/fixes/123_convert_staffnote_to_deleted_feedback.rb
@@ -8,23 +8,26 @@ destroyed_feedback_ids = []
CurrentUser.as_system do
ModAction.where(action: "user_feedback_destroy")
# On July 24, 2024, we deployed the ability to soft-delete feedback records.
- # We only care about restoring destroyed feedbacks that were destroyed before this date.
- # Any entries after this are "real" destructions, that do not need to be restored.
+ # We only restore feedback that was destroyed before this date.
+ # Any entries after this are intentional destructions that do not need to be restored.
.where("created_at < ?", CUTOFF_DATE = Date.new(2024, 8, 1))
.find_in_batches(batch_size: 10_000) do |batch|
- feedback_data = batch.map do |mod_action|
- record_id = mod_action.values["record_id"].to_i
+ feedback_data = batch.filter_map do |mod_action|
+ record_id = mod_action.values["record_id"]
+ category = mod_action.values["type"]
+ body = mod_action.values["reason"]
+
+ # Old mod actions do not contain the necessary information. Skip them.
+ next if record_id.nil? || category.nil? || body.nil?
+
destroyed_feedback_ids << record_id
- # old mod actions do not contain the necessary information. we skip them.
- next if mod_action.values["type"].nil? || mod_action.values["reason"].nil?
-
{
- id: record_id,
+ id: record_id.to_i,
user_id: mod_action.values["user_id"].to_i,
creator_id: User.system.id, # placeholder
- category: mod_action.values["type"],
- body: mod_action.values["reason"]&.strip,
+ category: category,
+ body: body.strip,
created_at: Date.new(1970, 1, 1), # placeholder
updated_at: mod_action.created_at,
updater_id: mod_action.creator_id,
diff --git a/public/fonts/Lato/Lato-Bold.woff b/public/fonts/Lato/Lato-Bold.woff
new file mode 100644
index 000000000..42ad21805
Binary files /dev/null and b/public/fonts/Lato/Lato-Bold.woff differ
diff --git a/public/fonts/Lato/Lato-Bold.woff2 b/public/fonts/Lato/Lato-Bold.woff2
new file mode 100644
index 000000000..fc199e883
Binary files /dev/null and b/public/fonts/Lato/Lato-Bold.woff2 differ
diff --git a/public/fonts/Lato/Lato-BoldItalic.woff b/public/fonts/Lato/Lato-BoldItalic.woff
new file mode 100644
index 000000000..d7b971438
Binary files /dev/null and b/public/fonts/Lato/Lato-BoldItalic.woff differ
diff --git a/public/fonts/Lato/Lato-BoldItalic.woff2 b/public/fonts/Lato/Lato-BoldItalic.woff2
new file mode 100644
index 000000000..09c1c1b7f
Binary files /dev/null and b/public/fonts/Lato/Lato-BoldItalic.woff2 differ
diff --git a/public/fonts/Lato/Lato-Italic.woff b/public/fonts/Lato/Lato-Italic.woff
new file mode 100644
index 000000000..ed5c58858
Binary files /dev/null and b/public/fonts/Lato/Lato-Italic.woff differ
diff --git a/public/fonts/Lato/Lato-Italic.woff2 b/public/fonts/Lato/Lato-Italic.woff2
new file mode 100644
index 000000000..411566f32
Binary files /dev/null and b/public/fonts/Lato/Lato-Italic.woff2 differ
diff --git a/public/fonts/Lato/Lato-Regular.woff b/public/fonts/Lato/Lato-Regular.woff
new file mode 100644
index 000000000..f8f00acca
Binary files /dev/null and b/public/fonts/Lato/Lato-Regular.woff differ
diff --git a/public/fonts/Lato/Lato-Regular.woff2 b/public/fonts/Lato/Lato-Regular.woff2
new file mode 100644
index 000000000..74d3ef060
Binary files /dev/null and b/public/fonts/Lato/Lato-Regular.woff2 differ
diff --git a/public/fonts/Lexend/Lexend-Bold.woff b/public/fonts/Lexend/Lexend-Bold.woff
new file mode 100644
index 000000000..7b1ff1616
Binary files /dev/null and b/public/fonts/Lexend/Lexend-Bold.woff differ
diff --git a/public/fonts/Lexend/Lexend-Bold.woff2 b/public/fonts/Lexend/Lexend-Bold.woff2
new file mode 100644
index 000000000..957ed6f0d
Binary files /dev/null and b/public/fonts/Lexend/Lexend-Bold.woff2 differ
diff --git a/public/fonts/Lexend/Lexend-BoldItalic.woff b/public/fonts/Lexend/Lexend-BoldItalic.woff
new file mode 100644
index 000000000..df7e18155
Binary files /dev/null and b/public/fonts/Lexend/Lexend-BoldItalic.woff differ
diff --git a/public/fonts/Lexend/Lexend-BoldItalic.woff2 b/public/fonts/Lexend/Lexend-BoldItalic.woff2
new file mode 100644
index 000000000..3d66cfeb4
Binary files /dev/null and b/public/fonts/Lexend/Lexend-BoldItalic.woff2 differ
diff --git a/public/fonts/Lexend/Lexend-Italic.woff b/public/fonts/Lexend/Lexend-Italic.woff
new file mode 100644
index 000000000..4123bc019
Binary files /dev/null and b/public/fonts/Lexend/Lexend-Italic.woff differ
diff --git a/public/fonts/Lexend/Lexend-Italic.woff2 b/public/fonts/Lexend/Lexend-Italic.woff2
new file mode 100644
index 000000000..01e6b4f95
Binary files /dev/null and b/public/fonts/Lexend/Lexend-Italic.woff2 differ
diff --git a/public/fonts/Lexend/Lexend-Regular.woff b/public/fonts/Lexend/Lexend-Regular.woff
new file mode 100644
index 000000000..ff8c74b75
Binary files /dev/null and b/public/fonts/Lexend/Lexend-Regular.woff differ
diff --git a/public/fonts/Lexend/Lexend-Regular.woff2 b/public/fonts/Lexend/Lexend-Regular.woff2
new file mode 100644
index 000000000..75d647159
Binary files /dev/null and b/public/fonts/Lexend/Lexend-Regular.woff2 differ
diff --git a/public/fonts/OpenDyslexic/OpenDyslexic-Bold.woff b/public/fonts/OpenDyslexic/OpenDyslexic-Bold.woff
new file mode 100644
index 000000000..021b2e6e2
Binary files /dev/null and b/public/fonts/OpenDyslexic/OpenDyslexic-Bold.woff differ
diff --git a/public/fonts/OpenDyslexic/OpenDyslexic-Bold.woff2 b/public/fonts/OpenDyslexic/OpenDyslexic-Bold.woff2
new file mode 100644
index 000000000..52c3ad4b7
Binary files /dev/null and b/public/fonts/OpenDyslexic/OpenDyslexic-Bold.woff2 differ
diff --git a/public/fonts/OpenDyslexic/OpenDyslexic-BoldItalic.woff b/public/fonts/OpenDyslexic/OpenDyslexic-BoldItalic.woff
new file mode 100644
index 000000000..59abdf3e7
Binary files /dev/null and b/public/fonts/OpenDyslexic/OpenDyslexic-BoldItalic.woff differ
diff --git a/public/fonts/OpenDyslexic/OpenDyslexic-BoldItalic.woff2 b/public/fonts/OpenDyslexic/OpenDyslexic-BoldItalic.woff2
new file mode 100644
index 000000000..a7d4088d9
Binary files /dev/null and b/public/fonts/OpenDyslexic/OpenDyslexic-BoldItalic.woff2 differ
diff --git a/public/fonts/OpenDyslexic/OpenDyslexic-Italic.woff b/public/fonts/OpenDyslexic/OpenDyslexic-Italic.woff
new file mode 100644
index 000000000..92ecdf5ec
Binary files /dev/null and b/public/fonts/OpenDyslexic/OpenDyslexic-Italic.woff differ
diff --git a/public/fonts/OpenDyslexic/OpenDyslexic-Italic.woff2 b/public/fonts/OpenDyslexic/OpenDyslexic-Italic.woff2
new file mode 100644
index 000000000..a46d8ee76
Binary files /dev/null and b/public/fonts/OpenDyslexic/OpenDyslexic-Italic.woff2 differ
diff --git a/public/fonts/OpenDyslexic/OpenDyslexic-Regular.woff b/public/fonts/OpenDyslexic/OpenDyslexic-Regular.woff
new file mode 100644
index 000000000..9fd577775
Binary files /dev/null and b/public/fonts/OpenDyslexic/OpenDyslexic-Regular.woff differ
diff --git a/public/fonts/OpenDyslexic/OpenDyslexic-Regular.woff2 b/public/fonts/OpenDyslexic/OpenDyslexic-Regular.woff2
new file mode 100644
index 000000000..4c68de2c3
Binary files /dev/null and b/public/fonts/OpenDyslexic/OpenDyslexic-Regular.woff2 differ
diff --git a/public/fonts/OpenSans/OpenSans-Bold.woff b/public/fonts/OpenSans/OpenSans-Bold.woff
new file mode 100644
index 000000000..3ad546b0e
Binary files /dev/null and b/public/fonts/OpenSans/OpenSans-Bold.woff differ
diff --git a/public/fonts/OpenSans/OpenSans-Bold.woff2 b/public/fonts/OpenSans/OpenSans-Bold.woff2
new file mode 100644
index 000000000..3184f1071
Binary files /dev/null and b/public/fonts/OpenSans/OpenSans-Bold.woff2 differ
diff --git a/public/fonts/OpenSans/OpenSans-BoldItalic.woff b/public/fonts/OpenSans/OpenSans-BoldItalic.woff
new file mode 100644
index 000000000..8d47fd763
Binary files /dev/null and b/public/fonts/OpenSans/OpenSans-BoldItalic.woff differ
diff --git a/public/fonts/OpenSans/OpenSans-BoldItalic.woff2 b/public/fonts/OpenSans/OpenSans-BoldItalic.woff2
new file mode 100644
index 000000000..67464ede0
Binary files /dev/null and b/public/fonts/OpenSans/OpenSans-BoldItalic.woff2 differ
diff --git a/public/fonts/OpenSans/OpenSans-Italic.woff b/public/fonts/OpenSans/OpenSans-Italic.woff
new file mode 100644
index 000000000..269dc4909
Binary files /dev/null and b/public/fonts/OpenSans/OpenSans-Italic.woff differ
diff --git a/public/fonts/OpenSans/OpenSans-Italic.woff2 b/public/fonts/OpenSans/OpenSans-Italic.woff2
new file mode 100644
index 000000000..9b61ad74f
Binary files /dev/null and b/public/fonts/OpenSans/OpenSans-Italic.woff2 differ
diff --git a/public/fonts/OpenSans/OpenSans-Regular.woff b/public/fonts/OpenSans/OpenSans-Regular.woff
new file mode 100644
index 000000000..0fa88a4c5
Binary files /dev/null and b/public/fonts/OpenSans/OpenSans-Regular.woff differ
diff --git a/public/fonts/OpenSans/OpenSans-Regular.woff2 b/public/fonts/OpenSans/OpenSans-Regular.woff2
new file mode 100644
index 000000000..c87ee2fbf
Binary files /dev/null and b/public/fonts/OpenSans/OpenSans-Regular.woff2 differ
diff --git a/test/functional/wiki_pages_controller_test.rb b/test/functional/wiki_pages_controller_test.rb
index ca29c2462..15ddf5dfe 100644
--- a/test/functional/wiki_pages_controller_test.rb
+++ b/test/functional/wiki_pages_controller_test.rb
@@ -12,8 +12,8 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
context "index action" do
setup do
as(@user) do
- @wiki_page_abc = create(:wiki_page, :title => "abc")
- @wiki_page_def = create(:wiki_page, :title => "def")
+ @wiki_page_abc = create(:wiki_page, title: "abc")
+ @wiki_page_def = create(:wiki_page, title: "def")
end
end
@@ -23,12 +23,12 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
end
should "list all wiki_pages (with search)" do
- get wiki_pages_path, params: {:search => {:title => "abc"}}
+ get wiki_pages_path, params: { search: { title: "abc" } }
assert_redirected_to(wiki_page_path(@wiki_page_abc))
end
should "list wiki_pages without tags with order=post_count" do
- get wiki_pages_path, params: {:search => {:title => "abc", :order => "post_count"}}
+ get wiki_pages_path, params: { search: { title: "abc", order: "post_count" } }
assert_redirected_to(wiki_page_path(@wiki_page_abc))
end
end
@@ -46,7 +46,7 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
end
should "render for a title" do
- get wiki_page_path(:id => @wiki_page.title)
+ get wiki_page_path(id: @wiki_page.title)
assert_response :success
end
@@ -64,7 +64,7 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
as(@user) do
@wiki_page.update(title: "-aaa")
end
- get wiki_page_path(:id => @wiki_page.id)
+ get wiki_page_path(id: @wiki_page.id)
assert_response :success
end
end
@@ -89,7 +89,7 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
context "new action" do
should "render" do
- get_auth new_wiki_page_path, @mod, params: { wiki_page: { title: "test" }}
+ get_auth new_wiki_page_path, @mod, params: { wiki_page: { title: "test" } }
assert_response :success
end
end
@@ -108,7 +108,55 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
context "create action" do
should "create a wiki_page" do
assert_difference("WikiPage.count", 1) do
- post_auth wiki_pages_path, @user, params: {:wiki_page => {:title => "abc", :body => "abc"}}
+ post_auth wiki_pages_path, @user, params: { wiki_page: { title: "abc", body: "abc" } }
+ end
+ end
+
+ context "with prefix" do
+ should "work" do
+ assert_difference(%w[WikiPage.count Tag.count], 1) do
+ post_auth wiki_pages_path, @user, params: { wiki_page: { title: "character:abc", body: "abc" } }
+ end
+ @wiki = WikiPage.last
+ assert_equal("abc", @wiki.title)
+ assert_equal(Tag.categories.character, @wiki.category_id)
+ end
+
+ should "not work for disallowed prefixes" do
+ assert_no_difference("WikiPage.count") do
+ post_auth wiki_pages_path, @user, params: { wiki_page: { title: "lore:abc", body: "abc" } }
+ end
+ end
+
+ should "not work for tags over the threshold" do
+ @tag = create(:tag, post_count: 500)
+ assert_no_difference("WikiPage.count") do
+ post_auth wiki_pages_path, @user, params: { wiki_page: { title: "character:#{@tag.name}", body: "abc" } }
+ end
+ end
+ end
+
+ context "with category_id" do
+ should "work" do
+ assert_difference(%w[WikiPage.count Tag.count], 1) do
+ post_auth wiki_pages_path, @user, params: { wiki_page: { title: "abc", body: "abc", category_id: Tag.categories.character } }
+ end
+ @wiki = WikiPage.last
+ assert_equal("abc", @wiki.title)
+ assert_equal(Tag.categories.character, @wiki.category_id)
+ end
+
+ should "not work for disallowed categories" do
+ assert_no_difference("WikiPage.count") do
+ post_auth wiki_pages_path, @user, params: { wiki_page: { title: "abc", body: "abc", category_id: Tag.categories.lore } }
+ end
+ end
+
+ should "not work for tags over the threshold" do
+ @tag = create(:tag, post_count: 500)
+ assert_no_difference("WikiPage.count") do
+ post_auth wiki_pages_path, @user, params: { wiki_page: { title: @tag.name, body: "abc", category_id: Tag.categories.character } }
+ end
end
end
end
@@ -122,18 +170,18 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
end
should "update a wiki_page" do
- put_auth wiki_page_path(@wiki_page), @user, params: {:wiki_page => {:body => "xyz"}}
+ put_auth wiki_page_path(@wiki_page), @user, params: { wiki_page: { body: "xyz" } }
@wiki_page.reload
assert_equal("xyz", @wiki_page.body)
end
should "not rename a wiki page with a non-empty tag" do
- put_auth wiki_page_path(@wiki_page), @user, params: {:wiki_page => {:title => "bar"}}
+ put_auth wiki_page_path(@wiki_page), @user, params: { wiki_page: { title: "bar"}}
assert_equal("foo", @wiki_page.reload.title)
end
should "rename a wiki page with a non-empty tag if secondary validations are skipped" do
- put_auth wiki_page_path(@wiki_page), @mod, params: {:wiki_page => {:title => "bar", :skip_secondary_validations => "1"}}
+ put_auth wiki_page_path(@wiki_page), @mod, params: { wiki_page: { title: "bar", skip_secondary_validations: "1" } }
assert_equal("bar", @wiki_page.reload.title)
end
@@ -141,6 +189,27 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
put_auth wiki_page_path(@wiki_page), @user, params: {wiki_page: { is_deleted: true }}
assert_equal(false, @wiki_page.reload.is_deleted?)
end
+
+ context "with category_id" do
+ should "work" do
+ put_auth wiki_page_path(@wiki_page), @user, params: { wiki_page: { category_id: Tag.categories.character } }
+ @wiki_page.reload
+ assert_equal(Tag.categories.character, @wiki_page.category_id)
+ end
+
+ should "not work for disallowed categories" do
+ put_auth wiki_page_path(@wiki_page), @user, params: { wiki_page: { category_id: Tag.categories.lore } }
+ @wiki_page.reload
+ assert_equal(Tag.categories.general, @wiki_page.category_id)
+ end
+
+ should "not work for tags over the threshold" do
+ @tag.update_column(:post_count, 500)
+ put_auth wiki_page_path(@wiki_page), @user, params: { wiki_page: { category_id: Tag.categories.character } }
+ @wiki_page.reload
+ assert_equal(Tag.categories.general, @wiki_page.category_id)
+ end
+ end
end
context "destroy action" do
@@ -172,7 +241,7 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
should "revert to a previous version" do
version = @wiki_page.versions.first
assert_equal("1", version.body)
- put_auth revert_wiki_page_path(@wiki_page), @user, params: {:version_id => version.id}
+ put_auth revert_wiki_page_path(@wiki_page), @user, params: { version_id: version.id }
@wiki_page.reload
assert_equal("1", @wiki_page.body)
end
@@ -182,7 +251,7 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
@wiki_page_2 = create(:wiki_page)
end
- put_auth revert_wiki_page_path(@wiki_page), @user, params: { :version_id => @wiki_page_2.versions.first.id }
+ put_auth revert_wiki_page_path(@wiki_page), @user, params: { version_id: @wiki_page_2.versions.first.id }
@wiki_page.reload
assert_not_equal(@wiki_page.body, @wiki_page_2.body)