diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 43883fd6f..bbd2ea015 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1448,7 +1448,7 @@ module ApplicationHelper
html << (content_tag "span", l(:label_no_current_participate))
end
for temp in obj.join_in_contests
- html << (link_to image_tag(url_to_avatar(temp.user), :class => "avatar"), user_path(temp.user), :class => "avatar", :title => "#{temp.user.show_name}")
+ html << (link_to image_tag(url_to_avatar(temp.user), :class => "avatar"), user_path(temp.user), :class => "avatar", :title => "#{temp.user.name}")
count = count + 1
if count >= 12
break
diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb
index 57e4825ea..a4e963b42 100644
--- a/app/helpers/welcome_helper.rb
+++ b/app/helpers/welcome_helper.rb
@@ -211,7 +211,15 @@ module WelcomeHelper
# }
# user_objs = User.find_by_sql("SELECT * FROM users WHERE (users.id IN #{"(" << users.join(',') << ")"} )")
activity = Redmine::Activity::Fetcher.new(nil)
- activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' }
+ has = { # TODO: 待完成
+ "show_issues" => true,
+ "show_files" => true,
+ "show_documents" => true,
+ "show_messages" => true,
+ "show_news" => true,
+ "show_bids" => true
+ }
+ activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' }
activity.events_welcome(nil, nil, {:limit => limit, :types => 'welcome'})
end
diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb
index 69342b94c..7a870f6bf 100644
--- a/app/models/journals_for_message.rb
+++ b/app/models/journals_for_message.rb
@@ -15,9 +15,21 @@ class JournalsForMessage < ActiveRecord::Base
"m_reply_id" # 回复某留言的留言id(a留言回复了b留言,这是b留言的id)
acts_as_tree :foreign_key => 'm_parent_id', :counter_cache => :m_reply_count, :order => "#{JournalsForMessage.table_name}.created_on ASC"
+ belongs_to :project, :foreign_type => 'jour_type', :foreign_key => 'jour_id', :polymorphic => true
belongs_to :jour, :polymorphic => true
belongs_to :user
- belongs_to :at_user, :class_name => "User", :foreign_key => 'reply_id'
+ belongs_to :at_user, :class_name => "User", :foreign_key => 'reply_id'
+
+ acts_as_event :title => Proc.new {|o| "#{l(:label_my_message)}"},
+ :datetime => :updated_on,
+ :author => Proc.new {|o| o.user },
+ :description => Proc.new{|o| o.notes },
+ :type => Proc.new {|o| o.jour_type }#,
+ #:url => Proc.new {|o| ''}#{:controller => 'documents', :action => 'show', :id => o.id}}
+ acts_as_activity_provider :author_key => :author_id,
+ :func => 'memos',
+ :timestamp => 'updated_on',
+ :find_options => {}#:include => :project}
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
diff --git a/app/views/bids/_history.html.erb b/app/views/bids/_history.html.erb
index 503a8614b..b0bc22479 100644
--- a/app/views/bids/_history.html.erb
+++ b/app/views/bids/_history.html.erb
@@ -34,7 +34,7 @@
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
:method => 'post', :title => l(:button_quote))%>
<%= link_to l(:label_bid_respond_quote),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}
+ {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
%>
<% end %>
<% if @user==User.current|| User.current.admin? %>
diff --git a/app/views/bids/show_participator.html.erb b/app/views/bids/show_participator.html.erb
index 83b6cf241..fe6e7d3ba 100644
--- a/app/views/bids/show_participator.html.erb
+++ b/app/views/bids/show_participator.html.erb
@@ -9,12 +9,12 @@
- <%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.show_name}" %>
+ <%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.name}" %>
|
- <%= content_tag "div", link_to(user.show_name, user_path(user)), :class => "project_avatar_name" , :title => "#{user.show_name}" %>
+ | <%= content_tag "div", link_to(user.name, user_path(user)), :class => "project_avatar_name" , :title => "#{user.name}" %>
<% if (im_watching_student_id? @bid) && user.user_extensions.identity.to_i.eql?(1) %>
<%= l(:label_bidding_user_studentcode) %> :<%= user.user_extensions.student_id%>
diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb
index 1acbd9f44..b4ba3dd4b 100644
--- a/app/views/layouts/base_contest.html.erb
+++ b/app/views/layouts/base_contest.html.erb
@@ -98,7 +98,7 @@
- <%= l(:lable_contest_user) %><%= link_to(@user.show_name, user_path(@user))%> |
+ <%= l(:lable_contest_user) %><%= link_to(@user.name, user_path(@user))%> |
diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb
index 0bf299900..9def28902 100644
--- a/app/views/layouts/base_forums.html.erb
+++ b/app/views/layouts/base_forums.html.erb
@@ -56,7 +56,7 @@
<%= image_tag(url_to_avatar(@forum.creator), :class =>'vatar-size') %>
- <%=link_to @forum.creator.show_name, user_path(@forum.creator) %>
+ <%=link_to @forum.creator.name, user_path(@forum.creator) %>
<%= link_to l(:label_user_watcher)+"("+User.watched_by(@forum.creator.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist", :id => @forum.creator.id %>
<%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@forum.creator.watcher_users(@forum.creator.id).count.to_s+")", :controller=>"users", :action=>"user_fanslist", :id => @forum.creator.id %>
diff --git a/app/views/layouts/base_memos.html.erb b/app/views/layouts/base_memos.html.erb
index 015df3c67..4b7f4b96d 100644
--- a/app/views/layouts/base_memos.html.erb
+++ b/app/views/layouts/base_memos.html.erb
@@ -59,7 +59,7 @@
<%= image_tag(url_to_avatar(@forum.creator), :class => 'vatar-size') %>
- <%=link_to @forum.creator.show_name, user_path(@forum.creator) %>
+ <%=link_to @forum.creator.name, user_path(@forum.creator) %>
<%= link_to l(:label_user_watcher)+"("+User.watched_by(@forum.creator.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist", :id => @forum.creator.id %>
<%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@forum.creator.watcher_users(@forum.creator.id).count.to_s+")", :controller=>"users", :action=>"user_fanslist", :id => @forum.creator.id %>
diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb
index 559f794cc..232103273 100644
--- a/app/views/layouts/base_users.html.erb
+++ b/app/views/layouts/base_users.html.erb
@@ -40,7 +40,7 @@
<%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %> |
- <%=link_to "主页", home_path %> > <%=link_to "软件创客", :controller => 'users', :action => 'index' %> > <%=link_to @user.show_name, user_path %> |
+ <%=link_to "主页", home_path %> > <%=link_to "软件创客", :controller => 'users', :action => 'index' %> > <%=link_to @user.name, user_path %> |
@@ -56,7 +56,7 @@
|
- <%= h (@user.lastname+@user.firstname) %>
+ | <%= h (@user.name) %>
<%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%> |
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb
index db1f33c48..d085c01d2 100644
--- a/app/views/memos/show.html.erb
+++ b/app/views/memos/show.html.erb
@@ -1,7 +1,7 @@
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
- <%=link_to @memo.author.show_name, user_path(@memo.author) %>
+ <%=link_to @memo.author.name, user_path(@memo.author) %>
@@ -55,7 +55,7 @@
<% end %>
- <%= authoring @memo.created_at, @memo.author.show_name %>
+ <%= authoring @memo.created_at, @memo.author.name %>
@@ -121,7 +121,7 @@
- <%= authoring reply.created_at, reply.author.show_name %> |
+ <%= authoring reply.created_at, reply.author.name %> |
diff --git a/app/views/projects/_member_list.html.erb b/app/views/projects/_member_list.html.erb
index d90a0d6d4..0c3ee6b2b 100644
--- a/app/views/projects/_member_list.html.erb
+++ b/app/views/projects/_member_list.html.erb
@@ -6,7 +6,7 @@
<%= content_tag "p", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<% end %>
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :class => 'avatar')) %>
- <%= content_tag "div", link_to(member.user.show_name, user_path(member.user)), :class => "nomargin avatar_name" %>
+ <%= content_tag "div", link_to(member.user.name, user_path(member.user)), :class => "nomargin avatar_name" %>
<% if @project.project_type == 1 %>
diff --git a/app/views/projects/feedback.html.erb b/app/views/projects/feedback.html.erb
index ede00d3e2..5de3ceb4a 100644
--- a/app/views/projects/feedback.html.erb
+++ b/app/views/projects/feedback.html.erb
@@ -75,7 +75,7 @@ function checkMaxLength() {
{:focus => 'project_respond',
:onclick => "toggleAndSettingWordsVal($('##{id}'),
$('##{id} textarea'),
- '#{l(:label_reply_plural)} #{journal.user.show_name}: ');
+ '#{l(:label_reply_plural)} #{journal.user.name}: ');
return false;"} %>
<% end %>
diff --git a/app/views/users/_course_form.html.erb b/app/views/users/_course_form.html.erb
index 4b3469c11..810787850 100644
--- a/app/views/users/_course_form.html.erb
+++ b/app/views/users/_course_form.html.erb
@@ -36,8 +36,8 @@
<% @course = Course.find_by_extra(membership.project.identifier)%>
- <% unless (@course.nil? || @course.teacher.nil? || @course.teacher.show_name.nil?) %>
- <%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.show_name, user_path(@course.teacher)) %>
+ <% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
+ <%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.name, user_path(@course.teacher)) %>
<%= l(:label_course_term) %> : <%= @course.time %><%= @course.term %>
<% end %>
diff --git a/app/views/users/_show_score.html.erb b/app/views/users/_show_score.html.erb
index 655b1de6a..7001f7a94 100644
--- a/app/views/users/_show_score.html.erb
+++ b/app/views/users/_show_score.html.erb
@@ -33,7 +33,7 @@
| <%= image_tag(url_to_avatar(@user), :class => 'avatar2') %> |
- <%= h @user.show_name %> |
+ <%= h @user.name %> |
<%= @user.user_extensions.show_identity %> |
|
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 72d492cb8..bf96cd3f5 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -31,12 +31,12 @@
<% when 'JournalsForMessage' %>
<% if User.current.login == @user.login %>
<%# if e.user_id == act.jour.id %>
- <%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 有了<%= link_to("#{e.act.user.show_name}", user_path(e.user.id))%>的留言 |
+ <%= link_to("#{e.user.name}", user_path(e.user_id)) %> 有了<%= link_to("#{e.act.user.name}", user_path(e.user.id))%>的留言 |
<%# else %>
-
+
<%# end %>
<% else %>
- <%= link_to("#{@user.show_name}", user_path(e.user_id)) %> 有了新的动态 |
+ <%= link_to("#{@user.name}", user_path(e.user_id)) %> 有了新的动态 |
<% end %>
<%=textilizable act.notes %> |
diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb
index 51a6ab09a..3247c67ab 100644
--- a/app/views/users/user_fanslist.html.erb
+++ b/app/views/users/user_fanslist.html.erb
@@ -10,7 +10,7 @@
:title => "#{user.name}" %> |
- <%= content_tag "div", link_to(user.show_name,user_path(user)), :class => "project_avatar_name" %>
+ <%= content_tag "div", link_to(user.name,user_path(user)), :class => "project_avatar_name" %>
|
|
diff --git a/app/views/users/user_watchlist.html.erb b/app/views/users/user_watchlist.html.erb
index bd9246f49..f20b80eef 100644
--- a/app/views/users/user_watchlist.html.erb
+++ b/app/views/users/user_watchlist.html.erb
@@ -7,7 +7,7 @@
<%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.name}" %> |
- <%= content_tag "div", link_to(user.show_name,user_path(user)), :class => "project_avatar_name" %>
+ <%= content_tag "div", link_to(user.name,user_path(user)), :class => "project_avatar_name" %>
|
|
diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb
index a70a555aa..0c33bedd3 100644
--- a/app/views/words/_journal_reply_items.html.erb
+++ b/app/views/words/_journal_reply_items.html.erb
@@ -15,7 +15,7 @@
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.show_name}: '); return false;"}
+ {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.name}: '); return false;"}
%>
<% end %>
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
diff --git a/app/views/words/_message.html.erb b/app/views/words/_message.html.erb
index 03547aa8d..6b002746e 100644
--- a/app/views/words/_message.html.erb
+++ b/app/views/words/_message.html.erb
@@ -52,7 +52,7 @@ function checkMaxLength() {
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}
+ {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
%>
<% end %>
<% if @user == User.current || User.current.admin? || journal.user.id == User.current.id %>
diff --git a/lib/redmine.rb b/lib/redmine.rb
index a013ebaca..9e42f1b37 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -374,6 +374,7 @@ Redmine::Activity.map do |activity|
# added by fq
activity.register :bids, :class_name => 'Bid'
activity.register :memos, :class_name => 'Memo'
+ activity.register :journals_for_messages
# end
end
| | |