暂且提交,增加活动失败。

This commit is contained in:
yanxd 2014-03-13 22:06:49 +08:00
parent 78c2f40b8a
commit daed8a1164
20 changed files with 47 additions and 26 deletions

View File

@ -1448,7 +1448,7 @@ module ApplicationHelper
html << (content_tag "span", l(:label_no_current_participate)) html << (content_tag "span", l(:label_no_current_participate))
end end
for temp in obj.join_in_contests 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 count = count + 1
if count >= 12 if count >= 12
break break

View File

@ -211,7 +211,15 @@ module WelcomeHelper
# } # }
# user_objs = User.find_by_sql("SELECT * FROM users WHERE (users.id IN #{"(" << users.join(',') << ")"} )") # user_objs = User.find_by_sql("SELECT * FROM users WHERE (users.id IN #{"(" << users.join(',') << ")"} )")
activity = Redmine::Activity::Fetcher.new(nil) 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'}) activity.events_welcome(nil, nil, {:limit => limit, :types => 'welcome'})
end end

View File

@ -15,10 +15,22 @@ class JournalsForMessage < ActiveRecord::Base
"m_reply_id" # 回复某留言的留言id(a留言回复了b留言这是b留言的id) "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" 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 :jour, :polymorphic => true
belongs_to :user 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 has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
validates :notes, presence: true validates :notes, presence: true

View File

@ -34,7 +34,7 @@
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true, <%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
:method => 'post', :title => l(:button_quote))%> :method => 'post', :title => l(:button_quote))%>
<%= link_to l(:label_bid_respond_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 %> <% end %>
<% if @user==User.current|| User.current.admin? %> <% if @user==User.current|| User.current.admin? %>

View File

@ -9,12 +9,12 @@
<tr> <tr>
<!-- modified by bai 显示人名全称--> <!-- modified by bai 显示人名全称-->
<td colspan="2" valign="top" width="50" > <td colspan="2" valign="top" width="50" >
<%= 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}" %>
</td> </td>
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"><%= content_tag "div", link_to(user.show_name, user_path(user)), :class => "project_avatar_name" , :title => "#{user.show_name}" %> <td colspan="2" valign="top"><%= content_tag "div", link_to(user.name, user_path(user)), :class => "project_avatar_name" , :title => "#{user.name}" %>
<!-- added by bai 增加了学员的学号 --> <!-- added by bai 增加了学员的学号 -->
<% if (im_watching_student_id? @bid) && user.user_extensions.identity.to_i.eql?(1) %> <% if (im_watching_student_id? @bid) && user.user_extensions.identity.to_i.eql?(1) %>
<%= l(:label_bidding_user_studentcode) %> <%= user.user_extensions.student_id%> <%= l(:label_bidding_user_studentcode) %> <%= user.user_extensions.student_id%>

View File

@ -98,7 +98,7 @@
<div class="inf_user_image"> <div class="inf_user_image">
<table> <table>
<tr> <tr>
<td><%= l(:lable_contest_user) %><%= link_to(@user.show_name, user_path(@user))%></td> <td><%= l(:lable_contest_user) %><%= link_to(@user.name, user_path(@user))%></td>
</tr> </tr>
<!-- end --> <!-- end -->
<tr> <tr>

View File

@ -56,7 +56,7 @@
<div style="padding-top: 20px" > <div style="padding-top: 20px" >
<span class="forums-avatar-left"><%= image_tag(url_to_avatar(@forum.creator), :class =>'vatar-size') %></span> <span class="forums-avatar-left"><%= image_tag(url_to_avatar(@forum.creator), :class =>'vatar-size') %></span>
<span class="forums-avatar-right"> <span class="forums-avatar-right">
<%=link_to @forum.creator.show_name, user_path(@forum.creator) %> <%=link_to @forum.creator.name, user_path(@forum.creator) %>
<div> <div>
<%= 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_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 %> <%= 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 %>

View File

@ -59,7 +59,7 @@
<div class="forums-info"> <div class="forums-info">
<div style="padding-top: 20px" > <div style="padding-top: 20px" >
<span class="forums-avatar-left"><%= image_tag(url_to_avatar(@forum.creator), :class => 'vatar-size') %></span> <span class="forums-avatar-left"><%= image_tag(url_to_avatar(@forum.creator), :class => 'vatar-size') %></span>
<span class="forums-avatar-right"><%=link_to @forum.creator.show_name, user_path(@forum.creator) %> <span class="forums-avatar-right"><%=link_to @forum.creator.name, user_path(@forum.creator) %>
<div> <div>
<%= 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_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 %></div></span> <%= 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 %></div></span>

View File

@ -40,7 +40,7 @@
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %></td> <td style="padding-left: 8px"><%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %></td>
<!-- modified by bai --> <td><%=link_to "主页", home_path %> > <%=link_to "软件创客", :controller => 'users', :action => 'index' %> > <span><%=link_to @user.show_name, user_path %></span></td> <!-- modified by bai --> <td><%=link_to "主页", home_path %> > <%=link_to "软件创客", :controller => 'users', :action => 'index' %> > <span><%=link_to @user.name, user_path %></span></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -56,7 +56,7 @@
<td> <td>
<table> <table>
<tr> <tr>
<td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><%= h (@user.lastname+@user.firstname) %> <!-- added by bai --> <td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><%= h (@user.name) %> <!-- added by bai -->
<%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%></td> <%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%></td>
</tr> </tr>
<tr> <tr>

View File

@ -1,7 +1,7 @@
<div class="lz"> <div class="lz">
<div class="lz-left"> <div class="lz-left">
<div class=""><%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %></div> <div class=""><%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %></div>
<p class=""><%=link_to @memo.author.show_name, user_path(@memo.author) %></p> <p class=""><%=link_to @memo.author.name, user_path(@memo.author) %></p>
</div> </div>
<div class="memo-section"> <div class="memo-section">
<div class="contextual-borad"> <div class="contextual-borad">
@ -55,7 +55,7 @@
<% end %> <% end %>
</p> </p>
</div> </div>
<div class="memo-timestamp"> <%= authoring @memo.created_at, @memo.author.show_name %></div> <div class="memo-timestamp"> <%= authoring @memo.created_at, @memo.author.name %></div>
</div> </div>
<br /> <br />
@ -121,7 +121,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="font_lighter" style="float:right"><%= authoring reply.created_at, reply.author.show_name %></td> <td class="font_lighter" style="float:right"><%= authoring reply.created_at, reply.author.name %></td>
</tr> </tr>
</table> </table>
</div> </div>

View File

@ -6,7 +6,7 @@
<%= content_tag "p", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %> <%= content_tag "p", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<% end %> <% end %>
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :class => 'avatar')) %> <%= 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" %>
<!--teacher's code disapeared moified by huang--> <!--teacher's code disapeared moified by huang-->
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>

View File

@ -75,7 +75,7 @@ function checkMaxLength() {
{:focus => 'project_respond', {:focus => 'project_respond',
:onclick => "toggleAndSettingWordsVal($('##{id}'), :onclick => "toggleAndSettingWordsVal($('##{id}'),
$('##{id} textarea'), $('##{id} textarea'),
'#{l(:label_reply_plural)} #{journal.user.show_name}: '); '#{l(:label_reply_plural)} #{journal.user.name}: ');
return false;"} %> return false;"} %>
<% end %> <% end %>
</span> </span>

View File

@ -36,8 +36,8 @@
<!-- added by bai --> <!-- added by bai -->
<% @course = Course.find_by_extra(membership.project.identifier)%> <% @course = Course.find_by_extra(membership.project.identifier)%>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.show_name.nil?) %> <% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
<span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.show_name, user_path(@course.teacher)) %></span> <span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.name, user_path(@course.teacher)) %></span>
<span style="float: right; padding-left: 8px" ><%= l(:label_course_term) %> : <%= @course.time %><%= @course.term %></span> <span style="float: right; padding-left: 8px" ><%= l(:label_course_term) %> : <%= @course.time %><%= @course.term %></span>
<!-- <span class="font_lighter" style="float: right"><%= l(:label_create_time) %> <%= format_time(membership.created_on) %></span> --> <!-- <span class="font_lighter" style="float: right"><%= l(:label_create_time) %> <%= format_time(membership.created_on) %></span> -->
<% end %> <% end %>

View File

@ -33,7 +33,7 @@
<td align="left" valign="middle" ><%= image_tag(url_to_avatar(@user), :class => 'avatar2') %></td> <td align="left" valign="middle" ><%= image_tag(url_to_avatar(@user), :class => 'avatar2') %></td>
<td width="35%"> <td width="35%">
<table> <table>
<tr class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><td><%= h @user.show_name %></td></tr> <tr class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><td><%= h @user.name %></td></tr>
<tr class="info_font" align="left" style=" word-wrap: break-word; word-break: break-all"><td><%= @user.user_extensions.show_identity %></td></tr> <tr class="info_font" align="left" style=" word-wrap: break-word; word-break: break-all"><td><%= @user.user_extensions.show_identity %></td></tr>
</table> </table>
</td> </td>

View File

@ -31,12 +31,12 @@
<% when 'JournalsForMessage' %> <% when 'JournalsForMessage' %>
<% if User.current.login == @user.login %> <% if User.current.login == @user.login %>
<%# if e.user_id == act.jour.id %> <%# if e.user_id == act.jour.id %>
<tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">有了<%= link_to("#{e.act.user.show_name}", user_path(e.user.id))%>的留言</span></td></tr> <tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">有了<%= link_to("#{e.act.user.name}", user_path(e.user.id))%>的留言</span></td></tr>
<%# else %> <%# else %>
<!-- <tr><td colspan="2" valign="top" class="font_lighter"><strong><%#= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给 <%#= link_to("#{act.at_user.show_name if act.at_user}", user_path(act.jour.id)) %> 留言了</strong>&nbsp;</td></tr> --> <!-- <tr><td colspan="2" valign="top" class="font_lighter"><strong><%#= link_to("#{e.user.name}", user_path(e.user_id)) %> 给 <%#= link_to("#{act.at_user.name if act.at_user}", user_path(act.jour.id)) %> 留言了</strong>&nbsp;</td></tr> -->
<%# end %> <%# end %>
<% else %> <% else %>
<tr><td colspan="2" valign="top"><strong><%= link_to("#{@user.show_name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">有了新的动态</span></td></tr> <tr><td colspan="2" valign="top"><strong><%= link_to("#{@user.name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">有了新的动态</span></td></tr>
<% end %> <% end %>
<tr> <td colspan="2" width="580" > <p class="font_description"> <%=textilizable act.notes %> </p></td> </tr> <tr> <td colspan="2" width="580" > <p class="font_description"> <%=textilizable act.notes %> </p></td> </tr>
<tr> <td> <tr> <td>

View File

@ -10,7 +10,7 @@
:title => "#{user.name}" %></td> :title => "#{user.name}" %></td>
<td><table width="580px" border="0"> <td><table width="580px" border="0">
<tr> <!-- modified by bai --> <tr> <!-- modified by bai -->
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to(user.show_name,user_path(user)), :class => "project_avatar_name" %> <td colspan="2" valign="top"><strong><%= content_tag "div", link_to(user.name,user_path(user)), :class => "project_avatar_name" %>
</td> </td>
</tr> </tr>

View File

@ -7,7 +7,7 @@
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.name}" %></td> <td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.name}" %></td>
<td><table width="580px" border="0"> <td><table width="580px" border="0">
<tr> <!-- modified by bai 增加了关注人的名字全称--> <tr> <!-- modified by bai 增加了关注人的名字全称-->
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to(user.show_name,user_path(user)), :class => "project_avatar_name" %> <td colspan="2" valign="top"><strong><%= content_tag "div", link_to(user.name,user_path(user)), :class => "project_avatar_name" %>
</td> </td>
</tr> </tr>
<tr> <!-- modified by bai 区别了“关注”里个人参与的项目与课程--> <tr> <!-- modified by bai 区别了“关注”里个人参与的项目与课程-->

View File

@ -15,7 +15,7 @@
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' > <span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'', <%= 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 %> <% end %>
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %> <% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>

View File

@ -52,7 +52,7 @@ function checkMaxLength() {
<span> <span>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'', <%= 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 %> <% end %>
<% if @user == User.current || User.current.admin? || journal.user.id == User.current.id %> <% if @user == User.current || User.current.admin? || journal.user.id == User.current.id %>

View File

@ -374,6 +374,7 @@ Redmine::Activity.map do |activity|
# added by fq # added by fq
activity.register :bids, :class_name => 'Bid' activity.register :bids, :class_name => 'Bid'
activity.register :memos, :class_name => 'Memo' activity.register :memos, :class_name => 'Memo'
activity.register :journals_for_messages
# end # end
end end