diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb index 8ff88823d..8d7195f38 100644 --- a/app/controllers/syllabuses_controller.rb +++ b/app/controllers/syllabuses_controller.rb @@ -6,7 +6,7 @@ class SyllabusesController < ApplicationController include CoursesHelper before_filter :is_logged, :only => [:index, :show, :edit, :new, :update, :destroy, :delete_syllabus] - before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :update_base_info, :delete_syllabus, :delete_des] + before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :edit_syllabus_title, :update_base_info, :delete_syllabus, :delete_des] def index user = User.current @syllabuses = user.syllabuses @@ -140,6 +140,16 @@ class SyllabusesController < ApplicationController end end + #修改课程名称 + def edit_syllabus_title + if @syllabus && params[:title] != "" + @syllabus.update_column("title",params[:title]) + end + respond_to do |format| + format.js + end + end + #修改英文名称 def edit_syllabus_eng_name if @syllabus diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e4fa452f5..5b18908d4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3323,7 +3323,7 @@ def get_group_member_names work result end -def course_syllabus_option user +def course_syllabus_option user = User.current syllabuses = user.syllabuses type = [] option1 = [] diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 55a4da73a..d1f4bfe97 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -772,12 +772,12 @@ module CoursesHelper url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id) method = joined ? 'delete' : 'post' if joined - link = link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) + link = link_to(text, url, :remote => true, :method => method, :class => "Blue-btn", :style => "margin_left: 0px;", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) else - link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "pr_join_a") + link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "Blue-btn", :style => "margin_left: 0px;") end else - link = "#{l(:label_course_join_student)}" + link = "#{l(:label_course_join_student)}" end link.html_safe end diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index f8db461a6..78b3d8293 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -7,7 +7,7 @@
  • <% if @syllabus.nil? %> - <%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %> + <%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %> <% else %> <%=@syllabus.title %> diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index 10bb0ed55..ee0f6c98a 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -31,7 +31,7 @@
  • - <%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:280px'} %> + <%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:280px'} %>
  • diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb index c0366ec39..b0407e2c5 100644 --- a/app/views/layouts/_project_info.html.erb +++ b/app/views/layouts/_project_info.html.erb @@ -8,30 +8,29 @@ <% end %> <%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %> -
    +
    + <% if @course.syllabus%> - + <%= @course.syllabus.title + " •" %> <% end %> -
    - - <%=@course.is_public == 0 ? '(私有)' : '(公开)' %> +  <%= @course.name %><%=@course.is_public == 0 ? '(私有)' : '(公开)' %> <% if is_excellent_course(@course) %> 精品课程 <% end %> -
    -
    -
    - <% unless is_teacher %> -
    <%= join_in_course_header(@course, User.current) %>
    - <% end %> +
    +
    - 邀请码: - <%=@course.generate_invite_code %> + 邀请码: + <%=@course.generate_invite_code %> + <% unless is_teacher %> +
    <%= join_in_course_header(@course, User.current) %>
    + <% end %>
    +
    <%= l(:label_account_identity_teacher)%>(<%= course_teacher_link teacher_num %>) @@ -45,6 +44,9 @@
      • + <% if @course.syllabus %> +
      • <%= link_to "查看课程", syllabus_path(@course.syllabus), :class => "postOptionLink", :target => "_blank" %>
      • + <% end %>
      • <%= link_to "班级配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %>
      • <%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %>
      • <%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %>
      • diff --git a/app/views/layouts/_syllabus_info.html.erb b/app/views/layouts/_syllabus_info.html.erb index b67cb4c4d..10979a00f 100644 --- a/app/views/layouts/_syllabus_info.html.erb +++ b/app/views/layouts/_syllabus_info.html.erb @@ -1,12 +1,14 @@ -<% teachers_num = teacher_count @syllabus%> -<% students_num = student_count @syllabus%> -<% files_num = file_count @syllabus%> -