##// END OF EJS Templates
Ability to watch a wiki or a single wiki page (#413)....
Jean-Philippe Lang -
r2666:85ce903cfa5f
parent child
Show More
@@ -25,6 +25,7 class WikiController < ApplicationController
25 25
26 26 helper :attachments
27 27 include AttachmentsHelper
28 helper :watchers
28 29
29 30 # display a page (in editing mode if it doesn't exist)
30 31 def index
@@ -163,6 +163,7 class Mailer < ActionMailer::Base
163 163 'Wiki-Page-Id' => wiki_content.page.id
164 164 message_id wiki_content
165 165 recipients wiki_content.project.recipients
166 cc(wiki_content.page.wiki.watcher_recipients - recipients)
166 167 subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :page => wiki_content.page.pretty_title)}"
167 168 body :wiki_content => wiki_content,
168 169 :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
178 179 'Wiki-Page-Id' => wiki_content.page.id
179 180 message_id wiki_content
180 181 recipients wiki_content.project.recipients
182 cc(wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients)
181 183 subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :page => wiki_content.page.pretty_title)}"
182 184 body :wiki_content => wiki_content,
183 185 :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title),
@@ -1,5 +1,5
1 # redMine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
1 # Redmine - project management software
2 # Copyright (C) 2006-2009 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
@@ -20,6 +20,8 class Wiki < ActiveRecord::Base
20 20 has_many :pages, :class_name => 'WikiPage', :dependent => :destroy, :order => 'title'
21 21 has_many :redirects, :class_name => 'WikiRedirect', :dependent => :delete_all
22 22
23 acts_as_watchable
24
23 25 validates_presence_of :start_page
24 26 validates_format_of :start_page, :with => /^[^,\.\/\?\;\|\:]*$/
25 27
@@ -1,5 +1,5
1 # redMine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
1 # Redmine - project management software
2 # Copyright (C) 2006-2009 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
@@ -23,7 +23,8 class WikiPage < ActiveRecord::Base
23 23 has_one :content, :class_name => 'WikiContent', :foreign_key => 'page_id', :dependent => :destroy
24 24 acts_as_attachable :delete_permission => :delete_wiki_pages_attachments
25 25 acts_as_tree :dependent => :nullify, :order => 'title'
26
26
27 acts_as_watchable
27 28 acts_as_event :title => Proc.new {|o| "#{l(:label_wiki)}: #{o.title}"},
28 29 :description => :text,
29 30 :datetime => :created_on,
@@ -1,6 +1,7
1 1 <div class="contextual">
2 2 <% if @editable %>
3 3 <%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if @content.version == @page.content.version %>
4 <%= watcher_tag(@page, User.current) %>
4 5 <%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :page => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %>
5 6 <%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :page => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
6 7 <%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :page => @page.title}, :class => 'icon icon-move') if @content.version == @page.content.version %>
@@ -1,3 +1,7
1 <div class="contextual">
2 <%= watcher_tag(@wiki, User.current) %>
3 </div>
4
1 5 <h2><%= l(:label_index_by_date) %></h2>
2 6
3 7 <% if @pages.empty? %>
@@ -1,3 +1,7
1 <div class="contextual">
2 <%= watcher_tag(@wiki, User.current) %>
3 </div>
4
1 5 <h2><%= l(:label_index_by_title) %></h2>
2 6
3 7 <% if @pages.empty? %>
General Comments 0
You need to be logged in to leave comments. Login now