1.修复进入互评界面的报错

2.互评界面增加参与人员显示
3.添加成员页面开发人员改为参与人员
This commit is contained in:
sw 2014-06-11 16:17:35 +08:00
parent 872b7efb84
commit a681aa76cb
3 changed files with 14 additions and 26 deletions

View File

@ -155,27 +155,6 @@ module BidsHelper
end
people.include?(User.current)
end
#当前用户是不是指定课程的学生
def is_cur_course_student? course
#people = []
#course.members.includes(:user, :roles).each do |member|
# if [5,10].include? member.roles.first.id
# people << member.user
# end
#end
#people.include?(User.current)
#修改:能新建占位且不能新建任务的角色判定为学生
is_student = false
@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
@membership.each do |membership|
unless(membership.project.project_type==0)
if !User.current.allowed_to?({:controller => "projects", :action => "new_homework"}, membership.project, :global => false) && User.current.allowed_to?({:controller => "homework_attach", :action => "new"}, membership.project, :global => false)
is_student = true
end
end
end
is_student
end
# def select_option_helper option
# tmp = Hash.new

View File

@ -20,7 +20,7 @@
<tr id="member-<%= user.id %>" class="<%= cycle 'odd', 'even' %> member" style="text-align: center">
<% if homework.user != user %>
<td style="width: 40%"><%= link_to_user user %></td>
<td style="text-align: center;width: 50%"> 开发人员 </td>
<td style="text-align: center;width: 50%"> 参与人员 </td>
<td><%= link_to l(:button_delete),destory_homework_users_homework_attach_path(:user_id=>user),:remote => true, :method => :post %></td>
<% end %>
</tr>

View File

@ -6,7 +6,7 @@
height: 200px;
}
</style>
<% is_student = is_cur_course_student? @homework.bid.courses.first %>
<% is_student = is_cur_course_student @homework.bid.courses.first %>
<% is_teacher = is_course_teacher User.current,@homework.bid.courses.first %>
<p id="notice"><%= notice %></p>
<!-- <%= image_tag(url_to_avatar(@user), :class => "avatar2") %> -->
@ -23,7 +23,16 @@
<td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all">
发布人员:<%= link_to @homework.user, user_path(@homework.user)%>
</td>
<td>发布时间:<%=format_time @homework.created_at %></td>
<td>
参与人员:
<% @homework.users.each do |homework_user| %>
<%= link_to homework_user, user_path(homework_user)%>
<% if @homework.users.count > 1 && homework_user != @homework.users.last %>
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% end %>
<% end %>
</td>
</tr>
<tr>
<td style="padding-left: 40px">
@ -38,12 +47,12 @@
<td style="width: 240px; word-wrap: break-word; word-break: break-all">
所属任务:<%= link_to(@homework.bid.name, project_for_bid_path(@homework.bid))%>
</td>
</tr>
<tr>
<td style="padding-left: 40px" colspan="2">平均评分:
<td style="padding-left: 40px">平均评分:
<%= rating_for @homework, :static => true, dimension: :quality, class: 'rateable div_inline' %>
</td>
<td>发布时间:<%=format_time @homework.created_at %></td>
</tr>
</table>
</td>