diff options
| author | hukl <contact@smyck.org> | 2009-03-15 14:07:04 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-03-15 14:07:04 +0100 |
| commit | a936993a5a7bbe7bb4f679d3adc059929cd0d7c5 (patch) | |
| tree | 4913c2909cf698a2bf0e1b5fc552f6c2454d882c /app/controllers/revisions_controller.rb | |
| parent | c9fa047402fdc009319dca7b05455e8ce73eaee7 (diff) | |
first revision and diff interface
Diffstat (limited to 'app/controllers/revisions_controller.rb')
| -rw-r--r-- | app/controllers/revisions_controller.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/controllers/revisions_controller.rb b/app/controllers/revisions_controller.rb new file mode 100644 index 0000000..20991ef --- /dev/null +++ b/app/controllers/revisions_controller.rb | |||
| @@ -0,0 +1,29 @@ | |||
| 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 | params[:start] ||= @node.pages.all[-1].revision | ||
| 12 | params[:end] ||= @node.pages.all[-2].revision | ||
| 13 | |||
| 14 | @start = Page.find( :first, :conditions => { | ||
| 15 | :node_id => params[:id], | ||
| 16 | :revision => params[:start] | ||
| 17 | }) | ||
| 18 | |||
| 19 | @end = Page.find( :first, :conditions => { | ||
| 20 | :node_id => params[:id], | ||
| 21 | :revision => params[:end] | ||
| 22 | }) | ||
| 23 | |||
| 24 | end | ||
| 25 | |||
| 26 | def show | ||
| 27 | end | ||
| 28 | |||
| 29 | end | ||
