Dropped number from revision table. Also dropped timestamp. We will rely on autoincremented ID for sorting, and will for now store the time of last edit of the revision in revised_at. Later we will refactor content into a separate table (so as not to load the whole 300 kb of text and cached HTML every time we need page.revisions in code). Rake tests all pass, but watir tests indicate that some revision traversing links are still broken
This commit is contained in:
parent
476d7810f6
commit
052754b068
18 changed files with 116 additions and 112 deletions
|
@ -140,7 +140,7 @@ class WikiController < ApplicationController
|
|||
def pdf
|
||||
page = wiki.read_page(@web_name, @page_name)
|
||||
safe_page_name = @page.name.gsub(/\W/, '')
|
||||
file_name = "#{safe_page_name}-#{@web.address}-#{@page.created_at.strftime('%Y-%m-%d-%H-%M-%S')}"
|
||||
file_name = "#{safe_page_name}-#{@web.address}-#{@page.revised_on.strftime('%Y-%m-%d-%H-%M-%S')}"
|
||||
file_path = File.join(@wiki.storage_path, file_name)
|
||||
|
||||
export_page_to_tex("#{file_path}.tex") unless FileTest.exists?("#{file_path}.tex")
|
||||
|
@ -274,7 +274,8 @@ class WikiController < ApplicationController
|
|||
end
|
||||
|
||||
def get_page_and_revision
|
||||
@revision = @page.revisions[@params['rev'].to_i]
|
||||
@revision_number = @params['rev'].to_i
|
||||
@revision = @page.revisions[@revision_number]
|
||||
end
|
||||
|
||||
def parse_category
|
||||
|
@ -312,8 +313,8 @@ class WikiController < ApplicationController
|
|||
@pages_by_revision = @web.select.by_revision.first(limit)
|
||||
else
|
||||
@pages_by_revision = @web.select.by_revision
|
||||
@pages_by_revision.reject! { |page| page.created_at < start_date } if start_date
|
||||
@pages_by_revision.reject! { |page| page.created_at > end_date } if end_date
|
||||
@pages_by_revision.reject! { |page| page.revised_on < start_date } if start_date
|
||||
@pages_by_revision.reject! { |page| page.revised_on > end_date } if end_date
|
||||
end
|
||||
|
||||
@hide_description = hide_description
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue