diff options
Diffstat (limited to 'app/controllers')
| -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 | ||
