dev_SaaS
hjm 6 years ago
commit c75168a648

@ -2,6 +2,7 @@
class EcCourseAchievementMethodsController < ApplicationController
before_filter :find_target, :only => [:edit_course_target, :create_evaluation_methods]
skip_before_filter :verify_authenticity_token, :only => [:create_evaluation_methods, :sync_course_data]
before_filter :find_ec_course, :only => [:index]
include ApplicationHelper
@ -59,11 +60,9 @@ class EcCourseAchievementMethodsController < ApplicationController
###############################################################
def index
achievement_list = []
# 具体工程课程
ec_course = EcCourse.find params[:ec_course_id]
# 课程的所有目标
targets = ec_course.ec_course_targets
targets = @ec_course.ec_course_targets
targets.each do |target|
evaluate_data = []
# 评价环节
@ -95,7 +94,7 @@ class EcCourseAchievementMethodsController < ApplicationController
end
achievement_list << {target_id: target.id, target_evaluate_data: evaluate_data}
end
render :json => {achievement_list: achievement_list}
render :json => {achievement_list: achievement_list, is_manager: @is_manager}
end
@ -306,4 +305,13 @@ class EcCourseAchievementMethodsController < ApplicationController
@target = EcCourseTarget.find params[:ec_course_target_id]
end
def find_ec_course
@ec_course = EcCourse.find(params[:ec_course_id])
@year = @ec_course.ec_year
@ec_major_school = @year.ec_major_school
@template_major = User.current.admin? || @ec_major_school.school.ec_school_users.pluck(:user_id).include?(User.current.id) ||
@ec_major_school.ec_major_school_users.pluck(:user_id).include?(User.current.id)
@is_manager = @template_major || @ec_course.ec_course_users.pluck(:user_id).include?(User.current.id)
end
end

@ -47,6 +47,8 @@ class EcCourseSupportsController < ApplicationController
course_support_data = []
max_support_count = 0
subitems_count = 0
major_school = @year.ec_major_school
is_manager = User.current.admin? || major_school.school.ec_school_users.pluck(:user_id).include?(User.current.id) || major_school.ec_major_school_users.pluck(:user_id).include?(User.current.id)
ec_graduation_requirements.each_with_index do |gr, i|
logger.info("#############index:#{i}#####_ec_gradiation_reqiorements: #{gr.id}")
subitems_count += gr.ec_graduation_subitems.count
@ -74,7 +76,8 @@ class EcCourseSupportsController < ApplicationController
subitems_url: "#{graduation_requirement_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}",
course_count: @year.ec_courses.count,
course_url: "#{ec_course_setting_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}",
max_support_count: max_support_count}
max_support_count: max_support_count,
is_manager: is_manager}
end
# 毕业要求vs课程体系 详情页面

@ -429,7 +429,7 @@ class EcCoursesController < ApplicationController
{score: 70, level: ""},
{score: 60, level: ""}]
end
render :json => {levels: ls}
render :json => {levels: ls, is_manager: @is_manager}
}
end
end

@ -26,7 +26,7 @@
<% end %>
</li>
<% end %>
<% else %>
<% elsif @template_major %>
<form id="form_data_for_requirements">
<div class="clearfix ml30 mr30 pt20 pb20 bor-top-greyE" id="requirementNew">
<p class="df mb20"><input type="hidden" name="year_id" value="<%= @year.id %>">

@ -13,7 +13,7 @@
</li>
<% end %>
</ul>
<% elsif @ec_training_objective.present? %>
<% elsif @ec_training_objective.present? && @template_major && @ec_training_objective && @sub_training_objectives.count > 0 %>
<form id="edit_training_subitems">
<ul class="edu-back-white padding10-30" id="SubentryNewPanel">
<li class="df mb10">

@ -12,7 +12,7 @@
<a href="javascript:void(0)" class="defalutCancelbtn mr20 fr" onclick="CancelEditBtn();">取消</a>
</p>
</div>
<% else %>
<% elsif @template_major && @ec_training_objective && @sub_training_objectives.count > 0 %>
<div class="clearfix" id="targetEdit">
<textarea class="winput-100-130 mb10" id="training_obejctive"></textarea>
<p class="clearfix">

Loading…
Cancel
Save