Pimki 1.7.092 → 1.8.092

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/README-PIMKI +182 -178
  2. data/app/controllers/wiki.rb +950 -942
  3. data/app/models/chunks/category.rb +33 -33
  4. data/app/models/chunks/category_test.rb +21 -21
  5. data/app/models/chunks/chunk.rb +20 -20
  6. data/app/models/chunks/engines.rb +48 -48
  7. data/app/models/chunks/include.rb +1 -1
  8. data/app/models/chunks/match.rb +1 -1
  9. data/app/models/chunks/nowiki.rb +1 -1
  10. data/app/models/chunks/nowiki_test.rb +5 -0
  11. data/app/models/chunks/todo.rb +1 -0
  12. data/app/models/chunks/wiki.rb +130 -130
  13. data/app/models/page.rb +124 -124
  14. data/app/models/revision.rb +92 -92
  15. data/app/models/web.rb +314 -316
  16. data/app/models/wiki_content.rb +2 -2
  17. data/app/models/wiki_service.rb +170 -166
  18. data/app/models/wiki_words.rb +28 -28
  19. data/app/views/error.rhtml +37 -37
  20. data/app/views/navigation.rhtml +1 -1
  21. data/app/views/static_style_sheet.rhtml +10 -5
  22. data/app/views/top.rhtml +1 -1
  23. data/app/views/wiki/adv_search.rhtml +61 -61
  24. data/app/views/wiki/bliki.rhtml +7 -6
  25. data/app/views/wiki/bliki_edit.rhtml +26 -37
  26. data/app/views/wiki/bliki_new.rhtml +58 -64
  27. data/app/views/wiki/bliki_revision.rhtml +5 -3
  28. data/app/views/wiki/edit.rhtml +44 -44
  29. data/app/views/wiki/edit_menu.rhtml +26 -19
  30. data/app/views/wiki/edit_web.rhtml +303 -305
  31. data/app/views/wiki/glossary.rhtml +35 -27
  32. data/app/views/wiki/list.rhtml +175 -174
  33. data/app/views/wiki/list.rhtml.bak +175 -0
  34. data/app/views/wiki/mind.rhtml +70 -70
  35. data/app/views/wiki/new.rhtml +34 -32
  36. data/app/views/wiki/published.rhtml +34 -49
  37. data/app/views/wiki/revision.rhtml +88 -87
  38. data/app/views/wiki/rollback.rhtml +36 -35
  39. data/app/views/wiki/todo.rhtml +2 -2
  40. data/app/views/wiki_words_help.rhtml +8 -8
  41. data/libraries/action_controller_servlet.rb +202 -202
  42. data/libraries/madeleine_service.rb +162 -162
  43. data/pimki.rb +181 -181
  44. metadata +11 -12
  45. data/README +0 -172
  46. data/app/models/chunks/acronym.rb +0 -19
  47. data/app/views/wiki/test.rhtml +0 -25
  48. data/libraries/secure_web_controller_server.rb +0 -106
@@ -44,9 +44,9 @@ class WikiContent < String
44
44
 
45
45
  # Moved URIChunk from pre-engine to post-engine, as it clashed with the textile
46
46
  # markup of "link":URL.
47
- PRE_ENGINE_ACTIONS = [ NoWiki, Category, Include, Literal::Pre, WikiSymbol,
47
+ PRE_ENGINE_ACTIONS = [ NoWiki, Category, Include, WikiSymbol,
48
48
  WikiChunk::Link, WikiChunk::BlikiLink ]
49
- POST_ENGINE_ACTIONS = [ Literal::Tags, URIChunk, WikiChunk::Word, Todo ]
49
+ POST_ENGINE_ACTIONS = [ Literal::Tags, Literal::Pre, URIChunk, WikiChunk::Word, Todo ]
50
50
 
51
51
 
52
52
  DEFAULT_OPTS = {
@@ -1,167 +1,171 @@
1
-
2
-
3
- require "madeleine_service"
4
- require "web"
5
- require "page"
6
- require "author"
7
-
8
- class WikiService < MadeleineService
9
- attr_reader :webs, :system
10
- attr_accessor :default_web
11
-
12
- # These methods do not change the state of persistent objects, and
13
- # should not be logged by Madeleine
14
- automatic_read_only :authenticate, :read_page, :read_bliki_entry, :setup?, :webs
15
-
16
- def initialize
17
- @webs, @system = {}, {}
18
- end
19
-
20
- def setup?
21
- !@system.empty?
22
- end
23
-
24
- def authenticate(password)
25
- password == (@system["password"] || "pimki")
26
- end
27
-
28
- def setup(password, web_name, web_address)
29
- @system["password"] = password
30
- create_web(web_name, web_address)
31
- end
32
-
33
- def create_web(name, address, password = nil)
34
- @webs[address] = Web.new(name, address, password) unless @webs[address]
35
- end
36
-
37
- def update_web(old_address, new_address, name, markup, color, additional_style, safe_mode = false,
38
- password = nil, published = false, default_to_published = false, brackets_only = false,
39
- count_pages = false, mind_map_size="7,7", symbols_map=nil, links_map=nil,
40
- snapshots_interval = 1,
41
- enable_dclick_edit=nil, enable_menu=true, check_pass_on_edit=false,
42
- prog=nil, graph_type=nil, missing=nil, show_authors=nil, show_leaves=nil, selected_categories=nil)
43
-
44
- if old_address != new_address
45
- @webs[new_address] = @webs[old_address]
46
- @webs.delete(old_address)
47
- @webs[new_address].address = new_address
48
- end
49
-
50
- self.class.snapshot_interval_hours = snapshots_interval
51
-
52
- web = @webs[new_address]
53
- web.refresh_revisions if settings_changed?(web, markup, safe_mode, brackets_only)
54
-
55
- web.name, web.markup, web.color, web.additional_style, web.safe_mode =
56
- name, markup, color, additional_style, safe_mode
57
-
58
- web.password, web.published, web.default_to_published, web.brackets_only, web.count_pages =
59
- password, published, default_to_published, brackets_only, count_pages
60
-
61
- web.enable_dclick_edit, web.enable_menu, web.check_pass_on_edit = enable_dclick_edit, enable_menu, check_pass_on_edit
62
-
63
- web.mind_map_size, web.mm_prog, web.mm_graph_type, web.mm_show_missing =
64
- mind_map_size, prog, graph_type, missing
65
-
66
- web.mm_show_authors, web.mm_show_leaves, web.mm_selected_categories =
67
- show_authors, show_leaves, selected_categories
68
-
69
- web.symbols_map, web.links_map = symbols_map, links_map
70
- end
71
-
72
- def read_page(web_address, page_name)
73
- web = @webs[web_address]
74
- web ? web.pages[page_name] : nil
75
- end
76
-
77
- def write_page(web_address, page_name, content, written_on, author)
78
- page = Page.new(@webs[web_address], page_name, content, written_on, author)
79
- @webs[web_address].add_page(page)
80
- page
81
- end
82
-
83
- def revise_page(web_address, page_name, content, revised_on, author, edit_type)
84
- page = read_page(web_address, page_name)
85
- page.revise(content, revised_on, author, edit_type)
86
- page
87
- end
88
-
89
- def rollback_page(web_address, page_name, revision_number, created_at, author_id = nil)
90
- page = read_page(web_address, page_name)
91
- page.rollback(revision_number, created_at, author_id)
92
- page
93
- end
94
-
95
- def remove_orphaned_pages(web_address)
96
- @webs[web_address].remove_pages(@webs[web_address].select.orphaned_pages)
97
- end
98
-
99
- # deletes a page from the web.
100
- def delete_page(web_address, page_name) #{{{
101
- @webs[web_address].pages.delete(page_name)
102
- end #}}}
103
-
104
- # renames a page in the web.
105
- def rename_page(web_address, old_page_name, new_page_name) #{{{
106
- web = @webs[web_address]
107
- page = web.pages.delete(old_page_name)
108
- page or raise "unknown page: #{old_page_name.to_s}; #{web.pages.keys.join(',')}"
109
- page.name = new_page_name
110
- web.pages[new_page_name] = page
111
- end #}}}
112
-
113
- def save_menu_pref(web_address, type, limit, content, category, author) #{{{
114
- web = @webs[web_address]
115
- web.menu_type = type
116
- web.menu_limit = limit
117
- web.menu_category = category
118
-
119
- if Page === web.menu_content
120
- web.menu_content.revise(
121
- content, Time.now, '', author
122
- )
123
- else
124
- # Protect old Pimki storages.
125
- web.menu_content = Page.new(
126
- web, 'menu', content, Time.now, ''
127
- )
128
- end
129
- end #}}}
130
-
131
- # Bliki commands -------------------------------------------------------------
132
-
133
- def read_bliki_entry(web_address, page_name)
134
- @webs[web_address].bliki[page_name]
135
- end
136
-
137
- def write_bliki_entry(web_address, page_name, content, written_on, author)
138
- page = Page.new(@webs[web_address], page_name, content, written_on, author)
139
- @webs[web_address].add_bliki_entry(page)
140
- page
141
- end
142
-
143
- def revise_bliki_entry(web_address, page_name, content, revised_on, author)
144
- page = read_bliki_entry(web_address, page_name)
145
- page.revise(content, revised_on, author)
146
- page
147
- end
148
-
149
- def rollback_bliki_entry(web_address, page_name, revision_number, created_at)
150
- page = read_bliki_entry(web_address, page_name)
151
- page.rollback(revision_number, created_at)
152
- page
153
- end
154
-
155
- def delete_bliki_entry(web_address, page_name) #{{{
156
- @webs[web_address].bliki.delete(page_name)
157
- end #}}}
158
-
159
- private
160
- def settings_changed?(web, markup, safe_mode, brackets_only)
161
- web.markup != markup ||
162
- web.safe_mode != safe_mode ||
163
- web.brackets_only != brackets_only
164
- end
165
- end
166
-
1
+
2
+
3
+ require "madeleine_service"
4
+ require "web"
5
+ require "page"
6
+ require "author"
7
+
8
+ class WikiService < MadeleineService
9
+ attr_reader :webs, :system
10
+ attr_accessor :default_web
11
+
12
+ # These methods do not change the state of persistent objects, and
13
+ # should not be logged by Madeleine
14
+ automatic_read_only :authenticate, :read_page, :read_bliki_entry, :setup?, :webs
15
+
16
+ def initialize
17
+ @webs, @system = {}, {}
18
+ end
19
+
20
+ def setup?
21
+ !@system.empty?
22
+ end
23
+
24
+ def authenticate(password)
25
+ password == (@system["password"] || "pimki")
26
+ end
27
+
28
+ def setup(password, web_name, web_address)
29
+ @system["password"] = password
30
+ create_web(web_name, web_address)
31
+ end
32
+
33
+ def create_web(name, address, password = nil)
34
+ @webs[address] = Web.new(name, address, password) unless @webs[address]
35
+ end
36
+
37
+ def update_web(old_address, new_address, name, markup, color, additional_style, safe_mode = false,
38
+ password = nil, published = false, default_to_published = false, brackets_only = false,
39
+ count_pages = false, mind_map_size="7,7", symbols_map=nil, links_map=nil,
40
+ snapshots_interval = 1,
41
+ enable_dclick_edit=nil, enable_menu=true, check_pass_on_edit=false,
42
+ prog=nil, graph_type=nil, missing=nil, show_authors=nil, show_leaves=nil, selected_categories=nil)
43
+
44
+ if old_address != new_address
45
+ @webs[new_address] = @webs[old_address]
46
+ @webs.delete(old_address)
47
+ @webs[new_address].address = new_address
48
+ end
49
+
50
+ self.class.snapshot_interval_hours = snapshots_interval
51
+
52
+ web = @webs[new_address]
53
+ web.refresh_revisions if settings_changed?(web, markup, safe_mode, brackets_only)
54
+
55
+ web.name, web.markup, web.color, web.additional_style, web.safe_mode =
56
+ name, markup, color, additional_style, safe_mode
57
+
58
+ web.password, web.published, web.default_to_published, web.brackets_only, web.count_pages =
59
+ password, published, default_to_published, brackets_only, count_pages
60
+
61
+ web.enable_dclick_edit, web.enable_menu, web.check_pass_on_edit = enable_dclick_edit, enable_menu, check_pass_on_edit
62
+
63
+ web.mind_map_size, web.mm_prog, web.mm_graph_type, web.mm_show_missing =
64
+ mind_map_size, prog, graph_type, missing
65
+
66
+ web.mm_show_authors, web.mm_show_leaves, web.mm_selected_categories =
67
+ show_authors, show_leaves, selected_categories
68
+
69
+ web.symbols_map, web.links_map = symbols_map, links_map
70
+ end
71
+
72
+ def read_page(web_address, page_name)
73
+ web = @webs[web_address]
74
+ web ? web.pages[page_name] : nil
75
+ end
76
+
77
+ def write_page(web_address, page_name, content, written_on, author)
78
+ page = Page.new(@webs[web_address], page_name, content, written_on, author)
79
+ @webs[web_address].add_page(page)
80
+ page
81
+ end
82
+
83
+ def revise_page(web_address, page_name, content, revised_on, author, edit_type)
84
+ page = read_page(web_address, page_name)
85
+ page.revise(content, revised_on, author, edit_type)
86
+ page
87
+ end
88
+
89
+ def rollback_page(web_address, page_name, revision_number, created_at, author_id = nil)
90
+ page = read_page(web_address, page_name)
91
+ page.rollback(revision_number, created_at, author_id)
92
+ page
93
+ end
94
+
95
+ def remove_orphaned_pages(web_address)
96
+ @webs[web_address].remove_pages(@webs[web_address].select.orphaned_pages)
97
+ end
98
+
99
+ # Page Admin commands --------------------------------------------------------
100
+
101
+ # deletes a page from the web.
102
+ def delete_page(web_address, page_name) #{{{
103
+ @webs[web_address].pages.delete(page_name)
104
+ end #}}}
105
+
106
+ # renames a page in the web.
107
+ def rename_page(web_address, old_page_name, new_page_name) #{{{
108
+ web = @webs[web_address]
109
+ page = web.pages.delete(old_page_name)
110
+ page or raise "unknown page: #{old_page_name.to_s}; #{web.pages.keys.join(',')}"
111
+ page.name = new_page_name
112
+ web.pages[new_page_name] = page
113
+ end #}}}
114
+
115
+ # Menu commands --------------------------------------------------------------
116
+
117
+ def save_menu_pref(web_address, type, limit, content, category, author) #{{{
118
+ web = @webs[web_address]
119
+ web.menu_type = type
120
+ web.menu_limit = limit
121
+ web.menu_category = category
122
+
123
+ if Page === web.menu_content
124
+ web.menu_content.revise(
125
+ content, Time.now, '', author
126
+ )
127
+ else
128
+ # Protect old Pimki storages.
129
+ web.menu_content = Page.new(
130
+ web, 'menu', content, Time.now, ''
131
+ )
132
+ end
133
+ end #}}}
134
+
135
+ # Bliki commands -------------------------------------------------------------
136
+
137
+ def read_bliki_entry(web_address, page_name)
138
+ @webs[web_address].bliki[page_name]
139
+ end
140
+
141
+ def write_bliki_entry(web_address, page_name, content, written_on, author)
142
+ page = Page.new(@webs[web_address], page_name, content, written_on, author)
143
+ @webs[web_address].add_bliki_entry(page)
144
+ page
145
+ end
146
+
147
+ def revise_bliki_entry(web_address, page_name, content, revised_on, author)
148
+ page = read_bliki_entry(web_address, page_name)
149
+ page.revise(content, revised_on, author)
150
+ page
151
+ end
152
+
153
+ def rollback_bliki_entry(web_address, page_name, revision_number, created_at)
154
+ page = read_bliki_entry(web_address, page_name)
155
+ page.rollback(revision_number, created_at)
156
+ page
157
+ end
158
+
159
+ def delete_bliki_entry(web_address, page_name) #{{{
160
+ @webs[web_address].bliki.delete(page_name)
161
+ end #}}}
162
+
163
+ private
164
+ def settings_changed?(web, markup, safe_mode, brackets_only)
165
+ web.markup != markup ||
166
+ web.safe_mode != safe_mode ||
167
+ web.brackets_only != brackets_only
168
+ end
169
+ end
170
+
167
171
  # jEdit :folding=indent:collapseFolds=1:
@@ -1,29 +1,29 @@
1
-
2
- # Contains all the methods for finding and replacing wiki words
3
- module WikiWords
4
- # In order of appearance: Latin, greek, cyrillian, armenian
5
- I18N_HIGHER_CASE_LETTERS =
6
- "À�?ÂÃÄÅĀĄĂÆÇĆČĈĊĎ�?ÈÉÊËĒĘĚĔĖĜĞĠĢĤĦÌ�?Î�?ĪĨĬĮİIJĴĶ�?ĽĹĻĿÑŃŇŅŊÒÓÔÕÖØŌ�?ŎŒŔŘŖŚŠŞŜȘŤŢŦȚÙÚÛÜŪŮŰŬŨŲŴ�?ŶŸŹŽŻ" +
7
- "ΑΒΓΔΕΖΗΘΙΚΛΜ�?ΞΟΠΡΣΤΥΦΧΨΩ" +
8
- "ΆΈΉΊΌΎ�?ѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎ�?ҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾ�?ӃӅӇӉӋ�?�?ӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸЖ" +
9
- "ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀ�?ՂՃՄՅՆՇՈՉՊՋՌ�?�?�?ՑՒՓՔՕՖ"
10
-
11
- I18N_LOWER_CASE_LETTERS =
12
- "àáâãäå�?ąăæçć�?ĉċ�?đèéêëēęěĕėƒ�?ğġģĥħìíîïīĩĭįıijĵķĸłľĺļŀñńňņʼnŋòóôõöø�?ő�?œŕřŗśšş�?șťţŧțùúûüūůűŭũųŵýÿŷžżźÞþßſ�?ð" +
13
- "άέήίΰαβγδεζηθικλμνξοπ�?ςστυφχψωϊϋό�?ώ�?" +
14
- "абвгдежзийклмнопр�?туфхцчшщъыь�?ю�?�?ёђѓєѕіїјљћќ�?ўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿ�?ҋ�?�?ґғҕҗҙқ�?ҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӀӂӄӆӈӊӌӎӑӓӕӗәӛ�?ӟӡӣӥӧөӫӭӯӱӳӵӹ" +
15
- "աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտր�?ւփքօֆև"
16
-
17
- DIGITS = "0123456789"
18
-
19
- WIKI_WORD_PATTERN = '[A-Z' + I18N_HIGHER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + DIGITS + ']*[A-Z' + I18N_HIGHER_CASE_LETTERS + DIGITS + ']\w+'
20
- CAMEL_CASED_WORD_BORDER = /([a-z#{I18N_LOWER_CASE_LETTERS}#{DIGITS}]|[A-Z#{I18N_HIGHER_CASE_LETTERS}]{2,})(?=[A-Z#{I18N_HIGHER_CASE_LETTERS}]\B)/u
21
-
22
- def self.separate(wiki_word, ignore_separation = false)
23
- if ignore_separation or wiki_word.match(/^[A-Z#{I18N_HIGHER_CASE_LETTERS}]+$/) or wiki_word.match(/\s/)
24
- wiki_word
25
- else
26
- wiki_word.gsub(CAMEL_CASED_WORD_BORDER, '\1 \2').gsub(/(.)(\d+)/u) { $1 == '_' ? "#$1#$2" : "#$1 #$2" }
27
- end
28
- end
1
+
2
+ # Contains all the methods for finding and replacing wiki words
3
+ module WikiWords
4
+ # In order of appearance: Latin, greek, cyrillian, armenian
5
+ I18N_HIGHER_CASE_LETTERS =
6
+ "À�?ÂÃÄÅĀĄĂÆÇĆČĈĊĎ�?ÈÉÊËĒĘĚĔĖĜĞĠĢĤĦÌ�?Î�?ĪĨĬĮİIJĴĶ�?ĽĹĻĿÑŃŇŅŊÒÓÔÕÖØŌ�?ŎŒŔŘŖŚŠŞŜȘŤŢŦȚÙÚÛÜŪŮŰŬŨŲŴ�?ŶŸŹŽŻ" +
7
+ "ΑΒΓΔΕΖΗΘΙΚΛΜ�?ΞΟΠΡΣΤΥΦΧΨΩ" +
8
+ "ΆΈΉΊΌΎ�?ѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎ�?ҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾ�?ӃӅӇӉӋ�?�?ӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸЖ" +
9
+ "ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀ�?ՂՃՄՅՆՇՈՉՊՋՌ�?�?�?ՑՒՓՔՕՖ"
10
+
11
+ I18N_LOWER_CASE_LETTERS =
12
+ "àáâãäå�?ąăæçć�?ĉċ�?đèéêëēęěĕėƒ�?ğġģĥħìíîïīĩĭįıijĵķĸłľĺļŀñńňņʼnŋòóôõöø�?ő�?œŕřŗśšş�?șťţŧțùúûüūůűŭũųŵýÿŷžżźÞþßſ�?ð" +
13
+ "άέήίΰαβγδεζηθικλμνξοπ�?ςστυφχψωϊϋό�?ώ�?" +
14
+ "абвгдежзийклмнопр�?туфхцчшщъыь�?ю�?�?ёђѓєѕіїјљћќ�?ўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿ�?ҋ�?�?ґғҕҗҙқ�?ҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӀӂӄӆӈӊӌӎӑӓӕӗәӛ�?ӟӡӣӥӧөӫӭӯӱӳӵӹ" +
15
+ "աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտր�?ւփքօֆև"
16
+
17
+ DIGITS = "0123456789"
18
+
19
+ WIKI_WORD_PATTERN = '[A-Z' + I18N_HIGHER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + DIGITS + ']*[A-Z' + I18N_HIGHER_CASE_LETTERS + DIGITS + ']\w+'
20
+ CAMEL_CASED_WORD_BORDER = /([a-z#{I18N_LOWER_CASE_LETTERS}#{DIGITS}]|[A-Z#{I18N_HIGHER_CASE_LETTERS}]{2,})(?=[A-Z#{I18N_HIGHER_CASE_LETTERS}]\B)/u
21
+
22
+ def self.separate(wiki_word, ignore_separation = false)
23
+ if ignore_separation or wiki_word.match(/^[A-Z#{I18N_HIGHER_CASE_LETTERS}]+$/) or wiki_word.match(/\s/)
24
+ wiki_word
25
+ else
26
+ wiki_word.gsub(CAMEL_CASED_WORD_BORDER, '\1 \2').gsub(/([a-z#{I18N_LOWER_CASE_LETTERS}A-Z#{I18N_HIGHER_CASE_LETTERS}])(\d+)/u) { $1 == '_' ? "#$1#$2" : "#$1 #$2" }
27
+ end
28
+ end
29
29
  end
@@ -1,37 +1,37 @@
1
- <% def html_escape str
2
- str.gsub( '<', '&lt;').gsub( '>', '&gt;').gsub('&', '&amp;')
3
- end %>
4
-
5
- <?xml version="1.0" encoding="UTF-8"?>
6
- <html xmlns="http://www.w3.org/1999/xhtml">
7
- <head>
8
- <title>Internal Error</title>
9
-
10
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
11
- <link rel="Stylesheet" href="../../static_style_sheet/" type="text/css" media="screen" />
12
- </head>
13
- <body>
14
-
15
- <h3>An error has occured!</h3>
16
-
17
- <p>We're sorry, we're not perfect... but we want to be! If you have the time, please go to the pimki <a href="http://rubyforge.org/tracker/?atid=1750&group_id=447&func=browse">BUG tracker</a> at RubyForge and open a bug report. Please supply a short description of what you did when this happended, the system you're on, etc. and paste everything below this line in the bug report. It will greatly help in development. Thank you for your efforts!</p>
18
-
19
- <hr />
20
-
21
- <p><b>Error message:</b>
22
- <code style="color:red"><%= html_escape @error_details.message %></code>
23
- </p>
24
-
25
- <p><b>Action:</b> <%= @action_name %></p>
26
-
27
- <p><b>Request:</b> <%= @req %></p>
28
-
29
- <p><b>Backtrace:</b></p>
30
- <p><table border="0">
31
- <% for line in @error_details.backtrace %>
32
- <tr><td><code><%= line.sub(/(.*)\/(\w+\.rb):(\d+):in (.*)/, '\1/<b>\2</b>:\3:in <b>\4</b>') %></code></td></tr>
33
- <% end %>
34
- </p>
35
-
36
- </body>
37
- </html>
1
+ <% def html_escape str
2
+ str.gsub( '<', '&lt;').gsub( '>', '&gt;').gsub('&', '&amp;')
3
+ end %>
4
+
5
+ <?xml version="1.0" encoding="UTF-8"?>
6
+ <html xmlns="http://www.w3.org/1999/xhtml">
7
+ <head>
8
+ <title>Internal Error</title>
9
+
10
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
11
+ <link rel="Stylesheet" href="../../static_style_sheet/" type="text/css" media="screen" />
12
+ </head>
13
+ <body>
14
+
15
+ <h3>An error has occured!</h3>
16
+
17
+ <p>We're sorry, we're not perfect... but we want to be! If you have the time, please go to the pimki <a href="http://rubyforge.org/tracker/?atid=1750&group_id=447&func=browse">BUG tracker</a> at RubyForge and open a bug report. Please supply a short description of what you did when this happended, the system you're on, etc. and paste everything below this line in the bug report. It will greatly help in development. Thank you for your efforts!</p>
18
+
19
+ <hr />
20
+
21
+ <p><b>Error message:</b>
22
+ <code style="color:red"><%= html_escape @error_details.message %></code>
23
+ </p>
24
+
25
+ <p><b>Action:</b> <%= @action_name %></p>
26
+
27
+ <p><b>Request:</b> <%= @req %></p>
28
+
29
+ <p><b>Backtrace:</b></p>
30
+ <p><table border="0">
31
+ <% for line in @error_details.backtrace %>
32
+ <tr><td><code><%= line.sub(/(.*)\/(\w+\.rb):(\d+):in (.*)/, '\1/<b>\2</b>:\3:in <b>\4</b>') %></code></td></tr>
33
+ <% end %>
34
+ </p>
35
+
36
+ </body>
37
+ </html>