diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 696511100..a4e5d6fff 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -39,6 +39,8 @@ class CoursesController < ApplicationController else @state = 3 end + else + @state = 4 end respond_to do |format| # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} diff --git a/app/views/courses/_set_join.js.erb b/app/views/courses/_set_join.js.erb index 8b5c1fb36..fb9b9924e 100644 --- a/app/views/courses/_set_join.js.erb +++ b/app/views/courses/_set_join.js.erb @@ -3,16 +3,18 @@ <% end %> <% if @state %> <% if @state == 0 %> - alert("加入成功") + alert("加入成功"); <% elsif @state == 1 %> - alert("密码错误") + alert("密码错误"); <% elsif @state == 2 %> - alert("课程已过期\n请联系课程管理员重启课程。(在配置课程处)") + alert("课程已过期\n请联系课程管理员重启课程。(在配置课程处)"); <% elsif @state == 3 %> alert("您已经加入了课程"); - <% elsif @state == 3 %> - alert("您已经的课程不存在") + <% elsif @state == 4 %> + alert("您已经的课程不存在"); + <% elsif @state == 4 %> + alert("您还未登录"); <% else %> - alert("未知错误,请稍后再试") + alert("未知错误,请稍后再试"); <% end %> <% end %> diff --git a/app/views/welcome/_more_course.html.erb b/app/views/welcome/_more_course.html.erb index a5464c27c..66f15fdf2 100644 --- a/app/views/welcome/_more_course.html.erb +++ b/app/views/welcome/_more_course.html.erb @@ -4,7 +4,8 @@ :class => 'icon icon-add') if User.current.allowed_to?(:add_course,nil, :global => true) %> <% end %>      + <%= link_to l(:label_course_join_student), join_private_courses_courses_path ,:remote => true, :class => 'icon icon-add' %> +      <% end %> -<%= link_to l(:label_course_join_student), join_private_courses_courses_path ,:remote => true, :class => 'icon icon-add' %> -     + <%= link_to l(:label_more), {:controller => 'courses', :action => 'index', :school_id => school_id} %> \ No newline at end of file