added activity info from event, warning.

This commit is contained in:
yanxd 2013-10-31 20:13:49 +08:00
parent 369e5eccc0
commit b55c5d20a3
3 changed files with 23 additions and 6 deletions

View File

@ -225,4 +225,21 @@ module ProjectsHelper
end
return @result
end
# 将动态中类型转换为可读的字符串
def eventToLanguage event_type
case event_type
when "issue-note"
l :label_issue
when "issue"
l :label_issue
when "attachment"
l :label_attachment
when "news"
l :label_news
else
""
end
end
end

View File

@ -7,8 +7,9 @@
<%= error_messages_for 'member' %>
<% roles = Role.find_all_givable %>
<% members = @project.member_principals.includes(:roles, :principal).all.sort %>
<% members = searchPeopleByRoles(@project, 3).sort if params[:role] == '1' %>
<% members = searchPeopleByRoles(@project, 5).sort if params[:role] == '2' %>
<!-- 如果是课程且点击教师或者学生,则对成员进行过滤 -->
<% members = searchPeopleByRoles(@project, 3).sort if params[:role] == '1' %>
<% members = searchPeopleByRoles(@project, 5).sort if params[:role] == '2' %>
<% if @project.project_type == 1 %>
<%= render :partial => 'member_list', :locals => {:members => members} %>
<% else %>

View File

@ -21,15 +21,14 @@
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
<span class="font_lighter">
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<%= l(:label_new_activity) %> </span>
<%= link_to format_activity_title(e.event_title), e.event_url %>
<%= l(:label_new_activity) %> </span>
<%= link_to "#{eventToLanguage(e.event_type)}: "<<format_activity_title(e.event_title), e.event_url %>
</td>
</tr>
<tr>
<td colspan="2" width="580px" >
<p class="font_description">
<!-- modify by nyan -->
<%= textilizable( stringCut240(e.event_description) ) %>
<%= textilizable( truncate(e.event_description, :length => 240)) %>
</p></td>
</tr>
<tr>