Class | VersionsController
In: | app/controllers/versions_controller.rb
Parent: | ApplicationController

Copyright (c) 2006 Logica

### Methods

diff note show text

### Constants

FLASH_FILES_IDENTICAL | = | "The two selected files are identical"

### Public Instance methods

diff()

[Source]

        # File app/controllers/versions_controller.rb, line 37
    37:   def diff
    38:     if params[:version]
    39:       @version = Version.find(params[:version][:id])
    40:       @version.source_version = Version.find(params[:version][:version_id])
    41:     else
    42:       @version = Version.find(params[:id])
    43:       @version.source_version = @version.previous_version || @version
    44:     end
    45:     @versions = @version.page.versions
    46:     @page = @version.page
    47:     @wiki = @page.site
    48:     @version.xhtmldiffpage(@version.source_version)
    49:   end

note()

Action note to update the version note by the reviewer, cadmin or an admin when there is no reviewer defined yet.

[Source]

        # File app/controllers/versions_controller.rb, line 58
    58:   def note
    59:     v = Version.find(params[:id])
    60:     if v.reviewer.nil? || v.reviewer == session['user'] || cadmin?
    61:       v.note = params[:value]
    62:       v.reviewer = session['user']
    63:       v.save!
    64:       v.reload
    65:     end
    66:     render :text => v.note
    67:   end

show()

[Source]

        # File app/controllers/versions_controller.rb, line 26
    26:   def show
    27:     @version = Version.find(params[:id])
    28:     @page = @version.page
    29:     @wiki = @page.site
    30:     @baseversion = @version.baseversion
    31:     @last_version = @page.last_version
    32:     @current_version = @version.current_version
    33:     @source_version = @version.source_version
    34:     @previous_version = @version.previous_version
    35:   end

text()

[Source]

        # File app/controllers/versions_controller.rb, line 51
    51:   def text
    52:     @version = Version.find(params[:id])
    53:     render :inline => "<%= (simple_format(strip_tags(@version.html))) %>", :layout => false
    54:   end

[Validate]