Commit 32a85ace2803206b29c6e1ce1f045b95c196b380

Authored by AntonioTerceiro
1 parent f45481d2

ActionItem93: removing unused code



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1053 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/my_profile/membership_editor_controller.rb
@@ -1,39 +0,0 @@ @@ -1,39 +0,0 @@
1 -class MembershipEditorController < MyProfileController  
2 -  
3 - before_filter :login_required  
4 -  
5 - def target  
6 - environment  
7 - end  
8 -  
9 - protect 'edit_profile', :profile, :only => [:index, :new_enterprise, :create_enterprise ]  
10 -  
11 - def index  
12 - @memberships = current_user.person.enterprise_memberships  
13 - end  
14 -  
15 - def new_enterprise  
16 - @enterprise = Enterprise.new()  
17 - @validation_entities = Organization.find(:all)  
18 - end  
19 -  
20 - def create_enterprise  
21 - @enterprise = Enterprise.new(params[:enterprise])  
22 - @enterprise.organization_info = OrganizationInfo.new(params[:organization])  
23 - if @enterprise.save  
24 - @enterprise.affiliate(current_user.person, Role.find(:all, :conditions => {:name => ['owner', 'member', 'moderator']}))  
25 - flash[:notice] = _('The enterprise was successfully created, the validation entity will cotact you as soon as your enterprise is approved')  
26 - redirect_to :action => 'index'  
27 - else  
28 - flash[:notice] = _('Enterprise was not created')  
29 - @validation_entities = Organization.find(:all)  
30 - render :action => 'register_form'  
31 - end  
32 - end  
33 -  
34 - # Search enterprises by name or tags  
35 - def search  
36 - @tagged_enterprises = Enterprise.search(params[:query])  
37 - end  
38 -  
39 -end  
app/views/membership_editor/_enterprise.rhtml
@@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
1 -<%= link_to enterprise.name, '/' + enterprise.identifier %>  
2 -  
app/views/membership_editor/_form.rhtml
@@ -1,32 +0,0 @@ @@ -1,32 +0,0 @@
1 -<p><label for="name"><%= _('Name') %></label><br/>  
2 -<%= text_field 'enterprise', 'name', 'size' => 20 %></p>  
3 -  
4 -<p><label for="address"><%= _('Address') %></label><br/>  
5 -<%= text_field 'enterprise', 'address', 'size' => 50 %></p>  
6 -  
7 -<p><label for="contact_phone"><%= _('Contact Phone') %></label><br/>  
8 -<%= text_field 'enterprise', 'contact_phone', 'size' => 20 %></p>  
9 -  
10 -<p><label for="contact_person"><%= _('Contact Person') %></label><br/>  
11 -<%= text_field 'organization_info', 'contact_person', 'size' => 20 %></p>  
12 -  
13 -<p><label for="acronym"><%= _('Acronym') %></label><br/>  
14 -<%= text_field 'organization_info', 'acronym', 'size' => 20 %></p>  
15 -  
16 -<p><label for="foundation_year"><%= _('Foundation Year') %></label><br/>  
17 -<%= text_field 'organization_info', 'foundation_year', 'size' => 20 %></p>  
18 -  
19 -<p><label for="legal_form"><%= _('Legal Form') %></label><br/>  
20 -<%= text_field 'organization_info', 'legal_form', 'size' => 20 %></p>  
21 -  
22 -<p><label for="economic_activity"><%= _('Economic Activity') %></label><br/>  
23 -<%= text_field 'organization_info', 'economic_activity', 'size' => 20 %></p>  
24 -  
25 -<p><label for="management_information"><%= _('Management Information') %></label><br/>  
26 -<%= text_editor 'organization_info', 'management_information' %></p>  
27 -  
28 -<p><label for="validation_entity"><%= _('Validation Entity') %></label><br/>  
29 -<%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id]}, :include_blank => true %></p>  
30 -  
31 -<p><label for="tag_list"><%= _('Tags') %></label><br/>  
32 -<%= text_field 'enterprise', 'tag_list', 'size' => 20 %></p>  
app/views/membership_editor/index.rhtml
@@ -1,16 +0,0 @@ @@ -1,16 +0,0 @@
1 -<h2><%= _('Listing memberships')%></h2>  
2 -  
3 -<% form_tag 'membership_editor/search' do %>  
4 - <%= _('Search') %> <%= text_field_tag 'query' %>  
5 -<% end %>  
6 -  
7 -<ul>  
8 -<% @memberships.each do |m|%>  
9 - <li>  
10 - <%= link_to_homepage m.name, m.identifier %>  
11 - <%= link_to_myprofile _('Manage') , {:controller => 'profile_editor'}, m.identifier %>  
12 - </li>  
13 -<% end %>  
14 -</ul>  
15 -  
16 -<%= link_to _('Request registration of a new enterprise'), :controller => 'enterprise_registration' %>  
app/views/membership_editor/new_enterprise.rhtml
@@ -1,14 +0,0 @@ @@ -1,14 +0,0 @@
1 -<%= error_messages_for 'enterprise' %>  
2 -  
3 -<h2><%= _('Register enterprise') %></h2>  
4 -  
5 -<h3> <%= _('How to proceed') %> </h3>  
6 -<p> <%= _('Fill the form and hit the Register button then the enterprise will be submitted for evaluation at the validation entitiy of your choice (within your state), when the enterprise is aproved you will be able to activate its profile') %> </p>  
7 -  
8 -<% form_tag :action => 'create_enterprise' do %>  
9 - <p><label for="identifier"><%= _('Identifier') %></label><br/>  
10 - <%= text_field 'enterprise', 'identifier', 'size' => 20 %></p>  
11 - <%= render :partial => 'form' %>  
12 -<p><%= submit_tag _('Register') %>  
13 -<%= link_to _('Cancel'), :action => 'index' %></p>  
14 -<% end %>  
app/views/membership_editor/search.rhtml
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -<h2> <%= @tagged_enterprises.size.to_s + _(' enterprises found') %> </h2>  
2 -  
3 -<%= render :partial => 'enterprise', :collection => @tagged_enterprises %>  
app/views/profile_editor/index.rhtml
@@ -15,9 +15,9 @@ @@ -15,9 +15,9 @@
15 15
16 <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') if profile.person? %> 16 <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') if profile.person? %>
17 17
18 - <%= file_manager_button(_('Manage Members'), 'icons-app/members.png', :controller => 'profile_members') %> 18 + <%= file_manager_button(_('Manage Members'), 'icons-app/members.png', :controller => 'profile_members') if profile.organization? %>
19 19
20 - <%= file_manager_button(_('Needed Products'), 'icons-app/consumed_product.png', :controller => 'consumed_products') %> 20 + <%= file_manager_button(_('Consumed Products'), 'icons-app/consumed_product.png', :controller => 'consumed_products') %>
21 21
22 <%= file_manager_button(_('Manage Products'), 'icons-app/products.png', :controller => 'manage_products') if profile.enterprise? %> 22 <%= file_manager_button(_('Manage Products'), 'icons-app/products.png', :controller => 'manage_products') if profile.enterprise? %>
23 23
@@ -29,11 +29,7 @@ @@ -29,11 +29,7 @@
29 <% file_manager do %> 29 <% file_manager do %>
30 30
31 <% @profile.enterprise_memberships.each do |em| %> 31 <% @profile.enterprise_memberships.each do |em| %>
32 - <% if em.image %>  
33 - <%= file_manager_button(em.name, em.image.public_filename(:minor), :profile => em.identifier, :controller => 'profile_editor' ) %>  
34 - <% else %>  
35 - <%= link_to_myprofile(em.name, {}, em.identifier) %>  
36 - <% end %> 32 + <%= file_manager_button(em.name, em.image ? em.image.public_filename(:minor) : 'icons-app/organization.png', :profile => em.identifier, :controller => 'profile_editor' ) %>
37 <% end %> 33 <% end %>
38 34
39 <%= file_manager_button(_('Register a new Enterprise'), 'icons-app/enterprise-registration.png', :controller => 'enterprise_registration') %> 35 <%= file_manager_button(_('Register a new Enterprise'), 'icons-app/enterprise-registration.png', :controller => 'enterprise_registration') %>
public/images/icons-app/README
@@ -23,6 +23,7 @@ password.png dlg-neu @@ -23,6 +23,7 @@ password.png dlg-neu
23 abiword_48.png dlg-neu 23 abiword_48.png dlg-neu
24 gnome-other.png Nuovo 24 gnome-other.png Nuovo
25 user_icon.png dlg-neu 25 user_icon.png dlg-neu
  26 +temp-home.png Nuovo
26 27
27 Icons rasterization 28 Icons rasterization
28 =================== 29 ===================
public/images/icons-app/organization.png 0 → 120000
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +temp-home.png
0 \ No newline at end of file 2 \ No newline at end of file
public/images/icons-app/temp-home.png 0 → 100644

2.43 KB

public/stylesheets/common.css
@@ -121,9 +121,10 @@ div.file-manager-button a { @@ -121,9 +121,10 @@ div.file-manager-button a {
121 border: 1px solid #e0e0e0; 121 border: 1px solid #e0e0e0;
122 display: block; 122 display: block;
123 padding: 3px; 123 padding: 3px;
124 - height: 80px; 124 + height: 90px;
125 overflow: hidden; 125 overflow: hidden;
126 background: white; 126 background: white;
  127 + font-size: 90%;
127 } 128 }
128 129
129 div.file-manager 130 div.file-manager
test/functional/membership_editor_controller_test.rb
@@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
1 -require File.dirname(__FILE__) + '/../test_helper'  
2 -require 'membership_editor_controller'  
3 -  
4 -# Re-raise errors caught by the controller.  
5 -class MembershipEditorController; def rescue_action(e) raise e end; end  
6 -  
7 -class MembershipEditorControllerTest < Test::Unit::TestCase  
8 - def setup  
9 - @controller = MembershipEditorController.new  
10 - @request = ActionController::TestRequest.new  
11 - @response = ActionController::TestResponse.new  
12 - login_as('ze')  
13 - end  
14 - all_fixtures  
15 -  
16 - should 'list the memberships of the person' do  
17 - get :index, :profile => 'ze'  
18 - assert assigns(:memberships)  
19 - assert_kind_of Array, assigns(:memberships)  
20 - end  
21 -  
22 - should 'prompt for new enterprise data' do  
23 - get :new_enterprise, :profile => 'ze'  
24 - assert assigns(:validation_entities)  
25 - assert_kind_of Array, assigns(:validation_entities)  
26 - end  
27 -  
28 - should 'create a new enterprise' do  
29 - post :create_enterprise, :profile => 'ze', :enterprise => {:name => 'New Ent', :identifier => 'new_net'}  
30 - assert assigns(:enterprise)  
31 - assert_kind_of Enterprise, assigns(:enterprise)  
32 - end  
33 -end