From a681aa76cb89325e7b79f6673976002ff074a8f6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 11 Jun 2014 16:17:35 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E8=BF=9B=E5=85=A5=E4=BA=92?= =?UTF-8?q?=E8=AF=84=E7=95=8C=E9=9D=A2=E7=9A=84=E6=8A=A5=E9=94=99=202.?= =?UTF-8?q?=E4=BA=92=E8=AF=84=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E4=B8=8E=E4=BA=BA=E5=91=98=E6=98=BE=E7=A4=BA=203.=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=88=90=E5=91=98=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=94=B9=E4=B8=BA=E5=8F=82=E4=B8=8E=E4=BA=BA?= =?UTF-8?q?=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/bids_helper.rb | 21 ------------------- .../homework_attach/_homework_member.html.erb | 2 +- app/views/homework_attach/show.html.erb | 17 +++++++++++---- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/app/helpers/bids_helper.rb b/app/helpers/bids_helper.rb index a41867c64..a5c25ecb5 100644 --- a/app/helpers/bids_helper.rb +++ b/app/helpers/bids_helper.rb @@ -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 diff --git a/app/views/homework_attach/_homework_member.html.erb b/app/views/homework_attach/_homework_member.html.erb index c8e3bfbd2..9dfe170bd 100644 --- a/app/views/homework_attach/_homework_member.html.erb +++ b/app/views/homework_attach/_homework_member.html.erb @@ -20,7 +20,7 @@ <% if homework.user != user %> <%= link_to_user user %> - 开发人员 + 参与人员 <%= link_to l(:button_delete),destory_homework_users_homework_attach_path(:user_id=>user),:remote => true, :method => :post %> <% end %> diff --git a/app/views/homework_attach/show.html.erb b/app/views/homework_attach/show.html.erb index cdbbe9fda..4cf9903fe 100644 --- a/app/views/homework_attach/show.html.erb +++ b/app/views/homework_attach/show.html.erb @@ -6,7 +6,7 @@ height: 200px; } -<% 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 %>

<%= notice %>

@@ -23,7 +23,16 @@ 发布人员:<%= link_to @homework.user, user_path(@homework.user)%> - 发布时间:<%=format_time @homework.created_at %> + + 参与人员: + <% @homework.users.each do |homework_user| %> + <%= link_to homework_user, user_path(homework_user)%> + <% if @homework.users.count > 1 && homework_user != @homework.users.last %> +
                 + <% end %> + <% end %> + + @@ -38,12 +47,12 @@ 所属任务:<%= link_to(@homework.bid.name, project_for_bid_path(@homework.bid))%> - - 平均评分: + 平均评分: <%= rating_for @homework, :static => true, dimension: :quality, class: 'rateable div_inline' %> + 发布时间:<%=format_time @homework.created_at %>