Commit 32a85ace2803206b29c6e1ce1f045b95c196b380
1 parent
f45481d2
Exists in
master
and in
29 other branches
ActionItem93: removing unused code
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1053 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
12 changed files
with
7 additions
and
147 deletions
Show diff stats
app/controllers/my_profile/membership_editor_controller.rb
... | ... | @@ -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
app/views/membership_editor/_form.rhtml
... | ... | @@ -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 | -<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 | -<%= 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
app/views/profile_editor/index.rhtml
... | ... | @@ -15,9 +15,9 @@ |
15 | 15 | |
16 | 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 | 22 | <%= file_manager_button(_('Manage Products'), 'icons-app/products.png', :controller => 'manage_products') if profile.enterprise? %> |
23 | 23 | |
... | ... | @@ -29,11 +29,7 @@ |
29 | 29 | <% file_manager do %> |
30 | 30 | |
31 | 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 | 33 | <% end %> |
38 | 34 | |
39 | 35 | <%= file_manager_button(_('Register a new Enterprise'), 'icons-app/enterprise-registration.png', :controller => 'enterprise_registration') %> | ... | ... |
public/images/icons-app/README
2.43 KB
public/stylesheets/common.css
... | ... | @@ -121,9 +121,10 @@ div.file-manager-button a { |
121 | 121 | border: 1px solid #e0e0e0; |
122 | 122 | display: block; |
123 | 123 | padding: 3px; |
124 | - height: 80px; | |
124 | + height: 90px; | |
125 | 125 | overflow: hidden; |
126 | 126 | background: white; |
127 | + font-size: 90%; | |
127 | 128 | } |
128 | 129 | |
129 | 130 | div.file-manager | ... | ... |
test/functional/membership_editor_controller_test.rb
... | ... | @@ -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 |