motiro 0.6.10 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +7 -11
- data/LICENSE +602 -262
- data/README +6 -7
- data/README.en +5 -6
- data/README.pt-br +6 -6
- data/app/controllers/account_controller.rb +5 -6
- data/app/controllers/application.rb +5 -6
- data/app/controllers/javascript_controller.rb +6 -7
- data/app/controllers/report_controller.rb +5 -6
- data/app/controllers/root_controller.rb +5 -1
- data/app/controllers/wiki_controller.rb +10 -8
- data/app/core/cache_reporter.rb +6 -7
- data/app/core/cache_reporter_fetcher.rb +6 -6
- data/app/core/chief_editor.rb +5 -6
- data/app/core/license.rb +598 -0
- data/app/core/reporter.rb +6 -7
- data/app/core/reporter_driver.rb +5 -5
- data/app/core/reporter_fetcher.rb +6 -7
- data/app/core/settings.rb +5 -6
- data/app/core/version.rb +1 -1
- data/app/core/wiki_reporter.rb +5 -6
- data/app/helpers/application_helper.rb +33 -16
- data/app/helpers/default_page_provider.rb +6 -7
- data/app/helpers/report_helper.rb +5 -6
- data/app/helpers/wiki_helper.rb +48 -0
- data/app/models/change.rb +5 -6
- data/app/models/chunk.rb +5 -6
- data/app/models/feed_observer.rb +6 -7
- data/app/models/headline.rb +5 -6
- data/app/models/page.rb +16 -7
- data/app/models/revision.rb +9 -9
- data/app/models/user.rb +6 -9
- data/app/models/wiki_reference.rb +5 -6
- data/app/models/wiki_sweeper.rb +6 -7
- data/app/ports/chdir_runner.rb +6 -7
- data/app/ports/runner.rb +5 -5
- data/app/reporters/darcs_connection.rb +6 -7
- data/app/reporters/darcs_reporter.rb +9 -10
- data/app/reporters/darcs_temp_repo.rb +5 -6
- data/app/reporters/events_reporter.rb +5 -6
- data/app/reporters/features_reporter.rb +5 -6
- data/app/reporters/subversion_reporter.rb +5 -6
- data/app/reporters/svn_connection.rb +6 -6
- data/app/reporters/svn_settings.rb +5 -5
- data/app/views/account/_authorization.rhtml +31 -23
- data/app/views/account/_availability.rhtml +1 -3
- data/app/views/javascript/motiro.rjs +6 -8
- data/app/views/layouts/_bottom.rhtml +7 -0
- data/app/views/report/list.rhtml +1 -1
- data/app/views/root/license.rhtml +5 -0
- data/app/views/wiki/_editbar.rhtml +2 -18
- data/app/views/wiki/_properties_show.rhtml +2 -1
- data/app/views/wiki/_show_event.rhtml +3 -1
- data/app/views/wiki/_show_feature.rhtml +2 -2
- data/app/views/wiki/diff.rhtml +2 -2
- data/app/views/wiki/page_feed.rxml +1 -13
- data/app/views/wiki/raw.rhtml +7 -0
- data/app/views/wiki/show.rhtml +1 -1
- data/app/views/wiki/sourcediff.rhtml +2 -2
- data/bin/motiro +5 -6
- data/config/initializers/motiro_core.rb +1 -0
- data/config/routes.rb +9 -6
- data/db/translation/pt-BR.rb +20 -6
- data/lib/array_extensions.rb +6 -7
- data/lib/diff_chunk_builder.rb +5 -6
- data/lib/differ.rb +5 -6
- data/lib/string_extensions.rb +5 -6
- data/lib/stub_hash.rb +5 -6
- data/lib/tasks/packaging.rake +7 -7
- data/lib/tasks/testing.rake +5 -6
- data/lib/tick_daemon.rb +5 -6
- data/lib/wiki_link_handler.rb +5 -6
- data/lib/wiki_renderer.rb +5 -6
- data/public/images/calendar.gif +0 -0
- data/public/images/done.gif +0 -0
- data/public/images/error.gif +0 -0
- data/public/images/not-done.gif +0 -0
- data/public/images/rss.gif +0 -0
- data/public/stylesheets/motiro.css +163 -170
- data/script/ticker +5 -6
- data/test/acceptance/account_test.rb +6 -7
- data/test/acceptance/darcs_test.rb +6 -7
- data/test/acceptance/events_test.rb +5 -6
- data/test/acceptance/main_page_test.rb +6 -7
- data/test/acceptance/subversion_test.rb +5 -6
- data/test/acceptance/ts_all_suites.rb +5 -6
- data/test/acceptance/wiki_test.rb +5 -6
- data/test/contract/darcs_test.rb +5 -6
- data/test/contract/svn_test.rb +5 -6
- data/test/fixtures/pages.yml +12 -0
- data/test/fixtures/revisions.yml +61 -0
- data/test/functional/report_controller_test.rb +5 -6
- data/test/functional/report_features_test.rb +5 -6
- data/test/functional/report_subversion_test.rb +5 -6
- data/test/functional/root_controller_test.rb +19 -4
- data/test/functional/wiki_controller_test.rb +66 -8
- data/test/lib/acceptance_test_case.rb +6 -7
- data/test/lib/darcs_excerpts.rb +5 -6
- data/test/lib/darcs_repo.rb +5 -6
- data/test/lib/hash_extensions.rb +5 -6
- data/test/lib/live_mode_test.rb +6 -7
- data/test/lib/netutils.rb +6 -7
- data/test/lib/platform_thread.rb +5 -5
- data/test/lib/selenium_extensions.rb +6 -7
- data/test/lib/stubio.rb +6 -7
- data/test/lib/webserver.rb +5 -6
- data/test/meta/darcs_repo_test.rb +6 -6
- data/test/meta/local_svn_test.rb +6 -7
- data/test/meta/platform_thread_test.rb +5 -5
- data/test/meta/stubio_test.rb +6 -7
- data/test/stubs/wiki_link_handler.rb +5 -6
- data/test/test_helper.rb +5 -6
- data/test/unit/array_extensions_test.rb +5 -6
- data/test/unit/cache_reporter_fetcher_test.rb +5 -6
- data/test/unit/cache_reporter_test.rb +5 -6
- data/test/unit/change_test.rb +5 -6
- data/test/unit/chdir_runner_test.rb +5 -6
- data/test/unit/chief_editor_test.rb +5 -6
- data/test/unit/darcs_connection_test.rb +5 -6
- data/test/unit/darcs_reporter_test.rb +14 -6
- data/test/unit/darcs_temp_repo_test.rb +5 -6
- data/test/unit/default_page_provider_test.rb +5 -6
- data/test/unit/diff_chunk_builder_test.rb +6 -7
- data/test/unit/headline_test.rb +5 -6
- data/test/unit/page_test.rb +45 -6
- data/test/unit/reporter_driver_test.rb +6 -7
- data/test/unit/reporter_test.rb +6 -7
- data/test/unit/revision_test.rb +17 -13
- data/test/unit/runner_test.rb +5 -6
- data/test/unit/string_extensions_test.rb +6 -7
- data/test/unit/svn_connection_test.rb +5 -5
- data/test/unit/svn_reporter_interaction_test.rb +6 -7
- data/test/unit/svn_reporter_test.rb +5 -6
- data/test/unit/svn_settings_test.rb +6 -7
- data/test/unit/user_test.rb +6 -11
- data/test/unit/wiki_link_handler_test.rb +5 -6
- data/test/unit/wiki_renderer_test.rb +7 -7
- data/test/unit/wiki_reporter_test.rb +5 -6
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiast.rb +15 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikihtmlgenerator.rb +18 -3
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikilexer.rb +48 -9
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikilinkhandler.rb +7 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiparser.rb +534 -485
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiparser.y +25 -1
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiwalker.rb +13 -0
- data/vendor/mediacloth-trunk/test/data/html1 +3 -3
- data/vendor/mediacloth-trunk/test/data/html10 +16 -16
- data/vendor/mediacloth-trunk/test/data/html11 +1 -1
- data/vendor/mediacloth-trunk/test/data/html13 +1 -1
- data/vendor/mediacloth-trunk/test/data/html4 +1 -1
- data/vendor/mediacloth-trunk/test/data/html5 +4 -4
- data/vendor/mediacloth-trunk/test/data/html7 +13 -1
- data/vendor/mediacloth-trunk/test/data/html9 +1 -1
- data/vendor/mediacloth-trunk/test/data/input1 +2 -0
- data/vendor/mediacloth-trunk/test/data/input7 +13 -1
- data/vendor/mediacloth-trunk/test/data/lex1 +1 -1
- data/vendor/mediacloth-trunk/test/data/lex7 +13 -1
- data/vendor/mediacloth-trunk/test/htmlgenerator.rb +26 -1
- data/vendor/mediacloth-trunk/test/lexer.rb +10 -0
- metadata +95 -103
- data/build/build.rb +0 -29
- data/config/report/subversion.yml +0 -26
- data/public/images/calendar.png +0 -0
- data/public/images/done.png +0 -0
- data/public/images/not-done.png +0 -0
- data/public/images/rss.png +0 -0
data/app/core/reporter.rb
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
require 'rubygems'
|
|
19
18
|
require 'active_support'
|
|
@@ -102,4 +101,4 @@ public
|
|
|
102
101
|
|
|
103
102
|
add button[:older]
|
|
104
103
|
|
|
105
|
-
end
|
|
104
|
+
end
|
data/app/core/reporter_driver.rb
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
17
|
|
|
18
18
|
require 'core/reporter_fetcher'
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
require_dependency 'core/settings'
|
|
19
18
|
require_dependency 'ports/reporter_loader'
|
|
@@ -36,4 +35,4 @@ class ReporterFetcher
|
|
|
36
35
|
reporters << EventsReporter.new
|
|
37
36
|
end
|
|
38
37
|
|
|
39
|
-
end
|
|
38
|
+
end
|
data/app/core/settings.rb
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
require 'yaml'
|
|
19
18
|
|
data/app/core/version.rb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
MOTIRO_VERSION = '0.6.
|
|
1
|
+
MOTIRO_VERSION = '0.6.11'
|
data/app/core/wiki_reporter.rb
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
require 'core/reporter'
|
|
19
18
|
require 'core/settings'
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
# Methods added to this helper will be available to all templates in the application.
|
|
19
18
|
module ApplicationHelper
|
|
@@ -38,13 +37,12 @@ module ApplicationHelper
|
|
|
38
37
|
|
|
39
38
|
def pagetext(title, revision=nil, &block)
|
|
40
39
|
content = capture(&block)
|
|
41
|
-
b = Builder::XmlMarkup.new
|
|
42
40
|
xml = b.div(:class => 'pagetext') do
|
|
43
41
|
b.a(:href => url_for(:controller => 'wiki', :action => 'history',
|
|
44
42
|
:page_name => @page.name, :locale => @locale,
|
|
45
43
|
:format => 'xml'),
|
|
46
44
|
:class => 'rss') do
|
|
47
|
-
b << image_tag("rss.
|
|
45
|
+
b << image_tag("rss.gif", :border => 0, :class => 'rss',
|
|
48
46
|
:alt => 'Changes to %s' / @page.name)
|
|
49
47
|
end unless @page.nil?
|
|
50
48
|
b.div(:id => 'crumbs') do
|
|
@@ -68,12 +66,25 @@ module ApplicationHelper
|
|
|
68
66
|
concat(xml, block.binding)
|
|
69
67
|
end
|
|
70
68
|
|
|
69
|
+
def parsing_error_box
|
|
70
|
+
content_tag(:div,
|
|
71
|
+
image_tag('error.gif') +
|
|
72
|
+
content_tag(:p, ('The following wiki code contains an ' +
|
|
73
|
+
'error that prevents it from being ' +
|
|
74
|
+
'correctly formatted.').t),
|
|
75
|
+
:class => 'message wikierror')
|
|
76
|
+
end
|
|
77
|
+
|
|
71
78
|
def render_wiki(text)
|
|
72
|
-
|
|
79
|
+
begin
|
|
80
|
+
@renderer.render_wiki_text(text)
|
|
81
|
+
rescue
|
|
82
|
+
parsing_error_box + content_tag(:pre, h(text), :class => 'wikisource')
|
|
83
|
+
end
|
|
73
84
|
end
|
|
74
85
|
|
|
75
86
|
def render_diff_table(chunks)
|
|
76
|
-
|
|
87
|
+
b.table :class => 'diff', :cellspacing => '0' do |b|
|
|
77
88
|
b.colgroup do
|
|
78
89
|
b.col :class => 'line_number'
|
|
79
90
|
b.col :class => 'left'
|
|
@@ -84,19 +95,19 @@ module ApplicationHelper
|
|
|
84
95
|
if chunk.separator?
|
|
85
96
|
b.tbody :class => 'separator' do
|
|
86
97
|
b.tr do
|
|
87
|
-
b.
|
|
98
|
+
b.th
|
|
88
99
|
b.td('%s more lines' / chunk.num_lines.to_s, :colspan => '2')
|
|
89
|
-
b.
|
|
100
|
+
b.th
|
|
90
101
|
end
|
|
91
102
|
end
|
|
92
103
|
else
|
|
93
104
|
b.tbody :class => chunk.action.to_s do
|
|
94
105
|
chunk.lines.each do |line|
|
|
95
106
|
b.tr do
|
|
96
|
-
b.
|
|
97
|
-
b.td {b.pre{b << (h(line.original_text) || ' ')}}
|
|
98
|
-
b.td {b.pre{b << (h(line.modified_text) || ' ')}}
|
|
99
|
-
b.
|
|
107
|
+
b.th {b << (line.original_position || ' ').to_s}
|
|
108
|
+
b.td {b.pre {b << (h(line.original_text) || ' ')}}
|
|
109
|
+
b.td {b.pre {b << (h(line.modified_text) || ' ')}}
|
|
110
|
+
b.th {b << (line.modified_position || ' ').to_s}
|
|
100
111
|
end
|
|
101
112
|
end
|
|
102
113
|
end
|
|
@@ -105,6 +116,12 @@ module ApplicationHelper
|
|
|
105
116
|
end
|
|
106
117
|
end
|
|
107
118
|
|
|
119
|
+
private
|
|
120
|
+
|
|
121
|
+
def b
|
|
122
|
+
@markup ||= Builder::XmlMarkup.new
|
|
123
|
+
end
|
|
124
|
+
|
|
108
125
|
end
|
|
109
126
|
|
|
110
127
|
class NullUser
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
class DefaultPageProvider
|
|
19
18
|
|
|
@@ -25,4 +24,4 @@ class DefaultPageProvider
|
|
|
25
24
|
@provider.find_by_name(name) || Page.new(:name => name)
|
|
26
25
|
end
|
|
27
26
|
|
|
28
|
-
end
|
|
27
|
+
end
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
module ReportHelper
|
|
19
18
|
|
data/app/helpers/wiki_helper.rb
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
module WikiHelper
|
|
2
2
|
|
|
3
|
+
def edition_link(user, page)
|
|
4
|
+
if user.nil?
|
|
5
|
+
content_tag('span', "#{'Edit'.t} #{'(requires authentication)'.t}",
|
|
6
|
+
:class => 'disabled')
|
|
7
|
+
elsif !user.can_edit?(page)
|
|
8
|
+
'Edit'.t + ' ' + content_tag('span', '(not authorized)'.t,
|
|
9
|
+
:class => flash[:not_authorized] ? 'marked' : 'none')
|
|
10
|
+
else
|
|
11
|
+
link_to('Edit'.t, :controller => 'wiki', :action => 'edit',
|
|
12
|
+
:page_name => page.name)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def switch_view_link(page)
|
|
17
|
+
action, text = 'raw' == params[:action].to_s ? ['show','View wiki output'] :
|
|
18
|
+
['raw' ,'View raw text']
|
|
19
|
+
'| ' + link_to(text.t, :controller => :wiki, :action => action,
|
|
20
|
+
:page_name => page.name, :revision => page.position)
|
|
21
|
+
end
|
|
22
|
+
|
|
3
23
|
def page_history_link(page)
|
|
4
24
|
case page.revisions.size
|
|
5
25
|
when 0 then ''
|
|
@@ -10,4 +30,32 @@ module WikiHelper
|
|
|
10
30
|
end
|
|
11
31
|
end
|
|
12
32
|
|
|
33
|
+
def render_wiki_diff(old_revision, new_revision)
|
|
34
|
+
begin
|
|
35
|
+
@renderer.render_wiki_diff(old_revision.text, new_revision.text)
|
|
36
|
+
rescue
|
|
37
|
+
parsing_error_box + render_wiki_sourcediff(old_revision, new_revision)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def render_wiki_sourcediff(old_revision, new_revision)
|
|
42
|
+
render_diff_table(old_revision.diff(new_revision))
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def rss_item_for_revision(rev)
|
|
46
|
+
Builder::XmlMarkup.new.item do |xml|
|
|
47
|
+
xml.title h(rev.title)
|
|
48
|
+
if rev.position > 1
|
|
49
|
+
xml.description @renderer.render_wiki_diff(
|
|
50
|
+
@page.revisions[rev.position - 2].text, rev.text)
|
|
51
|
+
else
|
|
52
|
+
xml.description @renderer.render_wiki_text(rev.text)
|
|
53
|
+
end
|
|
54
|
+
xml.pubDate h(rev.modified_at.to_s(:rfc822))
|
|
55
|
+
xml.dc :creator, h(rev.last_editor.login)
|
|
56
|
+
xml.guid server_url_for(:action => 'show', :page_name => @page.name,
|
|
57
|
+
:revision => rev.position)
|
|
58
|
+
end rescue ''
|
|
59
|
+
end
|
|
60
|
+
|
|
13
61
|
end
|
data/app/models/change.rb
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
class Change < ActiveRecord::Base
|
|
19
18
|
|
data/app/models/chunk.rb
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
class Chunk
|
|
19
18
|
attr_reader :lines, :action
|
data/app/models/feed_observer.rb
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
class FeedObserver < ActiveRecord::Observer
|
|
19
18
|
|
|
@@ -24,4 +23,4 @@ class FeedObserver < ActiveRecord::Observer
|
|
|
24
23
|
FileUtils.rm_r(Dir.glob(cache_dir+"/report/#{record.reported_by}")) rescue Errno::ENOENT
|
|
25
24
|
end
|
|
26
25
|
|
|
27
|
-
end
|
|
26
|
+
end
|
data/app/models/headline.rb
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
# Copyright (C) 2006-2008 Thiago Arrais
|
|
3
3
|
#
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation; either version
|
|
5
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
7
|
# any later version.
|
|
8
8
|
#
|
|
9
9
|
# This program is distributed in the hope that it will be useful,
|
|
10
10
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
11
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
12
|
+
# GNU Affero General Public License for more details.
|
|
13
13
|
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with this program
|
|
16
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
16
|
|
|
18
17
|
class Headline < ActiveRecord::Base
|
|
19
18
|
|