/wiki_page_versions: various usability improvements.
Changes to the /wiki_page_versions global listing: * Add "diff" links that show you what changed in the given edit. * Add "?" links that take you to the current version of the wiki. * Add "»" links next to wiki page titles that take you to the wiki's full edit history. * Add "»" links next to usernames that take you to the user's full edit history. * Add a "Status" column that shows whether the wiki page was created, deleted, undeleted, or renamed. * Link to /wiki_page_versions in sidebar, not /wiki_pages?order=time.
This commit is contained in:
@@ -1,4 +1,17 @@
|
||||
module WikiPageVersionsHelper
|
||||
def wiki_page_version_status_diff(wiki_page_version)
|
||||
cur = wiki_page_version
|
||||
prev = wiki_page_version.previous
|
||||
|
||||
return "New" if prev.blank?
|
||||
|
||||
status = []
|
||||
status += ["Renamed"] if cur.title != prev.title
|
||||
status += ["Deleted"] if cur.is_deleted? && !prev.is_deleted?
|
||||
status += ["Undeleted"] if !cur.is_deleted? && prev.is_deleted?
|
||||
status.join(" ")
|
||||
end
|
||||
|
||||
def wiki_page_diff(thispage, otherpage)
|
||||
pattern = Regexp.new('(?:<.+?>)|(?:\w+)|(?:[ \t]+)|(?:\r?\n)|(?:.+?)')
|
||||
other_names_pattern = Regexp.new('\S+|\s+')
|
||||
|
||||
Reference in New Issue
Block a user