diff options
-rw-r--r-- | app/models/journal.rb | 1 | ||||
-rw-r--r-- | app/models/message.rb | 1 | ||||
-rw-r--r-- | app/models/wiki_content.rb | 1 | ||||
-rw-r--r-- | app/views/projects/activity.rhtml | 2 | ||||
-rw-r--r-- | public/images/attachment.png | bin | 259 -> 995 bytes | |||
-rw-r--r-- | public/images/changeset.png | bin | 0 -> 512 bytes | |||
-rw-r--r-- | public/images/comments.png | bin | 0 -> 557 bytes | |||
-rw-r--r-- | public/images/document.png | bin | 0 -> 458 bytes | |||
-rw-r--r-- | public/images/message.png | bin | 0 -> 521 bytes | |||
-rw-r--r-- | public/images/news.png | bin | 0 -> 658 bytes | |||
-rw-r--r-- | public/images/ticket.png | bin | 0 -> 500 bytes | |||
-rw-r--r-- | public/images/ticket_checked.png | bin | 0 -> 598 bytes | |||
-rw-r--r-- | public/images/ticket_edit.png | bin | 0 -> 731 bytes | |||
-rw-r--r-- | public/images/wiki_edit.png | bin | 0 -> 626 bytes | |||
-rw-r--r-- | public/stylesheets/application.css | 14 | ||||
-rw-r--r-- | test/functional/projects_controller_test.rb | 2 | ||||
-rw-r--r-- | vendor/plugins/acts_as_event/lib/acts_as_event.rb | 19 |
17 files changed, 30 insertions, 10 deletions
diff --git a/app/models/journal.rb b/app/models/journal.rb index 7c5e3d3bf..1376d349e 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -33,6 +33,7 @@ class Journal < ActiveRecord::Base acts_as_event :title => Proc.new {|o| "#{o.issue.tracker.name} ##{o.issue.id}: #{o.issue.subject}" + ((s = o.new_status) ? " (#{s})" : '') }, :description => :notes, :author => :user, + :type => Proc.new {|o| (s = o.new_status) && s.is_closed? ? 'issue-closed' : 'issue-edit' }, :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id, :anchor => "change-#{o.id}"}} def save diff --git a/app/models/message.rb b/app/models/message.rb index 12b1cd990..a18d126c9 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -28,6 +28,7 @@ class Message < ActiveRecord::Base :date_column => 'created_on' acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"}, :description => :content, + :type => Proc.new {|o| o.parent_id.nil? ? 'message' : 'reply'}, :url => Proc.new {|o| {:controller => 'messages', :action => 'show', :board_id => o.board_id, :id => o.id}} attr_protected :locked, :sticky diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb index 13915c274..724354ad6 100644 --- a/app/models/wiki_content.rb +++ b/app/models/wiki_content.rb @@ -32,6 +32,7 @@ class WikiContent < ActiveRecord::Base acts_as_event :title => Proc.new {|o| "#{l(:label_wiki_edit)}: #{o.page.title} (##{o.version})"}, :description => :comments, :datetime => :updated_on, + :type => 'wiki-page', :url => Proc.new {|o| {:controller => 'wiki', :id => o.page.wiki.project_id, :page => o.page.title, :version => o.version}} def text=(plain) diff --git a/app/views/projects/activity.rhtml b/app/views/projects/activity.rhtml index 0cf7a5000..c2f2f9ebd 100644 --- a/app/views/projects/activity.rhtml +++ b/app/views/projects/activity.rhtml @@ -6,7 +6,7 @@ <h3><%= format_activity_day(day) %></h3> <dl> <% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> - <dt class="<%= e.class.name.downcase %>"><span class="time"><%= format_time(e.event_datetime, false) %></span> + <dt class="<%= e.event_type %>"><span class="time"><%= format_time(e.event_datetime, false) %></span> <%= 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> <dd><% unless e.event_description.blank? -%> <span class="description"><%= format_activity_description(e.event_description) %></span><br /> diff --git a/public/images/attachment.png b/public/images/attachment.png Binary files differindex eea26921b..b7ce3c445 100644 --- a/public/images/attachment.png +++ b/public/images/attachment.png diff --git a/public/images/changeset.png b/public/images/changeset.png Binary files differnew file mode 100644 index 000000000..67de2c6cc --- /dev/null +++ b/public/images/changeset.png diff --git a/public/images/comments.png b/public/images/comments.png Binary files differnew file mode 100644 index 000000000..39433cf78 --- /dev/null +++ b/public/images/comments.png diff --git a/public/images/document.png b/public/images/document.png Binary files differnew file mode 100644 index 000000000..d00b9b2f4 --- /dev/null +++ b/public/images/document.png diff --git a/public/images/message.png b/public/images/message.png Binary files differnew file mode 100644 index 000000000..252ea14d5 --- /dev/null +++ b/public/images/message.png diff --git a/public/images/news.png b/public/images/news.png Binary files differnew file mode 100644 index 000000000..6a2ecce1b --- /dev/null +++ b/public/images/news.png diff --git a/public/images/ticket.png b/public/images/ticket.png Binary files differnew file mode 100644 index 000000000..244e6ca04 --- /dev/null +++ b/public/images/ticket.png diff --git a/public/images/ticket_checked.png b/public/images/ticket_checked.png Binary files differnew file mode 100644 index 000000000..4b1dfbc3e --- /dev/null +++ b/public/images/ticket_checked.png diff --git a/public/images/ticket_edit.png b/public/images/ticket_edit.png Binary files differnew file mode 100644 index 000000000..291bfc764 --- /dev/null +++ b/public/images/ticket_edit.png diff --git a/public/images/wiki_edit.png b/public/images/wiki_edit.png Binary files differnew file mode 100644 index 000000000..bdc333a65 --- /dev/null +++ b/public/images/wiki_edit.png diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 7c3e0fde7..682e95dde 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -169,11 +169,21 @@ div#issue-changesets .changeset { border-bottom: 1px solid #ddd; } div#issue-changesets p { margin-top: 0; margin-bottom: 1em;} div#activity dl { margin-left: 2em; } -div#activity dd { margin-bottom: 1em; } -div#activity dt { margin-bottom: 1px; } +div#activity dd { margin-bottom: 1em; padding-left: 18px; } +div#activity dt { margin-bottom: 1px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; } div#activity dt .time { color: #777; font-size: 80%; } div#activity dd .description { font-style: italic; } div#activity span.project:after { content: " -"; } +div#activity dt.issue { background-image: url(../images/ticket.png); } +div#activity dt.issue-edit { background-image: url(../images/ticket_edit.png); } +div#activity dt.issue-closed { background-image: url(../images/ticket_checked.png); } +div#activity dt.changeset { background-image: url(../images/changeset.png); } +div#activity dt.news { background-image: url(../images/news.png); } +div#activity dt.message { background-image: url(../images/message.png); } +div#activity dt.reply { background-image: url(../images/comments.png); } +div#activity dt.wiki-page { background-image: url(../images/wiki_edit.png); } +div#activity dt.attachment { background-image: url(../images/attachment.png); } +div#activity dt.document { background-image: url(../images/document.png); } div#roadmap fieldset.related-issues { margin-bottom: 1em; } div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; } diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 75b4673a1..eb5795152 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -144,7 +144,7 @@ class ProjectsControllerTest < Test::Unit::TestCase :content => /#{2.days.ago.to_date.day}/, :sibling => { :tag => "dl", :child => { :tag => "dt", - :attributes => { :class => 'journal' }, + :attributes => { :class => 'issue-edit' }, :child => { :tag => "a", :content => /(#{IssueStatus.find(2).name})/, } diff --git a/vendor/plugins/acts_as_event/lib/acts_as_event.rb b/vendor/plugins/acts_as_event/lib/acts_as_event.rb index a0d1822ad..d7f437a5e 100644 --- a/vendor/plugins/acts_as_event/lib/acts_as_event.rb +++ b/vendor/plugins/acts_as_event/lib/acts_as_event.rb @@ -25,11 +25,12 @@ module Redmine module ClassMethods def acts_as_event(options = {}) return if self.included_modules.include?(Redmine::Acts::Event::InstanceMethods) - options[:datetime] ||= 'created_on' - options[:title] ||= 'title' - options[:description] ||= 'description' - options[:author] ||= 'author' + options[:datetime] ||= :created_on + options[:title] ||= :title + options[:description] ||= :description + options[:author] ||= :author options[:url] ||= {:controller => 'welcome'} + options[:type] ||= self.name.underscore.dasherize cattr_accessor :event_options self.event_options = options send :include, Redmine::Acts::Event::InstanceMethods @@ -41,11 +42,17 @@ module Redmine base.extend ClassMethods end - %w(datetime title description author).each do |attr| + %w(datetime title description author type).each do |attr| src = <<-END_SRC def event_#{attr} option = event_options[:#{attr}] - option.is_a?(Proc) ? option.call(self) : send(option) + if option.is_a?(Proc) + option.call(self) + elsif option.is_a?(Symbol) + send(option) + else + option + end end END_SRC class_eval src, __FILE__, __LINE__ |