add new tag alias correction helper

This commit is contained in:
albert
2013-03-05 22:08:48 -05:00
parent e10f15d2db
commit d9a17d2378
11 changed files with 185 additions and 16 deletions

View File

@@ -0,0 +1,25 @@
<h1>Tag Alias Correction: <%= @correction.antecedent_name %> -&gt; <%= @correction.consequent_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 and lingering posts.</p>
<% @correction.each_server do |correction| %>
<div style="margin-bottom: 1em;">
<h2>Server: <%= Socket.gethostname %></h2>
<ul>
<li><strong><%= @correction.antecedent_name %></strong> aliased to <strong><%= @correction.statistics_hash["antecedent_cache"] %></strong> in cache</li>
<li><strong><%= @correction.consequent_name %></strong> aliased to <strong><%= @correction.statistics_hash["consequent_cache"] %></strong> in cache</li>
<li><strong><%= @correction.antecedent_name %></strong> count is <%= @correction.statistics_hash["antecedent_count"] %></li>
<li><strong><%= @correction.consequent_name %></strong> count is <%= @correction.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) do %>
<%= hidden_field "tag_alias_id", params[:tag_alias_id] %>
<%= submit_tag "Fix" %>
<%= submit_tag "Cancel" %>
<% end %>
<%= render "tag_aliases/secondary_links" %>

View File

@@ -0,0 +1 @@
<%= raw @correction.to_json %>

View File

@@ -38,6 +38,10 @@
<% if tag_alias.is_pending? %>
| <%= link_to "Approve", approve_tag_alias_path(tag_alias), :remote => true, :method => :post %>
<% end %>
<% if CurrentUser.is_moderator? %>
| <%= link_to "Fix", tag_alias_correction_path(:tag_alias_id => tag_alias.id) %>
<% end %>
<% end %>
</td>
</tr>