diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index e1a16a7c1..fce054ce8 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -383,6 +383,10 @@ end # 新增 def create_departments + dep = Department.order("created_at desc").first + @latest_school = School.find(dep.try(:school_id)).try(:name) + @school_id = dep.try(:school_id) + respond_to do |format| format.js end diff --git a/app/models/challenge.rb b/app/models/challenge.rb index 1e389f070..980711d59 100644 --- a/app/models/challenge.rb +++ b/app/models/challenge.rb @@ -44,7 +44,7 @@ class Challenge < ActiveRecord::Base def choose_score score = 0 self.challenge_chooses.each do |choose| - score += choose.score + score += choose.score.to_i end return score end diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 21b61ec95..529ef165b 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -13,12 +13,12 @@
  • <%= link_to '成员管理', members_course_path(@course),:class => "color-orange03" %> <% apply_count = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0).count %> <% if apply_count > 0 %> - <%= apply_count %> + <%= apply_count %> <% end %>
  • <%= link_to '+ 发布普通作业'.html_safe, new_homework_common_path(:course => @course.id, :homework_type => 1),:class => "color-orange03" %>
  • <%= link_to '+ 发布实训作业'.html_safe, shixuns_homework_common_index_path(:course => @course.id),:class => "color-orange03", :remote => true %>
  • -
  • + 发布资源
  • +
  • + 发布资源
  • <% course_board = @course.boards.where("parent_id is NULL").first %>
  • <%= link_to '+ 发布帖子'.html_safe, new_board_message_path(:board_id => course_board.id),:class => "color-orange03" %>
  • diff --git a/app/views/managements/_create_department.html.erb b/app/views/managements/_create_department.html.erb index 785689032..4cd6664bd 100644 --- a/app/views/managements/_create_department.html.erb +++ b/app/views/managements/_create_department.html.erb @@ -4,15 +4,16 @@
    - 单位全称: - + 单位全称: + +
    请选择单位
    - 子单位名称: + 子单位名称:
    请输入子单位名称
    diff --git a/app/views/shixuns/_statistics_student_list.html.erb b/app/views/shixuns/_statistics_student_list.html.erb index f1e1c3073..5b79f7747 100644 --- a/app/views/shixuns/_statistics_student_list.html.erb +++ b/app/views/shixuns/_statistics_student_list.html.erb @@ -1,6 +1,11 @@ +<% if @statistics.blank? %> +
    + <%= render :partial => "welcome/no_data" %> +
    +<% else %>
    @@ -48,4 +53,5 @@
      - \ No newline at end of file + +<% end %> \ No newline at end of file diff --git a/db/migrate/20170918014832_update_course_lists.rb b/db/migrate/20170918014832_update_course_lists.rb new file mode 100644 index 000000000..2b66f795a --- /dev/null +++ b/db/migrate/20170918014832_update_course_lists.rb @@ -0,0 +1,8 @@ +class UpdateCourseLists < ActiveRecord::Migration + def up + CourseList.where("user_id is null").update_all(:user_id => 1) + end + + def down + end +end diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index f7f4f00e3..e79899e4b 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -279,7 +279,7 @@ a:hover.edu-filter-cir-grey,a.edu-filter-cir-grey.active{ border:1px solid #3498 .edu-pop-table tr td{border-bottom:1px solid #eee;} .edu-pop-table.table-line tr td,.edu-pop-table.table-line tr th{ border-right:1px solid #eee;} .edu-pop-table.table-line tr td:last-child,.edu-pop-table.table-line tr th:last-child{border-right:none;} -.edu-pop-table tr td .alink-name{color: #666666!important;} +.edu-pop-table tr td .alink-name{color: #333!important;} .edu-pop-table tr td .alink-name:hover{color: #FF7500!important;} .edu-pop-table tr td .alink-operate{color: #cccccc!important;} .edu-pop-table tr td .alink-operate:hover{color: #FF7500!important;}