Fix bug.
This commit is contained in:
parent
7405b33538
commit
b0f0f74430
|
@ -201,6 +201,8 @@ class Admin::SelectedCoursesController < OrbitMemberController
|
|||
end
|
||||
elsif( Course.find(course_assignment_params[:course_id]).member_profile_id.to_s == current_user.member_profile_id.to_s rescue false)
|
||||
return true
|
||||
elsif( CourseAssignment.find(student_assignment_params[:course_assignment_id]).course.member_profile_id.to_s == current_user.member_profile_id.to_s rescue false) || (CourseAssignment.find(student_assignment_params[:course_assignment_id]).course.student_ids.include?(current_user.member_profile_id.to_s) rescue false)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
|
|
@ -37,8 +37,7 @@ class SelectedCourse
|
|||
if course
|
||||
record.course_title = course.title
|
||||
record.year = course.year
|
||||
record.course_objective = course.objective
|
||||
if record.class.where(:course_id=>course.id,:member_profile_id=>record.member_profile_id).count != 0
|
||||
if record.class.where(:course_id=>course.id,:member_profile_id=>record.member_profile_id,:id.ne=>record.id).count != 0
|
||||
false
|
||||
else
|
||||
if course && !course.student_ids.include?(record.member_profile_id.to_s)
|
||||
|
@ -48,7 +47,7 @@ class SelectedCourse
|
|||
end
|
||||
end
|
||||
elsif( course.student_ids.include?(record.member_profile_id.to_s) rescue false)
|
||||
false
|
||||
true
|
||||
elsif course
|
||||
record.course_title = course.title
|
||||
record.year = course.year
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<div class="control-group input-title">
|
||||
<label class="control-label muted"><%= t("personal_course.detail") %></label>
|
||||
<div class="controls">
|
||||
<%= @course_assignment.detail %>
|
||||
<%= @course_assignment.detail.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Attachment -->
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= course_assignment.detail %></td>
|
||||
<td><%= course_assignment.detail.html_safe %></td>
|
||||
<td><%= course_assignment.display_attachments %></td>
|
||||
<td><%= course_assignment.display_assign_date %></td>
|
||||
<td><%= course_assignment.display_deadline %></td>
|
||||
|
|
|
@ -21,7 +21,7 @@ en:
|
|||
year: Year
|
||||
course_title: Course Title
|
||||
course_url: Course URL
|
||||
course_objective: Course Objective
|
||||
course_objective: Learning Objective
|
||||
selected_course_semester: Semester
|
||||
selected_course_category: Category
|
||||
selected_course_syllabus_file: Syllabus Files
|
||||
|
|
|
@ -21,7 +21,7 @@ zh_tw:
|
|||
year: 年度
|
||||
course_title: 課程名稱
|
||||
course_url: 課程網址
|
||||
course_objective: 課程目標
|
||||
course_objective: 學習目標
|
||||
selected_course_category: 課程類別
|
||||
selected_course_semester: 學期
|
||||
selected_course_syllabus_file: 教學大綱
|
||||
|
|
Loading…
Reference in New Issue