diff options
| author | hukl <contact@smyck.org> | 2009-09-01 11:49:56 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-09-01 11:49:56 +0200 |
| commit | 4aa4a0e4a44735d22ac7f8fd1b12b19699af087b (patch) | |
| tree | 34c78c00617a504c7d713540fb349fd9af1d0e23 /app/controllers/content_controller.rb | |
| parent | c95126d6b6abd6302a07fbb17cd9ad0181e048c7 (diff) | |
added expirimental routing for image galeries
added plain image gallery template
refinements
Diffstat (limited to 'app/controllers/content_controller.rb')
| -rw-r--r-- | app/controllers/content_controller.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index d548a34..d1bfa6b 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb | |||
| @@ -1,14 +1,13 @@ | |||
| 1 | class ContentController < ApplicationController | 1 | class ContentController < ApplicationController |
| 2 | 2 | ||
| 3 | before_filter :find_page | ||
| 4 | |||
| 3 | # This is the method that renders most of the the public content. It recieves | 5 | # This is the method that renders most of the the public content. It recieves |
| 4 | # a :locale and a :page_path parameter through the params hash. It looks up | 6 | # a :locale and a :page_path parameter through the params hash. It looks up |
| 5 | # the node with the corresponding unique_name attribute. The method doesn't | 7 | # the node with the corresponding unique_name attribute. The method doesn't |
| 6 | # return a node though, the node is really a proxy object for pages. It | 8 | # return a node though, the node is really a proxy object for pages. It |
| 7 | # returns the most recent page associated to this node instead. | 9 | # returns the most recent page associated to this node instead. |
| 8 | def render_page | 10 | def render_page |
| 9 | path = params[:page_path].join('/') | ||
| 10 | |||
| 11 | @page = Node.find_page(path) | ||
| 12 | 11 | ||
| 13 | if @page and @page.public? | 12 | if @page and @page.public? |
| 14 | template = @page.valid_template | 13 | template = @page.valid_template |
| @@ -26,4 +25,14 @@ class ContentController < ApplicationController | |||
| 26 | 25 | ||
| 27 | end | 26 | end |
| 28 | 27 | ||
| 28 | def render_gallery | ||
| 29 | @images = @page.assets.images | ||
| 30 | render :file => "custom/page_templates/public/gallery"#, :layout => true | ||
| 31 | end | ||
| 32 | |||
| 33 | private | ||
| 34 | def find_page | ||
| 35 | path = params[:page_path].join('/') | ||
| 36 | @page = Node.find_page(path) | ||
| 37 | end | ||
| 29 | end | 38 | end |
