diff --git a/app/assets/stylesheets/specific/posts.scss b/app/assets/stylesheets/specific/posts.scss index 93d15ba01..4c39fe95d 100644 --- a/app/assets/stylesheets/specific/posts.scss +++ b/app/assets/stylesheets/specific/posts.scss @@ -211,6 +211,14 @@ body[data-user-can-approve-posts="true"] .post-preview { } } +.category-5 a, a.tag-type-5, .ui-state-focus a.tag-type-5 { + color: #F80; + + &:hover { + color: #FA6; + } +} + .category-banned a, a.tag-type-banned,, .ui-state-focus a.tag-type-banned { color: black; background-color: red; diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index 6e01f2223..f8cd969cb 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -265,6 +265,14 @@ module Danbooru "formatstr" => "drawn by %s" }, "relatedtag" => "Artists" + }, + "meta" => { + "category" => 5, + "short" => "meta", + "extra" => [], + "header" => "

Meta

", + "humanized" => nil, + "relatedtag" => nil } } end @@ -304,12 +312,12 @@ module Danbooru #Sets the order of the split tag header list (presenters/tag_set_presenter.rb) def split_tag_header_list - @split_tag_header_list ||= ["copyright","character","artist","general"] + @split_tag_header_list ||= ["copyright","character","artist","general","meta"] end #Sets the order of the categorized tag string (presenters/post_presenter.rb) def categorized_tag_list - @categorized_tag_list ||= ["copyright","character","artist","general"] + @categorized_tag_list ||= ["copyright","character","artist","meta","general"] end #Sets the order of the related tag buttons (javascripts/related_tag.js) diff --git a/db/migrate/20171106075030_add_tag_count_meta_to_posts.rb b/db/migrate/20171106075030_add_tag_count_meta_to_posts.rb new file mode 100644 index 000000000..c82afaf66 --- /dev/null +++ b/db/migrate/20171106075030_add_tag_count_meta_to_posts.rb @@ -0,0 +1,7 @@ +class AddTagCountMetaToPosts < ActiveRecord::Migration + def change + Post.without_timeout do + add_column :posts, :tag_count_meta, :integer, default: 0, null: false + end + end +end diff --git a/db/structure.sql b/db/structure.sql index d2010f071..5796ea19d 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2776,7 +2776,8 @@ CREATE TABLE posts ( pixiv_id integer, last_commented_at timestamp without time zone, has_active_children boolean DEFAULT false, - bit_flags bigint DEFAULT 0 NOT NULL + bit_flags bigint DEFAULT 0 NOT NULL, + tag_count_meta integer DEFAULT 0 NOT NULL ); @@ -7518,3 +7519,5 @@ INSERT INTO schema_migrations (version) VALUES ('20170709190409'); INSERT INTO schema_migrations (version) VALUES ('20170914200122'); +INSERT INTO schema_migrations (version) VALUES ('20171106075030'); + diff --git a/test/unit/tag_test.rb b/test/unit/tag_test.rb index 3d9778f90..f2d16eb12 100644 --- a/test/unit/tag_test.rb +++ b/test/unit/tag_test.rb @@ -61,6 +61,7 @@ class TagTest < ActiveSupport::TestCase assert_equal(1, Tag.categories.artist) assert_equal(3, Tag.categories.copyright) assert_equal(4, Tag.categories.character) + assert_equal(5, Tag.categories.meta) end should "have a regular expression for matching category names and shortcuts" do @@ -74,6 +75,7 @@ class TagTest < ActiveSupport::TestCase assert_match(regexp, "character") assert_match(regexp, "char") assert_match(regexp, "ch") + assert_match(regexp, "meta") assert_no_match(regexp, "c") assert_no_match(regexp, "woodle") end @@ -83,6 +85,7 @@ class TagTest < ActiveSupport::TestCase assert_equal(0, Tag.categories.value_for("gen")) assert_equal(1, Tag.categories.value_for("artist")) assert_equal(1, Tag.categories.value_for("art")) + assert_equal(5, Tag.categories.value_for("meta")) assert_equal(0, Tag.categories.value_for("unknown")) end end