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

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))
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

View File

@ -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

View File

@ -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

View File

@ -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? %>

View File

@ -9,12 +9,12 @@
<tr>
<!-- modified by bai 显示人名全称-->
<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>
<table width="580px" border="0">
<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 增加了学员的学号 -->
<% if (im_watching_student_id? @bid) && user.user_extensions.identity.to_i.eql?(1) %>
<%= l(:label_bidding_user_studentcode) %> <%= user.user_extensions.student_id%>

View File

@ -98,7 +98,7 @@
<div class="inf_user_image">
<table>
<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>
<!-- end -->
<tr>

View File

@ -56,7 +56,7 @@
<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-right">
<%=link_to @forum.creator.show_name, user_path(@forum.creator) %>
<%=link_to @forum.creator.name, user_path(@forum.creator) %>
<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_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 style="padding-top: 20px" >
<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>
<%= 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>

View File

@ -40,7 +40,7 @@
</tr>
<tr>
<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>
</table>
</div>
@ -56,7 +56,7 @@
<td>
<table>
<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>
</tr>
<tr>

View File

@ -1,7 +1,7 @@
<div class="lz">
<div class="lz-left">
<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 class="memo-section">
<div class="contextual-borad">
@ -55,7 +55,7 @@
<% end %>
</p>
</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>
<br />
@ -121,7 +121,7 @@
</td>
</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>
</table>
</div>

View File

@ -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" %>
<!--teacher's code disapeared moified by huang-->
<% if @project.project_type == 1 %>

View File

@ -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 %>
</span>

View File

@ -36,8 +36,8 @@
<!-- added by bai -->
<% @course = Course.find_by_extra(membership.project.identifier)%>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.show_name.nil?) %>
<span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.show_name, user_path(@course.teacher)) %></span>
<% 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.name, user_path(@course.teacher)) %></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> -->
<% end %>

View File

@ -33,7 +33,7 @@
<td align="left" valign="middle" ><%= image_tag(url_to_avatar(@user), :class => 'avatar2') %></td>
<td width="35%">
<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>
</table>
</td>

View File

@ -31,12 +31,12 @@
<% when 'JournalsForMessage' %>
<% if User.current.login == @user.login %>
<%# 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 %>
<!-- <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 %>
<% 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 %>
<tr> <td colspan="2" width="580" > <p class="font_description"> <%=textilizable act.notes %> </p></td> </tr>
<tr> <td>

View File

@ -10,7 +10,7 @@
:title => "#{user.name}" %></td>
<td><table width="580px" border="0">
<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>
</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><table width="580px" border="0">
<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>
</tr>
<tr> <!-- modified by bai 区别了“关注”里个人参与的项目与课程-->

View File

@ -15,7 +15,7 @@
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<% 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 %>

View File

@ -52,7 +52,7 @@ function checkMaxLength() {
<span>
<% 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 %>

View File

@ -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