From a56c200967fb5cf8ccdbdde78e385e5a5bca1621 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 26 May 2014 09:37:06 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E4=BD=9C=E4=B8=9A=E7=95=99?= =?UTF-8?q?=E8=A8=80=E8=B6=85=E8=BF=87=E4=B8=80=E9=A1=B5=E6=9D=A1=E6=95=B0?= =?UTF-8?q?=E9=99=90=E5=88=B6=E6=97=B6=E4=B8=8D=E4=BC=9A=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E6=8D=A2=E9=A1=B5=E6=A0=87=E7=AD=BE=E7=9A=84BUG=202.=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=82=B9=E5=87=BB=E4=BD=9C=E4=B8=9A=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=B8=BA=E4=B8=8B=E8=BD=BD=E4=BD=9C=E4=B8=9A=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=92=E8=AF=84=E6=8C=89=E9=92=AE=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=BA=92=E8=AF=84=E9=A1=B5=E9=9D=A2=203.?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD=E5=BD=93=E5=89=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=98=AF=E4=B8=8D=E6=98=AF=E6=8C=87=E5=AE=9A=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E6=88=90=E5=91=98=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/bids_helper.rb | 11 +++++++++++ app/views/bids/_homework_list.html.erb | 2 +- app/views/homework_attach/_showjour.html.erb | 10 +++++++++- app/views/homework_attach/show.html.erb | 7 ------- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/app/helpers/bids_helper.rb b/app/helpers/bids_helper.rb index 721b30361..a5c25ecb5 100644 --- a/app/helpers/bids_helper.rb +++ b/app/helpers/bids_helper.rb @@ -145,6 +145,17 @@ module BidsHelper people.include?(User.current) end + # 当前用户是否加入了此课程(包括教师) + def is_cur_course_user? bid + people = [] + #people << bid.author + course = bid.courses.first + course.members.each do |member| + people << member.user + end + people.include?(User.current) + end + # def select_option_helper option # tmp = Hash.new # option.each do |project| diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index f7db8a375..3bcd12964 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -44,7 +44,7 @@ <% end %>