Commit 8004c6978be77fb64bcdf6762ce1b2e016e4454e

Authored by AntonioTerceiro
1 parent 0c178e76

r220@sede: terceiro | 2007-07-28 14:36:41 -0300

ActionItem7: adding admin_panel controller
 


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@224 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/admin_panel_controller.rb 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +class AdminPanelController < ApplicationController
  2 +end
... ...
app/helpers/admin_panel_helper.rb 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +module AdminPanelHelper
  2 +end
... ...
app/views/admin_panel/index.rhtml 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +<h1><%= _('Administrator Panel') %></h1>
  2 +
  3 +<p><%= _('You, as an virtual community administrator, has the following options:')%></p>
  4 +
  5 +<ul>
  6 + <li><%= link_to _('Enable/disable features'), :controller => 'features' %></li>
  7 + <li><%= link_to _('Manage Tags'), :controller => 'manage_tags' %></li>
  8 + <li><%= link_to _('Edit the Visual Design'), :controller => 'edit_template'%></li>
  9 +</ul>
... ...
config/routes.rb
... ... @@ -26,6 +26,7 @@ ActionController::Routing::Routes.draw do |map|
26 26 map.comatose_admin 'cms/:profile'
27 27  
28 28 # administrative tasks for a virtual community
  29 + map.connect 'admin', :controller => 'admin_panel', :action => 'index'
29 30 map.connect 'admin/:controller/:action/:id'
30 31  
31 32  
... ...
test/functional/admin_panel_controller_test.rb 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +require File.dirname(__FILE__) + '/../test_helper'
  2 +require 'admin_panel_controller'
  3 +
  4 +# Re-raise errors caught by the controller.
  5 +class AdminPanelController; def rescue_action(e) raise e end; end
  6 +
  7 +class AdminPanelControllerTest < Test::Unit::TestCase
  8 + def setup
  9 + @controller = AdminPanelController.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
... ...
test/integration/routing_test.rb
... ... @@ -34,11 +34,21 @@ class RoutingTest &lt; ActionController::IntegrationTest
34 34  
35 35 # virtual community administrative controllers (admin/*)
36 36 ################################################################
  37 +
  38 + def test_admin_panel_controller
  39 + assert_routing('/admin', :controller => 'admin_panel', :action => 'index')
  40 + end
  41 +
37 42 def test_features_controller
38 43 assert_routing('/admin/features', :controller => 'features', :action => 'index')
  44 + assert_routing('/admin/features/update', :controller => 'features', :action => 'update')
  45 + end
  46 +
  47 + def test_manage_tags_controller
  48 + assert_routing('/admin/manage_tags', :controller => 'manage_tags', :action => 'index')
39 49 end
40 50  
41   - # platform administrative conttollers (metaadmin/*)
  51 + # platform administrative controllers (metaadmin/*)
42 52 ################################################################
43 53  
44 54 # external public controllers
... ...