Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 217
- Log:
Further style tweaking. Made the link before page titles point to the
list of all pages, since it previously just pointed to the page you
were already viewing (pointless) and there's already a "Home" link
right underneath it. Added section numbering JS (old fashioned DOM 0
style stuff) to support some old functional specifications. Included
this via the application default layout.
- Author:
- rool
- Date:
- Wed May 30 10:05:39 +0100 2007
- Size:
- 1763 Bytes
1 | require 'html_diff/lib/html_diff' |
2 | |
3 | module ApplicationHelper |
4 | def nlink_to(name, options = {}, html_options = {}, *parameters_for_method_reference) |
5 | link_to(name, options, html_options.update(:class => "navlink"), *parameters_for_method_reference) |
6 | end |
7 | |
8 | def page_title |
9 | if @page && (@page.title == 'Home Page') && (%w( show published print ).include?(@controller.action_name)) |
10 | @book.name |
11 | elsif @book |
12 | "#{@title} in #{@book.name}" |
13 | else |
14 | @title |
15 | end |
16 | end |
17 | |
18 | def page_heading |
19 | if @page && (@page.title == 'Home Page') && (%w( show published print ).include?(@controller.action_name)) |
20 | @book.name |
21 | elsif @book |
22 | link_to(@book.name + ':', pages_url) + ' ' + @title |
23 | else |
24 | @title |
25 | end |
26 | end |
27 | |
28 | def markup(body, existing_page_titles = @book.existing_page_titles) |
29 | # require 'redcloth303' # Use local, specific version in 'lib' |
30 | text = linkize(auto_link(body), existing_page_titles) |
31 | # textilized = RedCloth.new(text, [ :hard_breaks ]) |
32 | # textilized.hard_breaks = true if textilized.respond_to?("hard_breaks=") |
33 | # textilized.to_html |
34 | RedCloth.new(text).to_html |
35 | end |
36 | |
37 | def differences(original, new) |
38 | HTMLDiff.diff(original, new) |
39 | end |
40 | |
41 | def link_to_author(author) |
42 | link_to(author.name, page_url(:page_title => author)) + " (#{author.ip})" |
43 | end |
44 | |
45 | private |
46 | def linkize(body, existing_titles) |
47 | body.gsub(Version::PAGE_LINK) do |
48 | page = title = $1 |
49 | title = $2 unless $2.empty? |
50 | if existing_titles.include?(page) |
51 | link_to(title, page_url(:page_title => page), :class => "existingWikiWord") |
52 | else |
53 | content_tag("span", title + link_to("?", page_url(:page_title => page)), :class => "newWikiWord") |
54 | end |
55 | end |
56 | end |
57 | end |