motiro 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +15 -0
- data/README +2 -2
- data/README.en +1 -2
- data/README.pt-br +1 -2
- data/app/controllers/account_controller.rb +1 -1
- data/app/controllers/application.rb +13 -12
- data/app/controllers/javascript_controller.rb +1 -1
- data/app/controllers/report_controller.rb +1 -1
- data/app/controllers/wiki_controller.rb +3 -5
- data/app/core/cache_reporter.rb +1 -1
- data/app/core/cache_reporter_fetcher.rb +1 -1
- data/app/core/chief_editor.rb +1 -1
- data/app/core/reporter.rb +1 -1
- data/app/core/reporter_driver.rb +1 -1
- data/app/core/reporter_fetcher.rb +1 -1
- data/app/core/settings.rb +1 -1
- data/app/core/version.rb +1 -1
- data/app/core/wiki_reporter.rb +1 -1
- data/app/helpers/application_helper.rb +5 -1
- data/app/helpers/default_page_provider.rb +6 -2
- data/app/helpers/report_helper.rb +14 -1
- data/app/models/change.rb +1 -1
- data/app/models/chunk.rb +1 -1
- data/app/models/feed_observer.rb +1 -1
- data/app/models/headline.rb +1 -1
- data/app/models/page.rb +38 -4
- data/app/models/revision.rb +1 -1
- data/app/models/user.rb +1 -1
- data/app/models/wiki_reference.rb +21 -0
- data/app/models/wiki_sweeper.rb +17 -2
- data/app/ports/chdir_runner.rb +1 -1
- data/app/ports/runner.rb +1 -1
- data/app/reporters/darcs_connection.rb +1 -1
- data/app/reporters/darcs_reporter.rb +1 -1
- data/app/reporters/darcs_temp_repo.rb +1 -1
- data/app/reporters/events_reporter.rb +1 -1
- data/app/reporters/features_reporter.rb +1 -1
- data/app/reporters/subversion_reporter.rb +1 -1
- data/app/reporters/svn_connection.rb +1 -1
- data/app/reporters/svn_settings.rb +1 -1
- data/app/views/report/list.rhtml +6 -7
- data/app/views/report/older.rhtml +1 -2
- data/app/views/report/rss.rxml +1 -1
- data/app/views/report/show.rhtml +2 -2
- data/app/views/wiki/_edit_event.rhtml +2 -0
- data/app/views/wiki/_edit_feature.rhtml +2 -0
- data/app/views/wiki/_properties_edit.rhtml +3 -5
- data/app/views/wiki/_properties_show.rhtml +4 -5
- data/app/views/wiki/_show_event.rhtml +3 -0
- data/app/views/wiki/_show_feature.rhtml +2 -0
- data/app/views/wiki/show.rhtml +1 -1
- data/bin/motiro +3 -3
- data/config/routes.rb +1 -1
- data/db/migrate/024_add_feature_status.rb +11 -0
- data/db/migrate/025_add_page_references.rb +12 -0
- data/db/migrate/026_convert_link_syntax.rb +12 -0
- data/db/migrate/027_register_page_references.rb +12 -0
- data/db/motirodb.sqlite.initial +0 -0
- data/db/schema_version +1 -1
- data/db/translation/pt-BR.rb +7 -1
- data/lib/array_extensions.rb +1 -1
- data/lib/diff_chunk_builder.rb +1 -1
- data/lib/differ.rb +1 -1
- data/lib/string_extensions.rb +13 -6
- data/lib/stub_hash.rb +1 -1
- data/lib/tasks/packaging.rake +10 -12
- data/lib/tasks/testing.rake +1 -1
- data/lib/tick_daemon.rb +1 -1
- data/lib/{wiki_url_generator.rb → wiki_link_handler.rb} +13 -3
- data/lib/wiki_renderer.rb +63 -34
- data/public/images/done.png +0 -0
- data/public/images/not-done.png +0 -0
- data/public/stylesheets/motiro.css +8 -0
- data/script/ticker +1 -1
- data/test/acceptance/account_test.rb +1 -1
- data/test/acceptance/darcs_test.rb +1 -1
- data/test/acceptance/events_test.rb +1 -1
- data/test/acceptance/main_page_test.rb +1 -1
- data/test/acceptance/subversion_test.rb +1 -1
- data/test/acceptance/ts_all_suites.rb +1 -1
- data/test/acceptance/wiki_test.rb +3 -3
- data/test/contract/darcs_test.rb +1 -1
- data/test/contract/remote_darcs_test.rb +1 -1
- data/test/contract/svn_test.rb +1 -1
- data/test/fixtures/pages.yml +20 -1
- data/test/fixtures/revisions.yml +40 -1
- data/test/fixtures/wiki_references.yml +5 -0
- data/test/functional/report_controller_test.rb +1 -1
- data/test/functional/report_features_test.rb +8 -1
- data/test/functional/report_subversion_test.rb +1 -1
- data/test/functional/root_controller_test.rb +1 -1
- data/test/functional/wiki_controller_test.rb +67 -2
- data/test/lib/acceptance_test_case.rb +1 -1
- data/test/lib/darcs_excerpts.rb +1 -1
- data/test/lib/darcs_repo.rb +1 -1
- data/test/lib/hash_extensions.rb +22 -0
- data/test/lib/live_mode_test.rb +1 -1
- data/test/lib/netutils.rb +1 -1
- data/test/lib/platform_thread.rb +1 -1
- data/test/lib/selenium_extensions.rb +1 -1
- data/test/lib/stubio.rb +1 -1
- data/test/lib/webserver.rb +1 -1
- data/test/meta/darcs_repo_test.rb +1 -1
- data/test/meta/local_svn_test.rb +1 -1
- data/test/meta/platform_thread_test.rb +1 -1
- data/test/meta/stubio_test.rb +1 -1
- data/test/stubs/{url_generator.rb → wiki_link_handler.rb} +8 -4
- data/test/test_helper.rb +3 -1
- data/test/unit/array_extensions_test.rb +1 -1
- data/test/unit/cache_reporter_fetcher_test.rb +1 -1
- data/test/unit/cache_reporter_test.rb +1 -1
- data/test/unit/change_test.rb +1 -1
- data/test/unit/chdir_runner_test.rb +1 -1
- data/test/unit/chief_editor_test.rb +1 -1
- data/test/unit/darcs_connection_test.rb +1 -1
- data/test/unit/darcs_reporter_test.rb +4 -4
- data/test/unit/darcs_temp_repo_test.rb +1 -1
- data/test/unit/default_page_provider_test.rb +23 -13
- data/test/unit/diff_chunk_builder_test.rb +1 -1
- data/test/unit/page_test.rb +67 -4
- data/test/unit/reporter_driver_test.rb +1 -1
- data/test/unit/reporter_test.rb +1 -1
- data/test/unit/revision_test.rb +1 -1
- data/test/unit/runner_test.rb +1 -1
- data/test/unit/string_extensions_test.rb +15 -3
- data/test/unit/svn_connection_test.rb +1 -1
- data/test/unit/svn_reporter_interaction_test.rb +1 -1
- data/test/unit/svn_reporter_test.rb +1 -1
- data/test/unit/svn_settings_test.rb +1 -1
- data/test/unit/user_test.rb +1 -1
- data/test/unit/{wiki_url_generator_test.rb → wiki_link_handler_test.rb} +3 -3
- data/test/unit/wiki_renderer_test.rb +75 -20
- data/test/unit/wiki_reporter_test.rb +1 -1
- data/vendor/mediacloth-trunk/MIT-LICENSE +20 -0
- data/vendor/mediacloth-trunk/README +32 -0
- data/vendor/mediacloth-trunk/Rakefile +33 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiast.rb +122 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikihtmlgenerator.rb +252 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikilexer.rb +821 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikilinkhandler.rb +68 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiparams.rb +33 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiparser.rb +1218 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiparser.y +493 -0
- data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiwalker.rb +146 -0
- data/vendor/mediacloth-trunk/lib/mediacloth.rb +29 -0
- data/vendor/mediacloth-trunk/mediacloth.gemspec +24 -0
- data/vendor/mediacloth-trunk/mediacloth.kdevelop +117 -0
- data/vendor/mediacloth-trunk/setup.rb +1585 -0
- data/vendor/mediacloth-trunk/test/data/html1 +26 -0
- data/vendor/mediacloth-trunk/test/data/html10 +130 -0
- data/vendor/mediacloth-trunk/test/data/html11 +17 -0
- data/vendor/mediacloth-trunk/test/data/html12 +12 -0
- data/vendor/mediacloth-trunk/test/data/html13 +11 -0
- data/vendor/mediacloth-trunk/test/data/html2 +2 -0
- data/vendor/mediacloth-trunk/test/data/html3 +1 -0
- data/vendor/mediacloth-trunk/test/data/html4 +47 -0
- data/vendor/mediacloth-trunk/test/data/html5 +57 -0
- data/vendor/mediacloth-trunk/test/data/html6 +8 -0
- data/vendor/mediacloth-trunk/test/data/html7 +45 -0
- data/vendor/mediacloth-trunk/test/data/html8 +1 -0
- data/vendor/mediacloth-trunk/test/data/html9 +14 -0
- data/vendor/mediacloth-trunk/test/data/input1 +34 -0
- data/vendor/mediacloth-trunk/test/data/input10 +124 -0
- data/vendor/mediacloth-trunk/test/data/input11 +17 -0
- data/vendor/mediacloth-trunk/test/data/input12 +15 -0
- data/vendor/mediacloth-trunk/test/data/input13 +10 -0
- data/vendor/mediacloth-trunk/test/data/input2 +2 -0
- data/vendor/mediacloth-trunk/test/data/input3 +2 -0
- data/vendor/mediacloth-trunk/test/data/input4 +50 -0
- data/vendor/mediacloth-trunk/test/data/input5 +63 -0
- data/vendor/mediacloth-trunk/test/data/input6 +8 -0
- data/vendor/mediacloth-trunk/test/data/input7 +45 -0
- data/vendor/mediacloth-trunk/test/data/input8 +1 -0
- data/vendor/mediacloth-trunk/test/data/input9 +14 -0
- data/vendor/mediacloth-trunk/test/data/lex1 +26 -0
- data/vendor/mediacloth-trunk/test/data/lex10 +85 -0
- data/vendor/mediacloth-trunk/test/data/lex11 +17 -0
- data/vendor/mediacloth-trunk/test/data/lex12 +15 -0
- data/vendor/mediacloth-trunk/test/data/lex13 +3 -0
- data/vendor/mediacloth-trunk/test/data/lex2 +2 -0
- data/vendor/mediacloth-trunk/test/data/lex3 +1 -0
- data/vendor/mediacloth-trunk/test/data/lex4 +47 -0
- data/vendor/mediacloth-trunk/test/data/lex5 +57 -0
- data/vendor/mediacloth-trunk/test/data/lex6 +8 -0
- data/vendor/mediacloth-trunk/test/data/lex7 +45 -0
- data/vendor/mediacloth-trunk/test/data/lex8 +1 -0
- data/vendor/mediacloth-trunk/test/data/lex9 +14 -0
- data/vendor/mediacloth-trunk/test/data/result1 +48 -0
- data/vendor/mediacloth-trunk/test/dataproducers/html.rb +18 -0
- data/vendor/mediacloth-trunk/test/dataproducers/lex.rb +15 -0
- data/vendor/mediacloth-trunk/test/debugwalker.rb +68 -0
- data/vendor/mediacloth-trunk/test/htmlgenerator.rb +97 -0
- data/vendor/mediacloth-trunk/test/lexer.rb +542 -0
- data/vendor/mediacloth-trunk/test/linkhandler.rb +39 -0
- data/vendor/mediacloth-trunk/test/parser.rb +22 -0
- data/vendor/mediacloth-trunk/test/testhelper.rb +27 -0
- data/vendor/mediacloth.rb +3 -0
- data/vendor/motiro-installer.rb +1 -1
- data/vendor/plugins/cache_test-0.2/CHANGELOG +14 -0
- data/vendor/plugins/cache_test-0.2/MIT-LICENSE +20 -0
- data/vendor/plugins/cache_test-0.2/README +124 -0
- data/vendor/plugins/cache_test-0.2/init.rb +8 -0
- data/vendor/plugins/cache_test-0.2/lib/fragment_cache_test.rb +205 -0
- data/vendor/plugins/cache_test-0.2/lib/page_cache_test.rb +140 -0
- data/vendor/plugins/global_routing/init.rb +1 -1
- metadata +517 -455
data/AUTHORS
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Motiro was created and is currently maintained by Thiago Arrais.
|
2
|
+
|
3
|
+
The code has also received contributions from Eduardo Fiorezi and Walter Cruz.
|
4
|
+
|
5
|
+
The icons used on the feature suggestion pages are based on the Dropline Nuovo!
|
6
|
+
icon set by Silvestre Herrera. See http://www.silvestre.com.ar/ for details.
|
7
|
+
|
8
|
+
The icon used on the event pages is from the Silk icon set by Mark James. See
|
9
|
+
http://www.famfamfam.com/lab/icons/silk/ for details.
|
10
|
+
|
11
|
+
All the code, images and other assets (except for the event page icon) inside
|
12
|
+
Motiro are licensed under the GPLv2. See LICENSE for details.
|
13
|
+
|
14
|
+
The event page icon is licensed under a Creative Commons Attribution 2.5
|
15
|
+
License. See http://www.famfamfam.com/lab/icons/silk/ for details.
|
data/README
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Motiro - A project tracking tool
|
2
|
-
Copyright (C) 2006
|
2
|
+
Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
|
4
4
|
This program is free software; you can redistribute it and/or modify
|
5
5
|
it under the terms of the GNU General Public License as published by
|
@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
|
|
15
15
|
along with this program; if not, write to the Free Software
|
16
16
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
17
|
--------------------------------------------------------------------------------
|
18
|
-
Motiro version 0.6.
|
18
|
+
Motiro version 0.6.9 - February 2008
|
19
19
|
|
20
20
|
Please refer to your preferred language README. Every text file below this
|
21
21
|
directory is UTF-8 encoded. Please make sure to set up your reader accordingly.
|
data/README.en
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Motiro - A project tracking tool
|
2
|
-
Copyright (C) 2006
|
2
|
+
Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
|
4
4
|
This program is free software; you can redistribute it and/or modify
|
5
5
|
it under the terms of the GNU General Public License as published by
|
@@ -73,7 +73,6 @@ but those with no label need to be installed by everyone.
|
|
73
73
|
repository)
|
74
74
|
* Darcs command line client (darcs) (only if you will be using a Darcs
|
75
75
|
repository)
|
76
|
-
* (tar) POpen4 0.1.1 (available as Ruby Gem: POpen4)
|
77
76
|
* (tar) SQLite3-Ruby 1.2.1 or later (available as Ruby Gem: sqlite3-ruby)
|
78
77
|
|
79
78
|
After making sure your system has all those requirements, you may proceed with
|
data/README.pt-br
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Motiro - Uma ferramenta para acompanhamento de projetos
|
2
|
-
Copyright (C) 2006
|
2
|
+
Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
|
4
4
|
Este programa é um software de livre distribuição, que pode ser
|
5
5
|
copiado e distribuído sob os termos da Licença Pública Geral GNU,
|
@@ -76,7 +76,6 @@ manualmente por todos.
|
|
76
76
|
repositório Subversion)
|
77
77
|
* Cliente de linha de comando Darcs (darcs) (somente se estiver utilizando
|
78
78
|
repositório Darcs)
|
79
|
-
* (tar) POpen4 0.1.1 (disponível como Ruby Gem: POpen4)
|
80
79
|
* (tar) SQLite3-Ruby 1.2.1 ou superior (disponível como Ruby Gem:
|
81
80
|
sqlite3-ruby)
|
82
81
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Motiro - A project tracking tool
|
2
|
-
# Copyright (C) 2006-
|
2
|
+
# Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
#
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -24,14 +24,14 @@ require 'string_extensions'
|
|
24
24
|
class ApplicationController < ActionController::Base
|
25
25
|
include LoginSystem
|
26
26
|
include ApplicationHelper
|
27
|
-
|
27
|
+
|
28
28
|
before_filter :set_locale, :setup_renderer, :check_desired_login_available, :drop_top_crumbs
|
29
|
-
|
29
|
+
|
30
30
|
def set_locale
|
31
31
|
default_locale = 'en-US'
|
32
32
|
request_language = request.env['HTTP_ACCEPT_LANGUAGE']
|
33
33
|
request_language = request_language.nil? ? nil : request_language[/[^,;]+/]
|
34
|
-
|
34
|
+
|
35
35
|
@locale = params[:locale] || session[:locale] ||
|
36
36
|
request_language || default_locale
|
37
37
|
session[:locale] = @locale
|
@@ -42,11 +42,11 @@ class ApplicationController < ActionController::Base
|
|
42
42
|
Locale.set @locale
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
def setup_renderer
|
47
47
|
@renderer = create_renderer
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def check_desired_login_available
|
51
51
|
if current_user.nil?
|
52
52
|
desired_login = params[:desired_login] || flash[:desired_login]
|
@@ -54,19 +54,20 @@ class ApplicationController < ActionController::Base
|
|
54
54
|
end
|
55
55
|
true
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
def drop_top_crumbs
|
59
59
|
@crumbs = [{ 'Home'.t => {:controller => 'root', :action => 'index'} }]
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
private
|
63
|
-
|
63
|
+
|
64
64
|
def create_renderer
|
65
65
|
WikiRenderer.new(my_url_generator, current_locale)
|
66
66
|
end
|
67
67
|
|
68
68
|
def my_url_generator
|
69
|
-
@url_generator ||=
|
69
|
+
@url_generator ||= WikiLinkHandler.new(self)
|
70
70
|
end
|
71
|
-
|
72
|
-
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Motiro - A project tracking tool
|
2
|
-
# Copyright (C) 2006-
|
2
|
+
# Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
#
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -40,8 +40,7 @@ class WikiController < ApplicationController
|
|
40
40
|
|
41
41
|
def initialize(page_provider=Page, renderer=nil)
|
42
42
|
@renderer = renderer || create_renderer
|
43
|
-
@
|
44
|
-
@default_page_provider = DefaultPageProvider.new
|
43
|
+
@page_provider = DefaultPageProvider.new(page_provider)
|
45
44
|
end
|
46
45
|
|
47
46
|
def fetch_page
|
@@ -132,8 +131,7 @@ private
|
|
132
131
|
end
|
133
132
|
|
134
133
|
def find_page(name)
|
135
|
-
@
|
136
|
-
@default_page_provider.find_by_name(name)
|
134
|
+
@page_provider.find_by_name(name)
|
137
135
|
end
|
138
136
|
|
139
137
|
end
|
data/app/core/cache_reporter.rb
CHANGED
data/app/core/chief_editor.rb
CHANGED
data/app/core/reporter.rb
CHANGED
data/app/core/reporter_driver.rb
CHANGED
data/app/core/settings.rb
CHANGED
data/app/core/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
MOTIRO_VERSION = '0.6.
|
1
|
+
MOTIRO_VERSION = '0.6.9'
|
data/app/core/wiki_reporter.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Motiro - A project tracking tool
|
2
|
-
# Copyright (C) 2006-
|
2
|
+
# Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
#
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -68,6 +68,10 @@ module ApplicationHelper
|
|
68
68
|
concat(xml, block.binding)
|
69
69
|
end
|
70
70
|
|
71
|
+
def render_wiki(text)
|
72
|
+
@renderer.render_wiki_text(text)
|
73
|
+
end
|
74
|
+
|
71
75
|
def render_diff_table(chunks)
|
72
76
|
Builder::XmlMarkup.new.table :class => 'diff', :cellspacing => '0' do |b|
|
73
77
|
b.colgroup do
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Motiro - A project tracking tool
|
2
|
-
# Copyright (C) 2006-
|
2
|
+
# Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
#
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -17,8 +17,12 @@
|
|
17
17
|
|
18
18
|
class DefaultPageProvider
|
19
19
|
|
20
|
+
def initialize(real_page_provider)
|
21
|
+
@provider = real_page_provider
|
22
|
+
end
|
23
|
+
|
20
24
|
def find_by_name(name)
|
21
|
-
Page.new(:name => name)
|
25
|
+
@provider.find_by_name(name) || Page.new(:name => name)
|
22
26
|
end
|
23
27
|
|
24
28
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Motiro - A project tracking tool
|
2
|
-
# Copyright (C) 2006-
|
2
|
+
# Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
#
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -38,4 +38,17 @@ module ReportHelper
|
|
38
38
|
def ref(change)
|
39
39
|
"change" + change.summary.hash.to_s
|
40
40
|
end
|
41
|
+
|
42
|
+
def headline_link(headline)
|
43
|
+
link_to( h(headline.title(Translator.for(@locale))),
|
44
|
+
@reporter.params_for(headline.rid),
|
45
|
+
page_link_handler.extra_link_attributes_for(headline.rid) )
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def page_link_handler
|
51
|
+
WikiLinkHandler.new(@controller)
|
52
|
+
end
|
53
|
+
|
41
54
|
end
|
data/app/models/change.rb
CHANGED
data/app/models/chunk.rb
CHANGED
data/app/models/feed_observer.rb
CHANGED
data/app/models/headline.rb
CHANGED
data/app/models/page.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Motiro - A project tracking tool
|
2
|
-
# Copyright (C) 2006-
|
2
|
+
# Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
#
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -15,6 +15,9 @@
|
|
15
15
|
# along with this program; if not, write to the Free Software
|
16
16
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
17
|
|
18
|
+
require 'rubygems'
|
19
|
+
require 'mediacloth'
|
20
|
+
|
18
21
|
PLACE_HOLDER_TITLE = 'Insert page title here'
|
19
22
|
DEFAULT_AUTHOR = 'someone'
|
20
23
|
DEFAULT_TIME = Time.local(2007, 1, 3, 15, 10)
|
@@ -22,12 +25,18 @@ DEFAULT_TIME = Time.local(2007, 1, 3, 15, 10)
|
|
22
25
|
class Page < ActiveRecord::Base
|
23
26
|
|
24
27
|
has_many :revisions, :order => 'modified_at, id'
|
28
|
+
has_many :references, :foreign_key => 'referer_id', :dependent => :delete_all,
|
29
|
+
:class_name => 'WikiReference'
|
30
|
+
has_many :referrals, :foreign_key => 'referee_id',
|
31
|
+
:class_name => 'WikiReference'
|
32
|
+
has_many :refered_pages, :through => :references, :source => :referee
|
33
|
+
has_many :refering_pages, :through => :referrals, :source => :referer
|
25
34
|
|
26
35
|
def original_author
|
27
36
|
oldest(:last_editor)
|
28
37
|
end
|
29
38
|
|
30
|
-
%w{modified_at last_editor}.each do |attr|
|
39
|
+
%w{modified_at last_editor done done?}.each do |attr|
|
31
40
|
define_method attr do
|
32
41
|
most_recent(attr)
|
33
42
|
end
|
@@ -105,7 +114,8 @@ class Page < ActiveRecord::Base
|
|
105
114
|
self.kind = attrs[:kind] if attrs[:kind]
|
106
115
|
self.happens_at = attrs[:happens_at] if attrs[:happens_at]
|
107
116
|
rev.kind, rev.happens_at = self.kind, self.happens_at
|
108
|
-
rev.title, rev.text = attrs[:title], attrs[:text]
|
117
|
+
rev.title, rev.text, rev.done = attrs[:title], attrs[:text], attrs[:done]
|
118
|
+
update_references(rev.text) if rev.text
|
109
119
|
self.revisions << rev
|
110
120
|
|
111
121
|
save
|
@@ -120,9 +130,19 @@ class Page < ActiveRecord::Base
|
|
120
130
|
:happened_at => (kind == 'event' ? happens_at.to_t : modified_at) || DEFAULT_TIME,
|
121
131
|
:description => inject_title_into_text)
|
122
132
|
end
|
123
|
-
|
133
|
+
|
124
134
|
private
|
125
135
|
|
136
|
+
def update_references(input)
|
137
|
+
self.references.clear
|
138
|
+
MediaCloth::wiki_to_html(input, :link_handler => reference_collector)
|
139
|
+
self.refered_pages.reset
|
140
|
+
end
|
141
|
+
|
142
|
+
def reference_collector
|
143
|
+
PageReferenceCollector.new(self)
|
144
|
+
end
|
145
|
+
|
126
146
|
def inject_title_into_text
|
127
147
|
title + "\n\n" +
|
128
148
|
text.gsub(/^--- (\S+) ----*[ \t\f]*\r?\n/,
|
@@ -171,3 +191,17 @@ private
|
|
171
191
|
end
|
172
192
|
|
173
193
|
end
|
194
|
+
|
195
|
+
class PageReferenceCollector < MediaWikiLinkHandler
|
196
|
+
def initialize(page)
|
197
|
+
@referer = page
|
198
|
+
@page_provider = DefaultPageProvider.new(Page)
|
199
|
+
end
|
200
|
+
|
201
|
+
def url_for(page_name)
|
202
|
+
page = @page_provider.find_by_name(page_name)
|
203
|
+
@referer.references << WikiReference.new(:referer => @referer,
|
204
|
+
:referee => page)
|
205
|
+
page_name
|
206
|
+
end
|
207
|
+
end
|
data/app/models/revision.rb
CHANGED
data/app/models/user.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Motiro - A project tracking tool
|
2
|
+
# Copyright (C) 2006-2008 Thiago Arrais
|
3
|
+
#
|
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 2 of the License, or
|
7
|
+
# any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program; if not, write to the Free Software
|
16
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
|
+
|
18
|
+
class WikiReference < ActiveRecord::Base
|
19
|
+
belongs_to :referer, :class_name => 'Page', :foreign_key => 'referer_id'
|
20
|
+
belongs_to :referee, :class_name => 'Page', :foreign_key => 'referee_id'
|
21
|
+
end
|
data/app/models/wiki_sweeper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Motiro - A project tracking tool
|
2
|
-
# Copyright (C) 2006-
|
2
|
+
# Copyright (C) 2006-2008 Thiago Arrais
|
3
3
|
#
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -20,9 +20,24 @@ class WikiSweeper < ActionController::Caching::Sweeper
|
|
20
20
|
observe Page
|
21
21
|
|
22
22
|
def after_save(page)
|
23
|
-
|
23
|
+
expire_referers(page) if page.revisions.size > 1 &&
|
24
|
+
page.revisions[-1].done != page.revisions[-2].done
|
25
|
+
|
26
|
+
expire_fragment(fragments_for(page))
|
24
27
|
cache_dir = ActionController::Base.page_cache_directory
|
25
28
|
FileUtils.rm_r(Dir.glob(cache_dir+"/wiki/history/#{page.name}*")) rescue Errno::ENOENT
|
26
29
|
end
|
27
30
|
|
31
|
+
private
|
32
|
+
|
33
|
+
def expire_referers(page)
|
34
|
+
page.refering_pages.each do |referer|
|
35
|
+
expire_fragment(fragments_for(referer))
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def fragments_for(page)
|
40
|
+
/wiki\/show.*?#{page.name}/
|
41
|
+
end
|
28
42
|
end
|
43
|
+
|
data/app/ports/chdir_runner.rb
CHANGED
data/app/ports/runner.rb
CHANGED
data/app/views/report/list.rhtml
CHANGED
@@ -11,20 +11,19 @@
|
|
11
11
|
<% buttons = @reporter.buttons
|
12
12
|
if ! buttons.empty? then %>
|
13
13
|
<div class='toolbar channel_toolbar'>
|
14
|
-
<%= buttons.map { |b| instance_eval(b) }. join(' | ')
|
14
|
+
<%= buttons.map { |b| instance_eval(b) }. join(' | ') %>
|
15
15
|
</div>
|
16
16
|
<% end %>
|
17
|
-
<% @headlines.each do |headline|%>
|
17
|
+
<% @headlines.each do |headline|%>
|
18
18
|
<p>
|
19
|
-
<%=
|
20
|
-
@reporter.params_for(headline.rid) )%>
|
19
|
+
<%= headline_link(headline) %>
|
21
20
|
<br/>
|
22
|
-
<
|
21
|
+
<span class="meta">
|
23
22
|
<i><%= h(headline.author) %></i>
|
24
23
|
(<%= headline.happened_at.relative_to_now %>)
|
25
|
-
</
|
24
|
+
</span>
|
26
25
|
</p>
|
27
26
|
<hr/>
|
28
|
-
<% end %>
|
27
|
+
<% end %>
|
29
28
|
</div>
|
30
29
|
</div>
|
@@ -17,8 +17,7 @@
|
|
17
17
|
<td class="date"><%= headline.happened_at-%></td>
|
18
18
|
<td class="relative"><%= headline.happened_at.relative_to_now %></td>
|
19
19
|
<td><%= headline.author %></td>
|
20
|
-
<td><%=
|
21
|
-
@reporter.params_for(headline.rid) )%></td>
|
20
|
+
<td><%= headline_link(headline) %></td>
|
22
21
|
</tr>
|
23
22
|
<% end %>
|
24
23
|
</tbody>
|
data/app/views/report/rss.rxml
CHANGED
@@ -16,7 +16,7 @@ xml.rss 'version' => '2.0',
|
|
16
16
|
|
17
17
|
xml.title h(headline.title(Translator.for(@locale)))
|
18
18
|
xml.link permalink
|
19
|
-
xml.description headline.description(Translator.for(@locale))
|
19
|
+
xml.description render_wiki(headline.description(Translator.for(@locale)))
|
20
20
|
xml.pubDate h(headline.happened_at.to_s(:rfc822))
|
21
21
|
xml.dc :creator, h(headline.author)
|
22
22
|
xml.guid(permalink + '.' +
|