From ec72bb2904098cd41def4176e8001247d3db1251 Mon Sep 17 00:00:00 2001 From: nwb Date: Tue, 17 Jun 2014 15:17:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BD=9C=E4=B8=9A=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 4 ++-- app/controllers/zipdown_controller.rb | 2 +- app/views/bids/_homework_list.html.erb | 2 +- app/views/homework_attach/edit.html.erb | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 9c4d8cfa8..1862c7828 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -972,9 +972,9 @@ class BidsController < ApplicationController def memberAccess # 是课程,则判断当前用户是否参加了课程 return true if current_user.admin? - return 0 if @bid.courses.first.project_type == Project::ProjectType_project + #return 0 if @bid.courses.first.project_type == Project::ProjectType_project currentUser = User.current - render_403 unless currentUser.member_of?(@bid.courses.first) + render_403 unless currentUser.member_of_cousrse?(@bid.courses.first) end end diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 808df65dc..df57e4f41 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -37,7 +37,7 @@ class ZipdownController < ApplicationController #下载某一学生的作业的所有文件 def download_user_homework homework = HomeworkAttach.find params[:homework] - if homework != nil && (User.current.admin? || User.current.member_of?(homework.bid.courses.first)) + if homework != nil && (User.current.admin? || User.current.member_of_course?(homework.bid.courses.first)) zipfile = zip_homework_by_user homework send_file zipfile, :filename => homework.name, :type => detect_content_type(zipfile) if zipfile else diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 18778f5e9..ec15b890e 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -3,7 +3,7 @@ <% is_teacher = is_course_teacher User.current,@bid.courses.first %> <% is_evaluation = @bid.is_evaluation == 1 || @bid.is_evaluation == nil %> -<%= form_tag(:controller => 'bids', :action => "show_project", :method => :get) do %> +<%= form_tag(:controller => 'bids', :action => "show_courseEx", :method => :get) do %>
diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb index f7104840b..b530e6061 100644 --- a/app/views/homework_attach/edit.html.erb +++ b/app/views/homework_attach/edit.html.erb @@ -16,9 +16,9 @@ - - +
<%= link_to request.host()+"/courses", :controller => 'projects', :action => 'course'%>

<%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %> > - <%= link_to(@homework.bid.courses.first.name.to_s, homework_project_path(@homework.bid.courses.first)) if @homework.bid.courses.first%> > +

<%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index'%>

<%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> > + <%= link_to(@homework.bid.courses.first.name.to_s, homework_course_path(@homework.bid.courses.first)) if @homework.bid.courses.first%> > <%=link_to(@homework.bid.name, respond_path(@homework.bid)) %> > <%= link_to "修改作业",edit_homework_attach_path(@homework)%>