Skip to content
Browse files

Display unwrangleable tags on wrangle pages and don't include then in…

… unfilterable lists
  • Loading branch information...
1 parent 67cdc5c commit 2544aa9bd3b058256aaad3ecea89fc704b54d04b @elzj elzj committed Apr 15, 2012
Showing with 8 additions and 4 deletions.
  1. +1 −1 app/controllers/tags_controller.rb
  2. +2 −1 app/models/tag.rb
  3. +5 −2 app/views/tags/wrangle.html.erb
View
2 app/controllers/tags_controller.rb
@@ -250,7 +250,7 @@ def wrangle
sort = sort + ", name ASC"
end
# this makes sure params[:status] is safe
- if %w(unfilterable canonical noncanonical).include?(params[:status])
+ if %w(unfilterable canonical noncanonical unwrangleable).include?(params[:status])
@tags = @tag.send(params[:show]).order(sort).send(params[:status]).paginate(:page => params[:page], :per_page => ArchiveConfig.ITEMS_PER_PAGE)
elsif params[:status] == "unwrangled"
@tags = @tag.same_work_tags.unwrangled.by_type(params[:show].singularize.camelize).order(sort).paginate(:page => params[:page], :per_page => ArchiveConfig.ITEMS_PER_PAGE)
View
3 app/models/tag.rb
@@ -137,7 +137,8 @@ def update_wrangler(tag)
scope :canonical, where(:canonical => true)
scope :noncanonical, where(:canonical => false)
scope :nonsynonymous, noncanonical.where(:merger_id => nil)
- scope :unfilterable, nonsynonymous
+ scope :unfilterable, nonsynonymous.where(:unwrangleable => false)
+ scope :unwrangleable, where(:unwrangleable => true)
# we need to manually specify a LEFT JOIN instead of just joins(:common_taggings or :meta_taggings) here because
# what we actually need are the empty rows in the results
View
7 app/views/tags/wrangle.html.erb
@@ -50,6 +50,7 @@
<li><%= link_to 'non-canonical', url_for(:show => params[:show], :status => 'noncanonical') %></li>
<li><%= link_to 'unfilterable', url_for(:show => params[:show], :status => 'unfilterable'), :title => "non-canonical tags without synonyms" %></li>
<li><%= link_to 'unwrangled', url_for(:show => params[:show], :status => 'unwrangled'), :title => "tags which were used on the same works but haven't been wrangled yet" %></li>
+ <li><%= link_to 'unwrangleable', url_for(:show => params[:show], :status => 'unwrangleable'), :title => "tags marked unwrangleable" %>
</ul>
<% end %>
@@ -104,9 +105,11 @@
<% end %>
<td title="canonical?">
<% if tag.canonical? %>
- Yes
+ Yes
+ <% elsif tag.unwrangleable? %>
+ Unwrangleable
<% else %>
- <%= check_box_tag "canonicals[]", tag.id, tag.canonical?, :id => "canonicals_#{tag.id}" %>
+ <%= check_box_tag "canonicals[]", tag.id, tag.canonical?, :id => "canonicals_#{tag.id}" %>
<% end %>
</td>
<td title="metatag or synonym">

0 comments on commit 2544aa9

Please sign in to comment.
Something went wrong with that request. Please try again.