Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 86
- Log:
Initial import of I2, an Instiki clone.
- Author:
- adh
- Date:
- Mon Oct 16 10:40:36 +0100 2006
- Size:
- 1516 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 | content_tag("small", @book.name) + tag("br") + @title |
23 | else |
24 | @title |
25 | end |
26 | end |
27 | |
28 | def markup(body, existing_page_titles = @book.existing_page_titles) |
29 | textilize(linkize(auto_link(body), existing_page_titles)) |
30 | end |
31 | |
32 | def differences(original, new) |
33 | HTMLDiff.diff(original, new) |
34 | end |
35 | |
36 | def link_to_author(author) |
37 | link_to(author.name, page_url(:page_title => author)) + " (#{author.ip})" |
38 | end |
39 | |
40 | private |
41 | def linkize(body, existing_titles) |
42 | body.gsub(Version::PAGE_LINK) do |
43 | page = title = $1 |
44 | title = $2 unless $2.empty? |
45 | if existing_titles.include?(page) |
46 | link_to(title, page_url(:page_title => page), :class => "existingWikiWord") |
47 | else |
48 | content_tag("span", title + link_to("?", page_url(:page_title => page)), :class => "newWikiWord") |
49 | end |
50 | end |
51 | end |
52 | end |