Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 90
- Log:
Updated I2 installation to site-wide look and feel. Uses shared templates.
Application helper changed to alter style of page headings.
- Author:
- adh
- Date:
- Mon Oct 16 16:23:09 +0100 2006
- Size:
- 1737 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 + ':', :controller => '/') + ' ' + @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 | end |
35 | |
36 | def differences(original, new) |
37 | HTMLDiff.diff(original, new) |
38 | end |
39 | |
40 | def link_to_author(author) |
41 | link_to(author.name, page_url(:page_title => author)) + " (#{author.ip})" |
42 | end |
43 | |
44 | private |
45 | def linkize(body, existing_titles) |
46 | body.gsub(Version::PAGE_LINK) do |
47 | page = title = $1 |
48 | title = $2 unless $2.empty? |
49 | if existing_titles.include?(page) |
50 | link_to(title, page_url(:page_title => page), :class => "existingWikiWord") |
51 | else |
52 | content_tag("span", title + link_to("?", page_url(:page_title => page)), :class => "newWikiWord") |
53 | end |
54 | end |
55 | end |
56 | end |