* Refactored tag fix code

* Revert quick search open in new window behavior
This commit is contained in:
albert
2013-03-18 09:13:39 -07:00
parent a48ea51f55
commit 177baa9ec7
8 changed files with 93 additions and 10 deletions

View File

@@ -1,3 +1,3 @@
<%= form_tag(artists_path, :method => :get, :target => "_blank") do %>
<%= form_tag(artists_path, :method => :get) do %>
<%= text_field "search", "name" %>
<% end %>

View File

@@ -1,3 +1,3 @@
<%= form_tag(pools_path, :method => :get, :target => "_blank") do %>
<%= form_tag(pools_path, :method => :get) do %>
<%= text_field "search", "name_matches" %>
<% end %>

View File

@@ -1,8 +1,18 @@
<h1>Fix Tag</h1>
<p>You can fix the post count for this tag. It will update it from <%= @tag.post_count %> to <%= @tag.real_post_count %>.</p>
<% @correction.each_server do |server| %>
<div style="margin-bottom: 1em;">
<h2>Server: <%= server.hostname %></h2>
<ul>
<li><strong>category cache</strong>: <%= server.statistics_hash["category_cache"] %></li>
<li><strong>post fast count cache</strong>: <%= server.statistics_hash["post_fast_count_cache"] %></li>
<li><strong>post count</strong>: <%= @correction.tag.post_count %></li>
<li><strong>real post count:</strong> <%= @correction.tag.real_post_count %></li>
</ul>
</div>
<% end %>
<%= form_tag(tag_correction_path(:tag_id => @tag.id)) do %>
<%= form_tag(tag_correction_path(:tag_id => @correction.tag.id)) do %>
<%= submit_tag "Fix" %>
<%= submit_tag "Cancel" %>
<% end %>

View File

@@ -0,0 +1,24 @@
<h1>Tag Correction: <%= @correction.tag.name %></h1>
<p>Because tag aliases are cached in memory, they may go out of sync. This action will clear out the cache and fix any lingering posts.</p>
<% @correction.each_server do |server| %>
<div style="margin-bottom: 1em;">
<h2>Server: <%= server.hostname %></h2>
<ul>
<li><strong><%= server.antecedent_name %></strong> aliased to <strong><%= server.statistics_hash["antecedent_cache"] %></strong> in cache</li>
<li><strong><%= server.consequent_name %></strong> aliased to <strong><%= server.statistics_hash["consequent_cache"] %></strong> in cache</li>
<li><strong><%= server.antecedent_name %></strong> count is <%= server.statistics_hash["antecedent_count"] %></li>
<li><strong><%= server.consequent_name %></strong> count is <%= server.statistics_hash["consequent_count"] %></li>
</ul>
</div>
<% end %>
<p>You can try to fix this alias. This will clear the cache and re-save all posts associated with <strong><%= @correction.antecedent_name %></strong>.</p>
<%= form_tag(tag_alias_correction_path(:tag_alias_id => @correction.tag_alias_id)) do %>
<%= submit_tag "Fix" %>
<%= submit_tag "Cancel" %>
<% end %>
<%= render "tag_aliases/secondary_links" %>

View File

@@ -1,3 +1,3 @@
<%= form_tag(tags_path, :method => :get, :target => "_blank") do %>
<%= form_tag(tags_path, :method => :get) do %>
<%= text_field "search", "name_matches" %>
<% end %>