Commit f01fa9bc8c752db3b2b3b159129695ef28e8e292
1 parent
bf78665c
Exists in
master
and in
28 other branches
ActionItem154: removing unused code
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1309 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
20 changed files
with
0 additions
and
359 deletions
Show diff stats
app/design_blocks/favorite_links_profile/controllers/favorite_links_profile_controller.rb
app/design_blocks/favorite_links_profile/models/favorite_links_profile.rb
app/design_blocks/list_block/controllers/list_block_controller.rb
@@ -1,58 +0,0 @@ | @@ -1,58 +0,0 @@ | ||
1 | -class ListBlockController < ApplicationController | ||
2 | - | ||
3 | - # This controller always has the object @design_block available to it. | ||
4 | - # The method acts_as_design_block load a before_filter that always load | ||
5 | - # this object. | ||
6 | - | ||
7 | - needs_profile | ||
8 | - | ||
9 | - acts_as_design_block | ||
10 | - | ||
11 | - # You must have a hash on format: | ||
12 | - # { | ||
13 | - # 'action name' => 'How the action will be displayed on menu' | ||
14 | - # } | ||
15 | - # | ||
16 | - # EX: | ||
17 | - # CONTROL_ACTION_OPTIONS = { | ||
18 | - # 'design_edit' => _('Edit'), | ||
19 | - # 'manage_links' => _('Manage Links') | ||
20 | - # } | ||
21 | - # | ||
22 | - # This hash will define the options menu on edit mode. | ||
23 | - CONTROL_ACTION_OPTIONS = { | ||
24 | - 'edit' => _('Edit') | ||
25 | - } | ||
26 | - | ||
27 | - | ||
28 | - ########################### | ||
29 | - # Mandatory methods | ||
30 | - ########################### | ||
31 | - | ||
32 | - def index | ||
33 | - @elements = @design_block.elements | ||
34 | - design_render :action => @design_block.view | ||
35 | - end | ||
36 | - | ||
37 | - ########################### | ||
38 | - # Other Sample of methods | ||
39 | - ########################### | ||
40 | - | ||
41 | - | ||
42 | - def edit | ||
43 | - @elements_types = @design_block.elements_types | ||
44 | - design_render_on_edit :controller => 'list_block', :action => 'edit' | ||
45 | - end | ||
46 | - | ||
47 | - def save | ||
48 | - if @design_block.update_attributes(params[:design_block]) | ||
49 | - design_render_on_edit :controller => 'list_block', :action => 'show' | ||
50 | - else | ||
51 | - design_render_on_edit :nothing => true | ||
52 | - end | ||
53 | - end | ||
54 | - | ||
55 | - def show | ||
56 | - end | ||
57 | - | ||
58 | -end |
app/design_blocks/list_block/helpers/list_block_helper.rb
app/design_blocks/list_block/models/list_block.rb
@@ -1,54 +0,0 @@ | @@ -1,54 +0,0 @@ | ||
1 | -class ListBlock < Design::Block | ||
2 | - | ||
3 | - # Define an specific method using the settings hash serialized | ||
4 | - # variable to keep the value desired by method. | ||
5 | - # | ||
6 | - # EX: | ||
7 | - # def max_number_of_element= value | ||
8 | - # self.settings[:limit_number] = value | ||
9 | - # end | ||
10 | - | ||
11 | - def self.description | ||
12 | - _('List Block') | ||
13 | - end | ||
14 | - | ||
15 | - def limit_number= value | ||
16 | - self.settings[:limit_number] = value.to_i == 0 ? nil : value.to_i | ||
17 | - end | ||
18 | - | ||
19 | - def limit_number | ||
20 | - self.settings[:limit_number] | ||
21 | - end | ||
22 | - | ||
23 | - def elements_types | ||
24 | - ['Person', 'Enterprise'] | ||
25 | - end | ||
26 | - | ||
27 | - def element_type | ||
28 | - self.settings[:element_type] | ||
29 | - end | ||
30 | - | ||
31 | - def element_type= value | ||
32 | - return nil unless elements_types.include?(value) | ||
33 | - self.settings[:element_type] = value | ||
34 | - end | ||
35 | - | ||
36 | - def elements | ||
37 | - return nil unless element_type | ||
38 | - self.element_type.constantize.find(:all, :limit => limit_number) | ||
39 | - end | ||
40 | - | ||
41 | - def view | ||
42 | - return 'nothing' unless element_type | ||
43 | - element_type.to_s.underscore | ||
44 | - end | ||
45 | - | ||
46 | - def display_block | ||
47 | - 'true' | ||
48 | - end | ||
49 | - | ||
50 | - def display_header | ||
51 | - 'true' | ||
52 | - end | ||
53 | - | ||
54 | -end |
app/design_blocks/list_block/views/edit.rhtml
@@ -1,22 +0,0 @@ | @@ -1,22 +0,0 @@ | ||
1 | -<h2> <%= _('Editing list of people') %> </h2> | ||
2 | - | ||
3 | -<% design_form_remote_tag( :url => {:action => 'save'}) do %> | ||
4 | - <p> | ||
5 | - <label for="design_block_title"> <%= _("Title") %> </label> | ||
6 | - <%= text_field 'design_block', 'title'%> | ||
7 | - </p> | ||
8 | - | ||
9 | - <p> | ||
10 | - <label for="design_block_type"> <%= _("Type of objects to list") %> </label> | ||
11 | - <%= select 'design_block', 'element_type', @elements_types %> | ||
12 | - </p> | ||
13 | - | ||
14 | - <p> | ||
15 | - <label for="design_block_limit_number"> <%= _("Max number of elements") %> </label> | ||
16 | - <%= text_field 'design_block', 'limit_number'%> | ||
17 | - </p> | ||
18 | - | ||
19 | - <% button_bar do %> | ||
20 | - <%= submit_button('save', _('Save')) %> | ||
21 | - <% end %> | ||
22 | -<% end %> |
app/design_blocks/list_block/views/enterprise.rhtml
@@ -1,6 +0,0 @@ | @@ -1,6 +0,0 @@ | ||
1 | -<ul class='enterprises_list_block'> | ||
2 | - <% @elements.each do |p| %> | ||
3 | - <li> <%= link_to_homepage(content_tag('span',p.name) + (p.image ? image_tag(p.image.public_filename :portrait) : ''), p.identifier) %> </li> | ||
4 | - <% end %> | ||
5 | -</ul> | ||
6 | -<br style="clear: both;" /> |
app/design_blocks/list_block/views/nothing.rhtml
@@ -1 +0,0 @@ | @@ -1 +0,0 @@ | ||
1 | -<h4><%= _('Nothing to see here') %></h4> |
app/design_blocks/list_block/views/person.rhtml
app/design_blocks/list_block/views/show.rhtml
@@ -1 +0,0 @@ | @@ -1 +0,0 @@ | ||
1 | -<p> <%= _('Limit number of people: ') %> <%= @design_block.limit_number %></p> |
app/design_blocks/profile_info_block/controllers/profile_info_block_controller.rb
@@ -1,52 +0,0 @@ | @@ -1,52 +0,0 @@ | ||
1 | -class ProfileInfoBlockController < ApplicationController | ||
2 | - | ||
3 | - # This controller always has the object @design_block available to it. | ||
4 | - # The method acts_as_design_block load a before_filter that always load | ||
5 | - # this object. | ||
6 | - | ||
7 | - needs_profile | ||
8 | - | ||
9 | - acts_as_design_block | ||
10 | - | ||
11 | - # You must have a hash on format: | ||
12 | - # { | ||
13 | - # 'action name' => 'How the action will be displayed on menu' | ||
14 | - # } | ||
15 | - # | ||
16 | - # EX: | ||
17 | - # CONTROL_ACTION_OPTIONS = { | ||
18 | - # 'design_edit' => _('Edit'), | ||
19 | - # 'manage_links' => _('Manage Links') | ||
20 | - # } | ||
21 | - # | ||
22 | - # This hash will define the options menu on edit mode. | ||
23 | - CONTROL_ACTION_OPTIONS = { | ||
24 | - 'edit' => _('Edit') | ||
25 | - } | ||
26 | - | ||
27 | - | ||
28 | - ########################### | ||
29 | - # Mandatory methods | ||
30 | - ########################### | ||
31 | - | ||
32 | - def index | ||
33 | - @info = @profile.info | ||
34 | - @can_edit = current_user.person.has_permission?('edit_profile', @profile) | ||
35 | - design_render | ||
36 | - end | ||
37 | - | ||
38 | - ########################### | ||
39 | - # Other Sample of methods | ||
40 | - ########################### | ||
41 | - | ||
42 | - def edit | ||
43 | - design_render_on_edit | ||
44 | - end | ||
45 | - | ||
46 | - def save | ||
47 | - @design_block.update_attributes(params[:design_block]) | ||
48 | - design_render_on_edit :nothing => true | ||
49 | - end | ||
50 | - | ||
51 | - | ||
52 | -end |
app/design_blocks/profile_info_block/helpers/profile_info_block_helper.rb
app/design_blocks/profile_info_block/models/profile_info_block.rb
@@ -1,23 +0,0 @@ | @@ -1,23 +0,0 @@ | ||
1 | -class ProfileInfoBlock < Design::Block | ||
2 | - | ||
3 | - # Define an specific method using the settings hash serialized | ||
4 | - # variable to keep the value desired by method. | ||
5 | - # | ||
6 | - # EX: | ||
7 | - # def max_number_of_element= value | ||
8 | - # self.settings[:limit_number] = value | ||
9 | - # end | ||
10 | - | ||
11 | - def self.description | ||
12 | - 'ProfileInfoBlock' | ||
13 | - end | ||
14 | - | ||
15 | - def title | ||
16 | - self.settings[:title] | ||
17 | - end | ||
18 | - | ||
19 | - def title= value | ||
20 | - self.settings[:title] = value | ||
21 | - end | ||
22 | - | ||
23 | -end |
app/design_blocks/profile_info_block/views/edit.rhtml
@@ -1,12 +0,0 @@ | @@ -1,12 +0,0 @@ | ||
1 | -<h2> <%= _('Editing profile exibition') %> </h2> | ||
2 | - | ||
3 | -<% design_form_remote_tag( :url => {:action => 'save'}) do %> | ||
4 | - <p> | ||
5 | - <label for="design_block_title"> <%= _("Title") %> </label> | ||
6 | - <%= text_field 'design_block', 'title'%> | ||
7 | - </p> | ||
8 | - | ||
9 | - <% button_bar do %> | ||
10 | - <%= submit_button('save', _('Save')) %> | ||
11 | - <% end %> | ||
12 | -<% end %> |
app/design_blocks/profile_info_block/views/index.rhtml
@@ -1,6 +0,0 @@ | @@ -1,6 +0,0 @@ | ||
1 | -<%= image_tag @profile.image.public_filename(:thumb) if @profile.image %> <br> | ||
2 | -<%= link_to_myprofile(_('Change photo'), {:action => 'change_image'}, @profile.identifier ) %><br> | ||
3 | -<%= _('User since %d') % @profile.created_at.year if @profile.created_at %><br> | ||
4 | -<%= @info.name ? @info.name : @profile.name if @profile.name %><br> | ||
5 | -<%= n_('1 year', '%{num} years', @info.age) % {:num => @info.age} if @info.birth_date%><br> | ||
6 | - |
app/design_blocks/view_article/controllers/view_article_controller.rb
@@ -1,50 +0,0 @@ | @@ -1,50 +0,0 @@ | ||
1 | -class ViewArticleController < ApplicationController | ||
2 | - | ||
3 | - # This controller always has the object @design_block available to it. | ||
4 | - # The method acts_as_design_block load a before_filter that always load | ||
5 | - # this object. | ||
6 | - | ||
7 | - needs_profile | ||
8 | - | ||
9 | - acts_as_design_block | ||
10 | - | ||
11 | - # You must have a hash on format: | ||
12 | - # { | ||
13 | - # 'action name' => 'How the action will be displayed on menu' | ||
14 | - # } | ||
15 | - # | ||
16 | - # EX: | ||
17 | - # CONTROL_ACTION_OPTIONS = { | ||
18 | - # 'design_edit' => _('Edit'), | ||
19 | - # 'manage_links' => _('Manage Links') | ||
20 | - # } | ||
21 | - # | ||
22 | - # This hash will define the options menu on edit mode. | ||
23 | - CONTROL_ACTION_OPTIONS = { | ||
24 | - 'edit' => _('Edit') | ||
25 | - } | ||
26 | - | ||
27 | - | ||
28 | - ########################### | ||
29 | - # Mandatory methods | ||
30 | - ########################### | ||
31 | - | ||
32 | - def index | ||
33 | - design_render | ||
34 | - end | ||
35 | - | ||
36 | - ########################### | ||
37 | - # Other Sample of methods | ||
38 | - ########################### | ||
39 | - | ||
40 | - def edit | ||
41 | - @articles = @profile.articles | ||
42 | - design_render_on_edit | ||
43 | - end | ||
44 | - | ||
45 | - def save | ||
46 | - @design_block.update_attributes(params[:design_block]) | ||
47 | - design_render_on_edit :nothing => true | ||
48 | - end | ||
49 | - | ||
50 | -end |
app/design_blocks/view_article/helpers/view_article_helper.rb
app/design_blocks/view_article/models/view_article.rb
@@ -1,27 +0,0 @@ | @@ -1,27 +0,0 @@ | ||
1 | -class ViewArticle < Design::Block | ||
2 | - | ||
3 | - # Define an specific method using the settings hash serialized | ||
4 | - # variable to keep the value desired by method. | ||
5 | - # | ||
6 | - # EX: | ||
7 | - # def max_number_of_element= value | ||
8 | - # self.settings[:limit_number] = value | ||
9 | - # end | ||
10 | - | ||
11 | - def self.description | ||
12 | - 'ViewArticle' | ||
13 | - end | ||
14 | - | ||
15 | - def article_id | ||
16 | - self.settings[:article_id] | ||
17 | - end | ||
18 | - | ||
19 | - def article_id= value | ||
20 | - self.settings[:article_id] = value | ||
21 | - end | ||
22 | - | ||
23 | - def article | ||
24 | - Article.find(article_id) if article_id | ||
25 | - end | ||
26 | - | ||
27 | -end |
app/design_blocks/view_article/views/edit.rhtml
@@ -1,17 +0,0 @@ | @@ -1,17 +0,0 @@ | ||
1 | -<h2> <%= _('Editing article shown') %> </h2> | ||
2 | - | ||
3 | -<% design_form_remote_tag( :url => {:action => 'save'}) do %> | ||
4 | - <p> | ||
5 | - <label for="design_block_title"> <%= _("Title") %> </label> | ||
6 | - <%= text_field 'design_block', 'title'%> | ||
7 | - </p> | ||
8 | - | ||
9 | - <p> | ||
10 | - <label for="design_block_page"> <%= _("Page to show") %> </label> | ||
11 | - <%= select 'design_block', 'article_id', @articles.map{|a|[a.full_name, a.id]} %> | ||
12 | - </p> | ||
13 | - | ||
14 | - <% button_bar do %> | ||
15 | - <%= submit_button('save', _('Save')) %> | ||
16 | - <% end %> | ||
17 | -<% end %> |
app/design_blocks/view_article/views/index.rhtml
@@ -1 +0,0 @@ | @@ -1 +0,0 @@ | ||
1 | -<%= @design_block.article.to_html if @design_block.article %> |