The following tags are aliased to this tag: "
- html << raw(consequent_aliases.map {|x| link_to(x.antecedent_name, show_or_new_wiki_pages_path(:title => x.antecedent_name))}.join(", "))
+ html << raw(consequent_aliases.map {|x| link_to(x.antecedent_name, show_or_new_wiki_pages_path(:title => x.antecedent_name, :no_redirect => true))}.join(", "))
html << ".
"
end
@@ -33,4 +33,17 @@ module WikiPagesHelper
html.html_safe
end
+
+ def wiki_page_post_previews(wiki_page)
+ html = '
'
+
+ if Post.fast_count(wiki_page.title) > 0
+ html << "
Posts
"
+ html << wiki_page.post_set.presenter.post_previews_html(self)
+ end
+
+ html << "
"
+
+ html.html_safe
+ end
end
diff --git a/app/logical/moderator/dashboard/report.rb b/app/logical/moderator/dashboard/report.rb
index 3694988f9..c3600e8ac 100644
--- a/app/logical/moderator/dashboard/report.rb
+++ b/app/logical/moderator/dashboard/report.rb
@@ -5,7 +5,7 @@ module Moderator
def initialize(min_date, max_level)
@min_date = min_date.present? ? min_date.to_date : 1.week.ago
- @max_level = max_level.present? ? User::Levels::MEMBER : max_level.to_i
+ @max_level = max_level.present? ? max_level.to_i : User::Levels::MEMBER
end
def artists
diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb
index 21db554ca..216194cc2 100644
--- a/app/logical/post_sets/post.rb
+++ b/app/logical/post_sets/post.rb
@@ -69,10 +69,6 @@ module PostSets
tag_string =~ /\*/
end
- def is_empty_search?
- posts.count == 0
- end
-
def current_page
[page.to_i, 1].max
end
diff --git a/app/logical/post_sets/wiki_page.rb b/app/logical/post_sets/wiki_page.rb
index 2c83d5c2c..22625fa43 100644
--- a/app/logical/post_sets/wiki_page.rb
+++ b/app/logical/post_sets/wiki_page.rb
@@ -2,7 +2,7 @@ module PostSets
class SearchError < Exception
end
- class WikiPage < Post
+ class WikiPage < PostSets::Post
def presenter
@presenter ||= ::PostSetPresenters::WikiPage.new(self)
end
diff --git a/app/models/user_feedback.rb b/app/models/user_feedback.rb
index 111a21eff..4ce908d07 100644
--- a/app/models/user_feedback.rb
+++ b/app/models/user_feedback.rb
@@ -47,6 +47,10 @@ class UserFeedback < ActiveRecord::Base
q = q.where("creator_id = (select _.id from users _ where lower(_.name) = ?)", params[:creator_name].mb_chars.downcase)
end
+ if params[:category].present?
+ q = q.where("category = ?", params[:category])
+ end
+
q
end
end
diff --git a/app/presenters/post_set_presenters/base.rb b/app/presenters/post_set_presenters/base.rb
index 5ceb51b9b..98976ca30 100644
--- a/app/presenters/post_set_presenters/base.rb
+++ b/app/presenters/post_set_presenters/base.rb
@@ -13,6 +13,7 @@ module PostSetPresenters
posts.each do |post|
html << PostPresenter.preview(post, :tags => @post_set.tag_string)
+ html << "\n"
end
html.html_safe
diff --git a/app/presenters/post_set_presenters/post.rb b/app/presenters/post_set_presenters/post.rb
index 6ebe62790..c24c9c7dc 100644
--- a/app/presenters/post_set_presenters/post.rb
+++ b/app/presenters/post_set_presenters/post.rb
@@ -9,9 +9,7 @@ module PostSetPresenters
end
def related_tags
- if post_set.is_empty_search?
- suggested_tags
- elsif post_set.is_pattern_search?
+ if post_set.is_pattern_search?
pattern_tags
elsif post_set.is_tag_subscription?
post_set.tag_subscription_tags
@@ -41,12 +39,6 @@ module PostSetPresenters
Tag.name_matches(post_set.tag_string).all(:select => "name", :limit => Danbooru.config.tag_query_limit, :order => "post_count DESC").map(&:name)
end
- def suggested_tags
- if post_set.tag_string.length >= 3
- Tag.name_matches("*#{post_set.tag_string}*").where("post_count > 0").all(:select => "name", :limit => Danbooru.config.tag_query_limit, :order => "post_count DESC").map(&:name)
- end
- end
-
def related_tags_for_group
RelatedTagCalculator.calculate_from_sample_to_array(post_set.tag_string).map(&:first)
end
diff --git a/app/presenters/post_set_presenters/wiki_page.rb b/app/presenters/post_set_presenters/wiki_page.rb
index 7d057b7c8..1299b2d6e 100644
--- a/app/presenters/post_set_presenters/wiki_page.rb
+++ b/app/presenters/post_set_presenters/wiki_page.rb
@@ -1,5 +1,5 @@
module PostSetPresenters
- class WikiPage < Post
+ class WikiPage < PostSetPresenters::Post
def posts
@post_set.posts
rescue ActiveRecord::StatementInvalid, PGError
diff --git a/app/views/comments/partials/new/_form.html.erb b/app/views/comments/partials/new/_form.html.erb
index c26b41e87..23e0b675b 100644
--- a/app/views/comments/partials/new/_form.html.erb
+++ b/app/views/comments/partials/new/_form.html.erb
@@ -4,6 +4,7 @@
<%= form_tag(comments_path, :class => "simple_form") do %>
<%= hidden_field "comment", "post_id", :value => post.id %>
<%= dtext_field "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
+ <%= submit_tag "Post" %>
<%= dtext_preview_button "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
- <%= submit_tag "Post" %> <%= check_box "comment", "do_not_bump_post", :id => "comment_do_not_bump_post_#{post.id}" %>
+ <%= check_box "comment", "do_not_bump_post", :id => "comment_do_not_bump_post_#{post.id}" %>
<% end %>
diff --git a/app/views/favorites/create.js.erb b/app/views/favorites/create.js.erb
index 6a0cc2912..01958716b 100644
--- a/app/views/favorites/create.js.erb
+++ b/app/views/favorites/create.js.erb
@@ -5,5 +5,11 @@
$("a#remove-from-favorites").show();
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
$("#favcount-for-post-<%= @post.id %>").html(<%= @post.fav_count %>);
+ <% if CurrentUser.is_gold? %>
+ $("#favlist").html("<%= escape_javascript(post_favlist(@post)) %>");
+ if (!$("#favlist").is(":visible")) {
+ $("#show-favlist-link").show();
+ }
+ <% end %>
Danbooru.notice("You have favorited this post");
<% end %>
diff --git a/app/views/favorites/destroy.js.erb b/app/views/favorites/destroy.js.erb
index 2ece21748..47b6a8003 100644
--- a/app/views/favorites/destroy.js.erb
+++ b/app/views/favorites/destroy.js.erb
@@ -2,4 +2,10 @@ $("a#add-to-favorites").show();
$("a#remove-from-favorites").hide();
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
$("#favcount-for-post-<%= @post.id %>").html(<%= @post.fav_count %>);
+<% if CurrentUser.is_gold? %>
+ $("#favlist").html("<%= escape_javascript(post_favlist(@post)) %>");
+ <% if @post.fav_count == 0 %>
+ $("#show-favlist-link, #hide-favlist-link, #favlist").hide();
+ <% end %>
+<% end %>
Danbooru.notice("You have unfavorited this post");
diff --git a/app/views/forum_posts/_forum_post.html.erb b/app/views/forum_posts/_forum_post.html.erb
index fe0899d74..5aa59276d 100644
--- a/app/views/forum_posts/_forum_post.html.erb
+++ b/app/views/forum_posts/_forum_post.html.erb
@@ -37,8 +37,11 @@