fix for tag blacklists, typo fixes
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
Danbooru.Blacklist.blacklists = [];
|
Danbooru.Blacklist.blacklists = [];
|
||||||
|
|
||||||
Danbooru.Blacklist.parse_entries = function() {
|
Danbooru.Blacklist.parse_entries = function() {
|
||||||
var entries = (Danbooru.meta("blacklisted-tags") || "").replace(/(rating:[qes])\w+/, "$1").split(/,/);
|
var entries = ($.parseJSON(Danbooru.meta("blacklisted-tags") || "[]")).replace(/(rating:[qes])\w+/, "$1").split(/,/);
|
||||||
$.each(entries, function(i, tags) {
|
$.each(entries, function(i, tags) {
|
||||||
var blacklist = {
|
var blacklist = {
|
||||||
"tags": tags,
|
"tags": tags,
|
||||||
|
|||||||
@@ -595,6 +595,11 @@ class Post < ActiveRecord::Base
|
|||||||
|
|
||||||
def fast_count(tags = "")
|
def fast_count(tags = "")
|
||||||
tags = tags.to_s.strip
|
tags = tags.to_s.strip
|
||||||
|
|
||||||
|
if tags.blank?
|
||||||
|
return Danbooru.config.blank_tag_search_fast_count || 1_000_000
|
||||||
|
end
|
||||||
|
|
||||||
count = get_count_from_cache(tags)
|
count = get_count_from_cache(tags)
|
||||||
if count.nil?
|
if count.nil?
|
||||||
if tags.blank? && Danbooru.config.blank_tag_search_fast_count
|
if tags.blank? && Danbooru.config.blank_tag_search_fast_count
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ class User < ActiveRecord::Base
|
|||||||
return {
|
return {
|
||||||
"Member" => Levels::MEMBER,
|
"Member" => Levels::MEMBER,
|
||||||
"Privileged" => Levels::PRIVILEGED,
|
"Privileged" => Levels::PRIVILEGED,
|
||||||
"Builder" => Levels::BUIDLER,
|
"Builder" => Levels::BUILDER,
|
||||||
"Contributor" => Levels::CONTRIBUTOR,
|
"Contributor" => Levels::CONTRIBUTOR,
|
||||||
"Janitor" => Levels::JANITOR,
|
"Janitor" => Levels::JANITOR,
|
||||||
"Moderator" => Levels::MODERATOR,
|
"Moderator" => Levels::MODERATOR,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<meta name="current-user-id" content="<%= CurrentUser.id %>">
|
<meta name="current-user-id" content="<%= CurrentUser.id %>">
|
||||||
<meta name="user-comment-threshold" content="<%= CurrentUser.comment_threshold %>">
|
<meta name="user-comment-threshold" content="<%= CurrentUser.comment_threshold %>">
|
||||||
<% unless CurrentUser.user.blacklisted_tags.blank? %>
|
<% unless CurrentUser.user.blacklisted_tags.blank? %>
|
||||||
<meta name="blacklisted-tags" content="<%= CurrentUser.user.blacklisted_tags %>">
|
<meta name="blacklisted-tags" content="<%= CurrentUser.user.blacklisted_tag_array.to_json %>">
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if flash[:notice] =~ /error/ %>
|
<% if flash[:notice] =~ /error/ %>
|
||||||
<meta name="errors" content="true">
|
<meta name="errors" content="true">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<tags type="array">
|
<tags type="array">
|
||||||
<% @tags.each do |tag| %>
|
<% @tags.each do |tag| %>
|
||||||
<tag name="<%= tag.name %>" id="<%= tag.id %>" ambiguous="false" created_at="<%= tag.created_at.strftime('%Y-%m-%d %H:%M') %>" count="<%= tag.post_count %>" type="<%= tag.category %>"></user>
|
<tag name="<%= tag.name %>" id="<%= tag.id %>" ambiguous="false" created_at="<%= tag.created_at.try(:strftime, '%Y-%m-%d %H:%M') %>" count="<%= tag.post_count %>" type="<%= tag.category %>"></user>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tags>
|
</tags>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<label for="search_category">Category</label>
|
<label for="search_category">Category</label>
|
||||||
<%= select "search", "category", Tag.canonical_tag_category_mapping.to_a %>
|
<%= select "search", "category", Danbooru.config.canonical_tag_category_mapping.to_a %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
|
|||||||
@@ -224,12 +224,13 @@ Danbooru::Application.routes.draw do
|
|||||||
match "/post/index.xml", :controller => "legacy", :action => "posts", :format => "xml"
|
match "/post/index.xml", :controller => "legacy", :action => "posts", :format => "xml"
|
||||||
match "/post/index.json", :controller => "legacy", :action => "posts", :format => "json"
|
match "/post/index.json", :controller => "legacy", :action => "posts", :format => "json"
|
||||||
match "/post/create.xml", :controller => "legacy", :action => "create_post"
|
match "/post/create.xml", :controller => "legacy", :action => "create_post"
|
||||||
match "/post/index" => redirect {|params, req| "/posts?tags=#{req.params[:tags].to_s.gsub(/ /, '%20')}&page=#{req.params[:page]}"}
|
match "/post/piclens", :controller => "legacy", :action => "unavailable"
|
||||||
match "/post" => redirect {|params, req| "/posts?tags=#{req.params[:tags].to_s.gsub(/ /, '%20')}&page=#{req.params[:page]}"}
|
match "/post/index" => redirect {|params, req| "/posts?tags=#{u(req.params[:tags])}&page=#{req.params[:page]}"}
|
||||||
|
match "/post" => redirect {|params, req| "/posts?tags=#{u(req.params[:tags])}&page=#{req.params[:page]}"}
|
||||||
match "/post/upload" => redirect("/uploads/new")
|
match "/post/upload" => redirect("/uploads/new")
|
||||||
match "/post/moderate" => redirect("/moderator/post/queue")
|
match "/post/moderate" => redirect("/moderator/post/queue")
|
||||||
match "/post/atom" => redirect {|params, req| "/posts.atom?tags=#{req.params[:tags].to_s.gsub(/ /, '%20')}"}
|
match "/post/atom" => redirect {|params, req| "/posts.atom?tags=#{u(req.params[:tags])}"}
|
||||||
match "/post/atom.feed" => redirect {|params, req| "/posts.atom?tags=#{req.params[:tags].to_s.gsub(/ /, '%20')}"}
|
match "/post/atom.feed" => redirect {|params, req| "/posts.atom?tags=#{u(req.params[:tags])}"}
|
||||||
match "/post/popular_by_day" => redirect("/explore/posts/popular")
|
match "/post/popular_by_day" => redirect("/explore/posts/popular")
|
||||||
match "/post/popular_by_week" => redirect("/explore/posts/popular")
|
match "/post/popular_by_week" => redirect("/explore/posts/popular")
|
||||||
match "/post/popular_by_month" => redirect("/explore/posts/popular")
|
match "/post/popular_by_month" => redirect("/explore/posts/popular")
|
||||||
@@ -255,7 +256,7 @@ Danbooru::Application.routes.draw do
|
|||||||
|
|
||||||
match "/wiki" => redirect {|params, req| "/wiki_pages?page=#{req.params[:page]}"}
|
match "/wiki" => redirect {|params, req| "/wiki_pages?page=#{req.params[:page]}"}
|
||||||
match "/wiki/index" => redirect {|params, req| "/wiki_pages?page=#{req.params[:page]}"}
|
match "/wiki/index" => redirect {|params, req| "/wiki_pages?page=#{req.params[:page]}"}
|
||||||
match "/wiki/show" => redirect {|params, req| "/wiki_pages?title=#{req.params[:title]}"}
|
match "/wiki/show" => redirect {|params, req| "/wiki_pages?title=#{u(req.params[:title])}"}
|
||||||
match "/wiki/recent_changes" => redirect("/wiki_page_versions")
|
match "/wiki/recent_changes" => redirect("/wiki_page_versions")
|
||||||
match "/wiki/history/:title" => redirect("/wiki_page_versions?title=%{title}")
|
match "/wiki/history/:title" => redirect("/wiki_page_versions?title=%{title}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user