summaryrefslogtreecommitdiff
path: root/app/controllers/nodes_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/nodes_controller.rb')
-rw-r--r--app/controllers/nodes_controller.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb
index a403b95..81ead62 100644
--- a/app/controllers/nodes_controller.rb
+++ b/app/controllers/nodes_controller.rb
@@ -7,7 +7,8 @@ class NodesController < ApplicationController
7 :edit, 7 :edit,
8 :update, 8 :update,
9 :destroy, 9 :destroy,
10 :publish 10 :publish,
11 :unlock
11 ] 12 ]
12 13
13 def index 14 def index
@@ -67,6 +68,20 @@ class NodesController < ApplicationController
67 redirect_to node_path 68 redirect_to node_path
68 end 69 end
69 70
71 def unlock
72 # TODO that actually has to be implemented in the model, once we have
73 # permissions
74 if draft = @node.draft
75 draft.user = nil
76 draft.save
77 flash[:notice] = "Node unlocked"
78 else
79 flash[:notice] = "Cannot unlock"
80 end
81
82 redirect_to nodes_path
83 end
84
70 def move_to 85 def move_to
71 parent = Node.find params[:parent_id] 86 parent = Node.find params[:parent_id]
72 @node.move_to_child_of parent 87 @node.move_to_child_of parent