diff --git a/app/controllers/manage_tags_controller.rb b/app/controllers/manage_tags_controller.rb
index 6677801..ba574c3 100644
--- a/app/controllers/manage_tags_controller.rb
+++ b/app/controllers/manage_tags_controller.rb
@@ -5,7 +5,8 @@ class ManageTagsController < ApplicationController
end
def list
- @tags = Tag.find_all
+ @parent = Tag.find(params[:parent]) if params[:parent]
+ @tags = Tag.find_all_by_parent_id(params[:parent])
end
def new
diff --git a/app/views/manage_tags/_a_tag.rhtml b/app/views/manage_tags/_a_tag.rhtml
index c59d7e2..3d7d115 100644
--- a/app/views/manage_tags/_a_tag.rhtml
+++ b/app/views/manage_tags/_a_tag.rhtml
@@ -1,8 +1,9 @@
+<%= a_tag.id %>
<%= a_tag.name %>
<%= link_to _('Edit'), {:action => 'edit', :id => a_tag } %>
<%= link_to _('Destroy'), {:action => 'destroy', :id => a_tag} %>
-
+<%= link_to _('Filter by this tag'), {:action => 'list', :parent => a_tag} %>
<%= render :partial => 'a_tag', :collection => a_tag.children %>
diff --git a/app/views/manage_tags/list.rhtml b/app/views/manage_tags/list.rhtml
index 4c38493..be52c35 100644
--- a/app/views/manage_tags/list.rhtml
+++ b/app/views/manage_tags/list.rhtml
@@ -1,7 +1,8 @@
<%= _("Listing tags") %>
- <%= render :partial => 'a_tag', :collection => @tags.select{|t|!t.parent} %>
+ <%= render :partial => 'a_tag', :collection => @tags %>
+<%= link_to _('Up'), {:action => 'list', :parent => @parent.parent} if @parent %>
<%= link_to _('New tag'), {:action => 'new'} %>
diff --git a/db/migrate/007_acts_as_taggable_migration.rb b/db/migrate/007_acts_as_taggable_migration.rb
index bc18355..4d8b7ee 100644
--- a/db/migrate/007_acts_as_taggable_migration.rb
+++ b/db/migrate/007_acts_as_taggable_migration.rb
@@ -3,6 +3,7 @@ class ActsAsTaggableMigration < ActiveRecord::Migration
create_table :tags do |t|
t.column :name, :string
t.column :parent_id, :integer
+ t.column :pending, :bool
end
create_table :taggings do |t|
--
libgit2 0.21.2