增加功能<增加学生列表是否公开功能>

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-11-03 17:00:01 +08:00
parent 8cec84dca7
commit 495c4db43e
5 changed files with 14 additions and 5 deletions

View File

@ -5,7 +5,7 @@ class Course < ActiveRecord::Base
STATUS_CLOSED = 5
STATUS_ARCHIVED = 9
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student
belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
@ -52,7 +52,8 @@ class Course < ActiveRecord::Base
'term',
'is_public',
'description',
'class_period'
'class_period',
'open_student'
acts_as_customizable

View File

@ -110,7 +110,13 @@
<%= f.check_box :is_public, :style => "margin-left:10px;" %>
<%= l(:label_course_public_info) %>
</em>
</p><!-- modified by bai -->
</p>
<p style="margin-left:-10px;">
<em style="color: #888888;display: block;font-size: 90%;font-style: normal;">
<%= f.check_box :open_student, :style => "margin-left:10px;" %>
<%= l(:label_course_open_student_info) %>
</em>
</p>
<p style="display:none;"><%= f.text_field :course_type, :value => 1 %></p>
<%= wikitoolbar_for 'course_description' %>
<% @course.custom_field_values.each do |value| %>

View File

@ -121,7 +121,7 @@
<% end%>
</td>
<td class="font_index">
<% if User.current.member_of_course?(@course) %>
<% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %>
<%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %>
<% else %>
<span>

View File

@ -288,6 +288,7 @@ zh:
field_class_period: 学时
field_code: 学分
field_is_public: 公开
field_open_student: 学生列表公开
field_parent: 上级项目
field_is_in_roadmap: 在路线图中显示
field_login: 昵称
@ -1799,6 +1800,7 @@ zh:
label_course_join_student: 加入课程
label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
label_course_public_info: (打钩为公开,不打钩则不公开,若不公开,仅课程成员可见该课程。)
label_course_open_student_info: (打钩为“学生列表公开”,不打钩为不公开,若不公开,则课程外部人员看不到学生列表)
label_course_view_student: 查看其他课程
label_course_student: 学生
label_homework: 课程作业

View File

@ -157,7 +157,7 @@ RedmineApp::Application.routes.draw do
resources :forums do
collection do
match 'search_forum', :via => [:get, :post]
end
member do
post 'create_memo'