From 9716e99533600417b6b4f0b2b98ba9b2664e3560 Mon Sep 17 00:00:00 2001
From: huang <huang.jingquan@163.com>
Date: Fri, 4 Dec 2015 16:33:56 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=88=90=E5=91=98=E6=8F=90?=
 =?UTF-8?q?=E4=BA=A4=E2=80=9C=E4=BF=AE=E6=94=B9=E8=A7=92=E8=89=B2=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/controllers/courses_controller.rb | 2 +-
 app/views/courses/member.html.erb     | 6 +++++-
 app/views/courses/settings.html.erb   | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 5da9db395..0c61c449e 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -374,7 +374,7 @@ class CoursesController < ApplicationController
 
   def settings
     if User.current.allowed_to?(:as_teacher,@course)
-
+      @select_tab = params[:tab]
       @issue_custom_fields = IssueCustomField.sorted.all
       @issue_category ||= IssueCategory.new
       @member ||= @course.members.new
diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb
index e906bf778..3aa7d4b57 100644
--- a/app/views/courses/member.html.erb
+++ b/app/views/courses/member.html.erb
@@ -1,6 +1,10 @@
 <div class="project_r_h">
   <h2 class="project_h2 fl"><%= @subPage_title%></h2>
-  <span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">修改角色</span>
+  <% if User.current.allowed_to?(:as_teacher,@course) %>
+    <span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
+      <%=link_to "修改角色", :controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member' %>
+    </span>
+  <% end %>
 </div>
 <% if @subPage_title == l(:label_student_list)%>
     <%= render :partial => 'course_student', :locals => {:members => @members} %>
diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb
index 8d3454776..3456634d5 100644
--- a/app/views/courses/settings.html.erb
+++ b/app/views/courses/settings.html.erb
@@ -3,7 +3,7 @@
 </div>
 <script>
   $(function(){
-      <% if @edit_user == 'Y'%>
+      <% if @select_tab == 'member'%>
       $("#tb_2").click();
       <% end %>
   })