|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
@@ -33,6 +33,7 class Journal < ActiveRecord::Base | |||
|
33 | 33 | acts_as_event :title => Proc.new {|o| "#{o.issue.tracker.name} ##{o.issue.id}: #{o.issue.subject}" + ((s = o.new_status) ? " (#{s})" : '') }, |
|
34 | 34 | :description => :notes, |
|
35 | 35 | :author => :user, |
|
36 | :type => Proc.new {|o| (s = o.new_status) && s.is_closed? ? 'issue-closed' : 'issue-edit' }, | |
|
36 | 37 | :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id, :anchor => "change-#{o.id}"}} |
|
37 | 38 | |
|
38 | 39 | def save |
@@ -28,6 +28,7 class Message < ActiveRecord::Base | |||
|
28 | 28 | :date_column => 'created_on' |
|
29 | 29 | acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"}, |
|
30 | 30 | :description => :content, |
|
31 | :type => Proc.new {|o| o.parent_id.nil? ? 'message' : 'reply'}, | |
|
31 | 32 | :url => Proc.new {|o| {:controller => 'messages', :action => 'show', :board_id => o.board_id, :id => o.id}} |
|
32 | 33 | |
|
33 | 34 | attr_protected :locked, :sticky |
@@ -32,6 +32,7 class WikiContent < ActiveRecord::Base | |||
|
32 | 32 | acts_as_event :title => Proc.new {|o| "#{l(:label_wiki_edit)}: #{o.page.title} (##{o.version})"}, |
|
33 | 33 | :description => :comments, |
|
34 | 34 | :datetime => :updated_on, |
|
35 | :type => 'wiki-page', | |
|
35 | 36 | :url => Proc.new {|o| {:controller => 'wiki', :id => o.page.wiki.project_id, :page => o.page.title, :version => o.version}} |
|
36 | 37 | |
|
37 | 38 | def text=(plain) |
@@ -6,7 +6,7 | |||
|
6 | 6 | <h3><%= format_activity_day(day) %></h3> |
|
7 | 7 | <dl> |
|
8 | 8 | <% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> |
|
9 |
<dt class="<%= e. |
|
|
9 | <dt class="<%= e.event_type %>"><span class="time"><%= format_time(e.event_datetime, false) %></span> | |
|
10 | 10 | <%= content_tag('span', h(e.project), :class => 'project') if @project.nil? || @project != e.project %> <%= link_to h(truncate(e.event_title, 100)), e.event_url %></dt> |
|
11 | 11 | <dd><% unless e.event_description.blank? -%> |
|
12 | 12 | <span class="description"><%= format_activity_description(e.event_description) %></span><br /> |
|
1 | NO CONTENT: modified file, binary diff hidden |
@@ -169,11 +169,21 div#issue-changesets .changeset { border-bottom: 1px solid #ddd; } | |||
|
169 | 169 | div#issue-changesets p { margin-top: 0; margin-bottom: 1em;} |
|
170 | 170 | |
|
171 | 171 | div#activity dl { margin-left: 2em; } |
|
172 | div#activity dd { margin-bottom: 1em; } | |
|
173 | div#activity dt { margin-bottom: 1px; } | |
|
172 | div#activity dd { margin-bottom: 1em; padding-left: 18px; } | |
|
173 | div#activity dt { margin-bottom: 1px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; } | |
|
174 | 174 | div#activity dt .time { color: #777; font-size: 80%; } |
|
175 | 175 | div#activity dd .description { font-style: italic; } |
|
176 | 176 | div#activity span.project:after { content: " -"; } |
|
177 | div#activity dt.issue { background-image: url(../images/ticket.png); } | |
|
178 | div#activity dt.issue-edit { background-image: url(../images/ticket_edit.png); } | |
|
179 | div#activity dt.issue-closed { background-image: url(../images/ticket_checked.png); } | |
|
180 | div#activity dt.changeset { background-image: url(../images/changeset.png); } | |
|
181 | div#activity dt.news { background-image: url(../images/news.png); } | |
|
182 | div#activity dt.message { background-image: url(../images/message.png); } | |
|
183 | div#activity dt.reply { background-image: url(../images/comments.png); } | |
|
184 | div#activity dt.wiki-page { background-image: url(../images/wiki_edit.png); } | |
|
185 | div#activity dt.attachment { background-image: url(../images/attachment.png); } | |
|
186 | div#activity dt.document { background-image: url(../images/document.png); } | |
|
177 | 187 | |
|
178 | 188 | div#roadmap fieldset.related-issues { margin-bottom: 1em; } |
|
179 | 189 | div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; } |
@@ -144,7 +144,7 class ProjectsControllerTest < Test::Unit::TestCase | |||
|
144 | 144 | :content => /#{2.days.ago.to_date.day}/, |
|
145 | 145 | :sibling => { :tag => "dl", |
|
146 | 146 | :child => { :tag => "dt", |
|
147 |
:attributes => { :class => ' |
|
|
147 | :attributes => { :class => 'issue-edit' }, | |
|
148 | 148 | :child => { :tag => "a", |
|
149 | 149 | :content => /(#{IssueStatus.find(2).name})/, |
|
150 | 150 | } |
@@ -25,11 +25,12 module Redmine | |||
|
25 | 25 | module ClassMethods |
|
26 | 26 | def acts_as_event(options = {}) |
|
27 | 27 | return if self.included_modules.include?(Redmine::Acts::Event::InstanceMethods) |
|
28 |
options[:datetime] ||= |
|
|
29 |
options[:title] ||= |
|
|
30 |
options[:description] ||= |
|
|
31 |
options[:author] ||= |
|
|
28 | options[:datetime] ||= :created_on | |
|
29 | options[:title] ||= :title | |
|
30 | options[:description] ||= :description | |
|
31 | options[:author] ||= :author | |
|
32 | 32 | options[:url] ||= {:controller => 'welcome'} |
|
33 | options[:type] ||= self.name.underscore.dasherize | |
|
33 | 34 | cattr_accessor :event_options |
|
34 | 35 | self.event_options = options |
|
35 | 36 | send :include, Redmine::Acts::Event::InstanceMethods |
@@ -41,11 +42,17 module Redmine | |||
|
41 | 42 | base.extend ClassMethods |
|
42 | 43 | end |
|
43 | 44 | |
|
44 | %w(datetime title description author).each do |attr| | |
|
45 | %w(datetime title description author type).each do |attr| | |
|
45 | 46 | src = <<-END_SRC |
|
46 | 47 | def event_#{attr} |
|
47 | 48 | option = event_options[:#{attr}] |
|
48 |
option.is_a?(Proc) |
|
|
49 | if option.is_a?(Proc) | |
|
50 | option.call(self) | |
|
51 | elsif option.is_a?(Symbol) | |
|
52 | send(option) | |
|
53 | else | |
|
54 | option | |
|
55 | end | |
|
49 | 56 | end |
|
50 | 57 | END_SRC |
|
51 | 58 | class_eval src, __FILE__, __LINE__ |
General Comments 0
You need to be logged in to leave comments.
Login now