Commit 3f2d9656ceb288d4d98902aef4e1e413c142fb61
1 parent
7ebe26c3
Exists in
master
and in
29 other branches
ActionItem70: skeleton for categories management
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@524 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
41 additions
and
0 deletions
Show diff stats
app/controllers/environment_admin/categories_controller.rb
0 → 100644
@@ -0,0 +1,12 @@ | @@ -0,0 +1,12 @@ | ||
1 | +<li> | ||
2 | +<%= category.name %> | ||
3 | +<div> | ||
4 | + <%= link_to _('Add subcategory'), :action => 'new', :parent => category %> | ||
5 | + <%= link_to _('Remove'), { :action => 'remove', :id => category, }, :post => true, :confirm => (category.children.empty? ? (_('Are you sure you want to remove "%s"?') % category.name) : (_('Are you sure you want to remove "%s" and all its subcategories?') % category.name) ) %> | ||
6 | +</div> | ||
7 | +<% unless category.children.empty? %> | ||
8 | + <ul> | ||
9 | + <%= render :partial => 'category', :collection => category.children %> | ||
10 | + </ul> | ||
11 | +<% end %> | ||
12 | +</li> |
@@ -0,0 +1,18 @@ | @@ -0,0 +1,18 @@ | ||
1 | +require File.dirname(__FILE__) + '/../test_helper' | ||
2 | +require 'categories_controller' | ||
3 | + | ||
4 | +# Re-raise errors caught by the controller. | ||
5 | +class CategoriesController; def rescue_action(e) raise e end; end | ||
6 | + | ||
7 | +class CategoriesControllerTest < Test::Unit::TestCase | ||
8 | + def setup | ||
9 | + @controller = CategoriesController.new | ||
10 | + @request = ActionController::TestRequest.new | ||
11 | + @response = ActionController::TestResponse.new | ||
12 | + end | ||
13 | + | ||
14 | + # Replace this with your real tests. | ||
15 | + def test_truth | ||
16 | + assert true | ||
17 | + end | ||
18 | +end |