Commit fa43549d71a360df04bac5dec09f3ad0956a4377

Authored by LeandroNunes
1 parent 78e32c78

ActionItem0: upgrading source code

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@56 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 0 additions and 48 deletions   Show diff stats
app/controllers/application.rb
@@ -5,54 +5,6 @@ class ApplicationController < ActionController::Base @@ -5,54 +5,6 @@ class ApplicationController < ActionController::Base
5 before_filter :detect_stuff_by_domain 5 before_filter :detect_stuff_by_domain
6 attr_reader :virtual_community 6 attr_reader :virtual_community
7 7
8 -  
9 - # TODO: this methods don't belong here  
10 - #TODO See a better way to do this. The layout need a owner to work  
11 - before_filter :load_owner  
12 - def load_owner  
13 - @owner = User.find(1)  
14 - end  
15 -  
16 - # TODO: this methods don't belong here  
17 - # TODO See a better way to do this. We need that something say to us when is the time to edit the layout.  
18 - #I think the better way is set a different render class to the visualization and to edit a layout.  
19 - before_filter :detect_edit_layout  
20 - def detect_edit_layout  
21 - @edit_layout = true unless params[:edit_layout].nil?  
22 - end  
23 -  
24 - # TODO: this methods don't belong here  
25 - # This method changes a block content to a different box place and  
26 - # updates all boxes at the ends  
27 - def change_box  
28 - b = Block.find(params[:block])  
29 - b.box = Box.find(params[:box_id])  
30 - b.save  
31 - render :update do |page|  
32 - @owner.boxes.each do |box|  
33 - @box_number = box.number  
34 - page.replace_html "box_#{box.number}", {:partial => 'layouts/box_template'}  
35 - page.sortable "leo_#{box.number}", :url => {:action => 'sort_box', :box_number => box.number}  
36 - end  
37 - end  
38 - end  
39 -  
40 - # TODO: this methods don't belong here  
41 - def sort_box  
42 - blocks = Array.new  
43 - box_number = params[:box_number]  
44 - pos = 0  
45 - params["leo_#{box_number}"].each do |block_id|  
46 - pos = pos + 1  
47 - b = Block.find(block_id)  
48 - b.position = pos  
49 - b.save  
50 - blocks.push(b)  
51 - end  
52 - @box_number = box_number  
53 - render :partial => 'layouts/box_template'  
54 - end  
55 -  
56 protected 8 protected
57 9
58 def detect_stuff_by_domain 10 def detect_stuff_by_domain