LOGIN / SIGN UP
2 Author: Claes Nästén
Date: Fri Feb 26 22:37:58 +0100 2010
Subject: More help information in wiki syntax help and links in activity view.

lib/septic/activity/activity.rb
 
13 @@ -13,15 +13,16 @@
13 # Base class for activities used for aggregrating work (task changes,
14 # commits, wiki page edits) sorted by date.
15 class Activity
16 attr_reader :icon, :date, :user, :link, :subject, :body
17 attr_reader :icon, :project, :date, :user, :link, :subject, :body
18 end
19
20 class MailActivity < Activity
21 def initialize(mail)
22 @icon = 'icons/activity_mail.png'
23 @project = mail.mailing_list.project
24 @date = mail.created_at
25 @user = mail.user
26 @link = nil
27 @link = "/projects/#{@project.name}/mailing_lists/#{mail.mailing_list.name}/mail?mail_id=#{mail.id}"
28 @subject = mail.subject
29 @body = ''
30 end
...  
31 @@ -30,8 +31,9 @@
31 class TaskActivity < Activity
32 def initialize(task, is_new)
33 @icon = 'icons/activity_task.png'
34 @project = task.project
35 @user = task.user
35 @link = nil
37 @link = "/projects/#{@project.name}/tasks/#{task.id}"
38 @body = ''
39 if is_new
40 @date = task.created_at
...  
48 @@ -46,28 +48,22 @@
48 class WikiActivity < Activity
49 def initialize(wiki_page_version)
50 @icon = 'icons/activity_wiki.png'
51 @project = wiki_page_version.wiki_page.project
52 @date = wiki_page_version.updated_at
51 @user = nil
52 @user_id = wiki_page_version.user_id
53 @link = nil
56 @user = wiki_page_version.wiki_page.user
57 @link = "/projects/#{@project.name}/wikis/#{wiki_page_version.name}"
58 @subject = "#{wiki_page_version.name}: #{wiki_page_version.comment}"
59 @body = ''
60 end
59
60 def user
61 if @user.nil?
62 @user = User.find_by_id(@user_id)
63 end
64 return @user
65 end
68 end
69
70 class ScmActivity < Activity
71 def initialize(commit)
72 @icon = 'icons/activity_scm.png'
73 @project = commit.repository.project
74 @date = commit.created_at
75 @user = commit.user
74 @link = nil
77 @link = "/projects/#{@project.name}/commits/#{commit.id}"
78 @subject = commit.title
79 if commit.body.nil? or commit.body.empty?
80 @body = ''
...