add new tag category 'People'

This commit is contained in:
edshot99 2024-10-28 20:04:58 -05:00
parent 14f0384ea0
commit a3e00b591f
10 changed files with 35 additions and 6 deletions

View File

@ -34,6 +34,7 @@ module PostIndex
tag_count_species: { type: "integer" },
tag_count_invalid: { type: "integer" },
tag_count_lore: { type: "integer" },
tag_count_people: { type: "integer" },
comment_count: { type: "integer" },
file_size: { type: "integer" },
@ -243,6 +244,7 @@ module PostIndex
tag_count_species: tag_count_species,
tag_count_invalid: tag_count_invalid,
tag_count_lore: tag_count_lore,
tag_count_people: tag_count_people,
comment_count: options[:comment_count] || comment_count,
file_size: file_size,

View File

@ -13,6 +13,7 @@
<a href="#" @click.prevent="findRelated(1)">Artists</a> |
<a href="#" @click.prevent="findRelated(3)">Copyrights</a> |
<a href="#" @click.prevent="findRelated(4)">Characters</a> |
<a href="#" @click.prevent="findRelated(9)">People</a> |
<a href="#" @click.prevent="findRelated(5)">Species</a> |
<a href="#" @click.prevent="findRelated(7)">Metatags</a> |
<a href="#" @click.prevent="previewFinalTags">Preview Final Tags</a>

View File

@ -163,6 +163,7 @@
<a href="#" @click.prevent="findRelated(1)">Artists</a> |
<a href="#" @click.prevent="findRelated(3)">Copyrights</a> |
<a href="#" @click.prevent="findRelated(4)">Characters</a> |
<a href="#" @click.prevent="findRelated(9)">People</a> |
<a href="#" @click.prevent="findRelated(5)">Species</a> |
<a href="#" @click.prevent="findRelated(7)">Metatags</a> |
<a href="#" @click.prevent="previewFinalTags">Preview Final Tags</a>

View File

@ -161,7 +161,8 @@ $tag-categories: (
"5": "species",
"6": "invalid",
"7": "meta",
"8": "lore"
"8": "lore",
"9": "people"
);
$tag-categories-short: (
@ -172,5 +173,6 @@ $tag-categories-short: (
"spec": "species",
"inv": "invalid",
"meta": "meta",
"lor": "lore"
"lor": "lore",
"peo": "people"
)

View File

@ -104,6 +104,9 @@ body {
--color-tag-pool: wheat;
--color-tag-pool-alt: #d0b27a;
--color-tag-people: #dad88b;
--color-tag-people-alt: #ede660;
// Spoilers
--color-spoiler-link: #{$hexagon-color-link};
--color-spoiler-link-hover: #{$hexagon-color-link-hover};

View File

@ -81,6 +81,9 @@ body[data-th-main="photon"] {
--color-tag-pool: #{darken(#d0b27a, 10%)};
--color-tag-pool-alt: #{darken(wheat, 20%)};
--color-tag-people: #{darken(#dad88b, 40%)};
--color-tag-people-alt: #{darken(#ede660, 25%)};
// Spoilers
--color-spoiler-link: #{$photon-color-link};
--color-spoiler-link-hover: #{$photon-color-link-hover};

View File

@ -20,6 +20,8 @@ class TagCategory
"meta" => 7,
"lore" => 8,
"lor" => 8,
"people" => 9,
"peo" => 9,
}.freeze
CANONICAL_MAPPING = {
@ -31,6 +33,7 @@ class TagCategory
"Invalid" => 6,
"Meta" => 7,
"Lore" => 8,
"People" => 9,
}.freeze
REVERSE_MAPPING = {
@ -42,6 +45,7 @@ class TagCategory
6 => "invalid",
7 => "meta",
8 => "lore",
9 => "people",
}.freeze
SHORT_NAME_MAPPING = {
@ -53,6 +57,7 @@ class TagCategory
"inv" => "invalid",
"meta" => "meta",
"lor" => "lore",
"peo" => "people",
}.freeze
HEADER_MAPPING = {
@ -64,6 +69,7 @@ class TagCategory
"invalid" => "Invalid",
"meta" => "Meta",
"lore" => "Lore",
"people" => "People",
}.freeze
ADMIN_ONLY_MAPPING = {
@ -75,6 +81,7 @@ class TagCategory
"invalid" => true,
"meta" => true,
"lore" => true,
"people" => false,
}.freeze
HUMANIZED_MAPPING = {
@ -98,13 +105,13 @@ class TagCategory
},
}.freeze
CATEGORIES = %w[general species character copyright artist invalid lore meta].freeze
CATEGORIES = %w[general species character copyright artist invalid lore meta people].freeze
CATEGORY_IDS = CANONICAL_MAPPING.values
SHORT_NAME_LIST = SHORT_NAME_MAPPING.keys
HUMANIZED_LIST = %w[character copyright artist].freeze
SPLIT_HEADER_LIST = %w[invalid artist copyright character species general meta lore].freeze
CATEGORIZED_LIST = %w[invalid artist copyright character species meta general lore].freeze
SPLIT_HEADER_LIST = %w[invalid artist copyright character people species general meta lore].freeze
CATEGORIZED_LIST = %w[invalid artist copyright character people species meta general lore].freeze
SHORT_NAME_REGEX = SHORT_NAME_LIST.join("|").freeze
ALL_NAMES_REGEX = MAPPING.keys.join("|").freeze

View File

@ -93,6 +93,7 @@
["Meta tag count", "meta_tags", "total_tags"],
["Invalid tag count", "invalid_tags", "total_tags"],
["Lore tag count", "lore_tags", "total_tags"],
["People tag count", "people_tags", "total_tags"],
]
%>
</div>

View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddTagCountPeopleToPosts < ActiveRecord::Migration[7.1]
def change
add_column(:posts, :tag_count_people, :integer, null: false, default: 0)
end
end

View File

@ -1685,7 +1685,8 @@ CREATE TABLE public.posts (
bg_color character varying,
generated_samples character varying[],
duration numeric,
is_comment_disabled boolean DEFAULT false NOT NULL
is_comment_disabled boolean DEFAULT false NOT NULL,
tag_count_people integer DEFAULT 0 NOT NULL
);
@ -4676,6 +4677,7 @@ ALTER TABLE ONLY public.avoid_postings
SET search_path TO "$user", public;
INSERT INTO "schema_migrations" (version) VALUES
('20241001045543'),
('20240726170041'),
('20240709134926'),
('20240706061122'),