diff options
| author | erdgeist <erdgeist@bauklotz.local> | 2009-03-10 19:59:02 +0100 |
|---|---|---|
| committer | erdgeist <erdgeist@bauklotz.local> | 2009-03-10 19:59:02 +0100 |
| commit | d6049aeffc7de43393a9a7a1d2f95f26422a046f (patch) | |
| tree | 7036f509aa4f4a518a00ddb0e12fe8a6eb4d563a /app/controllers | |
| parent | 3b3158199f147646348fae0008d3f63062967a87 (diff) | |
| parent | 14ada6b405dac2bea27a2959f6f73a7398776b0b (diff) | |
Merge branch 'master' of ssh://git@svn.medienhaus.udk-berlin.de/usr/local/git/cccms
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/content_controller.rb | 3 | ||||
| -rw-r--r-- | app/controllers/nodes_controller.rb | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index 706cfcd..d548a34 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb | |||
| @@ -10,7 +10,7 @@ class ContentController < ApplicationController | |||
| 10 | 10 | ||
| 11 | @page = Node.find_page(path) | 11 | @page = Node.find_page(path) |
| 12 | 12 | ||
| 13 | if @page | 13 | if @page and @page.public? |
| 14 | template = @page.valid_template | 14 | template = @page.valid_template |
| 15 | 15 | ||
| 16 | render( | 16 | render( |
| @@ -25,4 +25,5 @@ class ContentController < ApplicationController | |||
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | end | 27 | end |
| 28 | |||
| 28 | end | 29 | end |
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 81ead62..0c961b7 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb | |||
| @@ -32,7 +32,7 @@ class NodesController < ApplicationController | |||
| 32 | 32 | ||
| 33 | if parent and @node.save | 33 | if parent and @node.save |
| 34 | @node.move_to_child_of parent | 34 | @node.move_to_child_of parent |
| 35 | redirect_to(@node) | 35 | redirect_to(edit_node_path(@node)) |
| 36 | else | 36 | else |
| 37 | @node.errors.add("Parent node") | 37 | @node.errors.add("Parent node") |
| 38 | render :action => :new | 38 | render :action => :new |
| @@ -40,7 +40,15 @@ class NodesController < ApplicationController | |||
| 40 | end | 40 | end |
| 41 | 41 | ||
| 42 | def show | 42 | def show |
| 43 | @nodes = Node.find(params[:id]).children | 43 | @page = Node.find(params[:id]).draft |
| 44 | |||
| 45 | if @page | ||
| 46 | template = @page.valid_template | ||
| 47 | render( | ||
| 48 | :file => template, | ||
| 49 | :layout => "application" | ||
| 50 | ) | ||
| 51 | end | ||
| 44 | end | 52 | end |
| 45 | 53 | ||
| 46 | def edit | 54 | def edit |
