diff options
| author | erdgeist <erdgeist@bauklotz.local> | 2009-03-18 11:36:10 +0100 |
|---|---|---|
| committer | erdgeist <erdgeist@bauklotz.local> | 2009-03-18 11:36:10 +0100 |
| commit | d957a33a0d50f00c1968c5d12e728bd73ea186b3 (patch) | |
| tree | 8d7ecce1fc6c82abea10b8b8be868a92746cbd89 /app/controllers | |
| parent | ce55ed022fd373af58f7bd25cdd3f092f5698c54 (diff) | |
| parent | ca08b36ca6bd874abbb7207495860eeeb53884e0 (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/revisions_controller.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/app/controllers/revisions_controller.rb b/app/controllers/revisions_controller.rb new file mode 100644 index 0000000..565a25f --- /dev/null +++ b/app/controllers/revisions_controller.rb | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | class RevisionsController < ApplicationController | ||
| 2 | |||
| 3 | layout 'admin' | ||
| 4 | |||
| 5 | def index | ||
| 6 | end | ||
| 7 | |||
| 8 | def diff | ||
| 9 | @node = Node.find(params[:id]) | ||
| 10 | |||
| 11 | if @node.pages.length > 1 | ||
| 12 | params[:start] ||= @node.pages.all[-1].revision | ||
| 13 | params[:end] ||= @node.pages.all[-2].revision | ||
| 14 | else | ||
| 15 | params[:start], params[:end] = 1, 1 | ||
| 16 | end | ||
| 17 | |||
| 18 | @start = Page.find( :first, :conditions => { | ||
| 19 | :node_id => params[:id], | ||
| 20 | :revision => params[:start] | ||
| 21 | }) | ||
| 22 | |||
| 23 | @end = Page.find( :first, :conditions => { | ||
| 24 | :node_id => params[:id], | ||
| 25 | :revision => params[:end] | ||
| 26 | }) | ||
| 27 | |||
| 28 | end | ||
| 29 | |||
| 30 | def show | ||
| 31 | @node = Node.find(params[:id]) | ||
| 32 | end | ||
| 33 | |||
| 34 | end | ||
