diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 9c624462a..fd876cf04 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -25,6 +25,7 @@ class WikiController < ApplicationController helper :attachments include AttachmentsHelper + helper :watchers # display a page (in editing mode if it doesn't exist) def index diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 7619bfd2c..fbe76ac3a 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -163,6 +163,7 @@ class Mailer < ActionMailer::Base 'Wiki-Page-Id' => wiki_content.page.id message_id wiki_content recipients wiki_content.project.recipients + cc(wiki_content.page.wiki.watcher_recipients - recipients) subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :page => wiki_content.page.pretty_title)}" body :wiki_content => wiki_content, :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title) @@ -178,6 +179,7 @@ class Mailer < ActionMailer::Base 'Wiki-Page-Id' => wiki_content.page.id message_id wiki_content recipients wiki_content.project.recipients + cc(wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients) subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :page => wiki_content.page.pretty_title)}" body :wiki_content => wiki_content, :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title), diff --git a/app/models/wiki.rb b/app/models/wiki.rb index be048775a..b31b03482 100644 --- a/app/models/wiki.rb +++ b/app/models/wiki.rb @@ -1,5 +1,5 @@ -# redMine - project management software -# Copyright (C) 2006-2007 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2009 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -20,6 +20,8 @@ class Wiki < ActiveRecord::Base has_many :pages, :class_name => 'WikiPage', :dependent => :destroy, :order => 'title' has_many :redirects, :class_name => 'WikiRedirect', :dependent => :delete_all + acts_as_watchable + validates_presence_of :start_page validates_format_of :start_page, :with => /^[^,\.\/\?\;\|\:]*$/ diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 19858dbd4..d6009c2e3 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -1,5 +1,5 @@ -# redMine - project management software -# Copyright (C) 2006-2007 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2009 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -23,7 +23,8 @@ class WikiPage < ActiveRecord::Base has_one :content, :class_name => 'WikiContent', :foreign_key => 'page_id', :dependent => :destroy acts_as_attachable :delete_permission => :delete_wiki_pages_attachments acts_as_tree :dependent => :nullify, :order => 'title' - + + acts_as_watchable acts_as_event :title => Proc.new {|o| "#{l(:label_wiki)}: #{o.title}"}, :description => :text, :datetime => :created_on, diff --git a/app/views/wiki/show.rhtml b/app/views/wiki/show.rhtml index 033c59160..0ae8c10dc 100644 --- a/app/views/wiki/show.rhtml +++ b/app/views/wiki/show.rhtml @@ -1,6 +1,7 @@