diff --git a/Gemfile b/Gemfile index 87cd6dba2..3027c16cd 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ unless RUBY_PLATFORM =~ /w32/ gem 'iconv' end -gem 'grack', path:'./lib/grack' +gem 'grack', path:'lib/grack' gem 'gitlab', path: 'lib/gitlab-cli' gem 'rest-client' gem "mysql2", "= 0.3.18" diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb index 14a0a3536..e398501e4 100644 --- a/app/controllers/blog_comments_controller.rb +++ b/app/controllers/blog_comments_controller.rb @@ -56,14 +56,30 @@ class BlogCommentsController < ApplicationController end def destroy @article = BlogComment.find(params[:id]) - if @article.parent_id.nil? #如果是文章被删,那么跳转到用户博客界面 - @article.children.delete - @article.delete - redirect_to user_blogs_path(:user_id=>User.current) - else - root = @article.root - @article.delete - redirect_to user_blog_blog_comment_path(:user_id=>root.author_id,:blog_id=>root.blog_id,:id=>root.id) + if @article.parent_id.nil? #如果是文章被删,那么跳转到用户博客界面,如果带了course_id过来,那么就要跳转到课程首页 + if params[:course_id] + @article.children.delete + @article.delete + @course = Course.find(params[:course_id]) + @course.outline = 0 + @course.save + redirect_to course_path(:id=>params[:course_id]) + else + @article.children.delete + @article.delete + redirect_to user_blogs_path(:user_id=>User.current) + end + + else#如果是回复被删, + if params[:course_id] #如果带了course_id过来了,那么这是要跳到课程大纲去的 + @article.delete + redirect_to show_course_outline_course_path(:id=>params[:course_id]) + else + root = @article.root + @article.delete + redirect_to user_blog_blog_comment_path(:user_id=>root.author_id,:blog_id=>root.blog_id,:id=>root.id) + end + end end @@ -81,6 +97,7 @@ class BlogCommentsController < ApplicationController @content = "> #{ll(Setting.default_language, :text_user_wrote, @blogComment.author.realname)}\n> " @temp = BlogComment.new + @course_id = params[:course_id] @temp.content = "
#{ll(Setting.default_language, :text_user_wrote, @blogComment.author.realname)}
#{@blogComment.content.html_safe}
".html_safe respond_to do | format| format.js @@ -114,7 +131,14 @@ class BlogCommentsController < ApplicationController #@article.save # redirect_to user_blogs_path(:user_id=>params[:user_id]) respond_to do |format| - format.html { redirect_to user_blog_blog_comment_path(:user_id=>@article.author_id,:blog_id=>@article.blog_id,:id=>@article)} + format.html { + if params[:course_id] #如果呆了course_id过来了,那么这是要跳到课程大纲去的 + redirect_to show_course_outline_course_path(:id=>params[:course_id]) + else + redirect_to user_blog_blog_comment_path(:user_id=>@article.author_id,:blog_id=>@article.blog_id,:id=>@article) + end + + } format.js end rescue Exception => e #如果上面的代码执行发生异常就捕获 diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index c8c482f81..c9d632fec 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -711,6 +711,41 @@ class CoursesController < ApplicationController end end + #从课程创建的老师那里选择课程大纲 + def course_outline + @teacher = User.find(@course.tea_id) + @blog_articles = @teacher.blog.articles + @is_in_show_outline_page = params[:is_in_show_outline_page] + respond_to do |format| + format.js + end + end + + #根据关键字搜索,查找方法一样的,但返回内容不一样 + def search_course_outline + @article_title = params[:title] + @teacher = User.find(@course.tea_id) + @blog_articles = @teacher.blog.articles.like(@article_title) + render :json=>@blog_articles.to_json + end + + #设置或者更改课程的大纲 + def set_course_outline + @course.outline = params[:outline_id] + @course.save + @is_in_show_outline_page = params[:is_in_show_outline_page] + respond_to do |format| + format.js + end + end + + #显示课程大纲 + def show_course_outline + @article = BlogComment.find(@course.outline) + respond_to do |format| + format.html {render :layout => 'base_courses'} + end + end #删除课程 #删除课程只是将课程的is_delete状态改为false,is_delete为false状态的课程只有管理员可以看到 def destroy diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 34e039ae0..4dc2c52f5 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -163,9 +163,9 @@ class MembersController < ApplicationController #给新成员和老师发送加入课程的消息,发送者id放在CourseMessage的course_message_id字段中 #course_message_type设置为JoinCourse #status = 0 表示给学生发,status = 1表示给老师发 - course_join = CourseMessage.new(:user_id =>user_id, :course_message_id=>User.current.id,:course_id => @course.id,:course_message_type=>"JoinCourse", :viewed => false, :status => 0) + course_join = CourseMessage.new(:user_id =>user_id, :course_message_id=>User.current.id,:course_id => @course.id,:course_message_type=>"JoinCourse", :content => role, :viewed => false, :status => 0) course_join.save - CourseMessage.create(:user_id => User.current.id, :course_message_id => user_id, :course_id => @course.id, :course_message_type => "JoinCourse", :viewed => false, status => 1) + CourseMessage.create(:user_id => User.current.id, :course_message_id => user_id, :course_id => @course.id, :course_message_type => "JoinCourse",:content => role, :viewed => false, :status => 1) members << member #user_grades << UserGrade.new(:user_id => user_id, :course_id => @course.id) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 742a02337..f41dbe6c7 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -252,9 +252,12 @@ update else #Modified by young # (show_error_not_found; return) unless @entries - @changesets = @repository.latest_changesets(@path, @rev) - @changesets_count = @repository.latest_changesets(@path, @rev).count - @changesets_latest_coimmit = @changesets.first + g = Gitlab.client + @changesets = g.get ("/projects/#{@project.gpid}/repository/commits") + # @changesets = @repository.latest_changesets(@path, @rev) + # @changesets_count = @repository.latest_changesets(@path, @rev).count + @changesets_count = @changesets.count + @changesets_latest_coimmit = @changesets[0] @properties = @repository.properties(@path, @rev) @repositories = @project.repositories @course_tag = params[:course] @@ -280,7 +283,9 @@ update def changes @entry = @repository.entry(@path, @rev) (show_error_not_found; return) unless @entry - @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i) + g = Gitlab.client + @changesets = g.get ("/projects/#{@project.gpid}/repository/commits?#{@rev}") + #@changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i) @properties = @repository.properties(@path, @rev) @changeset = @repository.find_changeset_by_name(@rev) render :layout => 'base_projects' diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index f9fb31969..a5acc4523 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -628,10 +628,10 @@ module CoursesHelper #重启、关闭课程按钮 def set_course_time course - id = "finish_course_#{course.id}" - linkPath = course_endTime_timeout?(course) ? restartcourse_course_path(course) : finishcourse_course_path(course, format: :js) - desc = course_endTime_timeout?(course) ? l(:label_course_reload) : l(:label_course_closed) - link_to "#{desc}".html_safe, linkPath, :remote => true, :method => :post, :id => id, :confirm => l(:label_course_closed_tips, :desc => desc), :class => "pr_join_a" + # id = "finish_course_#{course.id}" + # linkPath = course_endTime_timeout?(course) ? restartcourse_course_path(course) : finishcourse_course_path(course, format: :js) + # desc = course_endTime_timeout?(course) ? l(:label_course_reload) : l(:label_course_closed) + # link_to "#{desc}".html_safe, linkPath, :remote => true, :method => :post, :id => id, :confirm => l(:label_course_closed_tips, :desc => desc), :class => "pr_join_a" end #加入课程、退出课程按钮 diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index 9bb28ddd8..27da33121 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -19,6 +19,15 @@ class BlogComment < ActiveRecord::Base after_save :add_user_activity before_destroy :destroy_user_activity + scope :like, lambda {|arg| + if arg.blank? + where(nil) + else + pattern = "%#{arg.to_s.strip.downcase}%" + where(" LOWER(title) LIKE :p ", :p => pattern) + end + } + #在个人动态里面增加当前动态 def add_user_activity if self.parent_id.nil? #只有发博文才插入动态 diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 807a26232..8092bee88 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -327,7 +327,7 @@ class CoursesService end else if params[:course_password] == course.password - if params[:role] == "10" + if params[:role] == "10" || params[:role] == nil members = [] members << Member.new(:role_ids => [10], :user_id => current_user.id) course.members << members diff --git a/app/views/blog_comments/_simple_ke_reply_form.html.erb b/app/views/blog_comments/_simple_ke_reply_form.html.erb index fa7ff0c4a..61669058b 100644 --- a/app/views/blog_comments/_simple_ke_reply_form.html.erb +++ b/app/views/blog_comments/_simple_ke_reply_form.html.erb @@ -17,10 +17,13 @@
<%= form_for @blog_comment, :as => :reply, :url => {:controller => 'blog_comments',:action => 'reply', :id => @blogComment.id}, :html => {:multipart => true, :id => 'new_form'} do |f| %> + <% if course_id%> + + <% end %>
- +

<% end%> diff --git a/app/views/blog_comments/quote.js.erb b/app/views/blog_comments/quote.js.erb index 4d16745ca..088b2cf67 100644 --- a/app/views/blog_comments/quote.js.erb +++ b/app/views/blog_comments/quote.js.erb @@ -1,5 +1,5 @@ if($("#reply_message_<%= @blogComment.id%>").length > 0) { - $("#reply_message_<%= @blogComment.id%>").replaceWith("<%= escape_javascript(render :partial => 'simple_ke_reply_form', :locals => {:reply => @blogComment,:temp =>@temp,:subject =>@subject}) %>"); + $("#reply_message_<%= @blogComment.id%>").replaceWith("<%= escape_javascript(render :partial => 'blog_comments/simple_ke_reply_form', :locals => {:reply => @blogComment,:temp =>@temp,:subject =>@subject,:course_id=>@course_id}) %>"); $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); diff --git a/app/views/courses/_course_outlines_list.html.erb b/app/views/courses/_course_outlines_list.html.erb new file mode 100644 index 000000000..6710c22ba --- /dev/null +++ b/app/views/courses/_course_outlines_list.html.erb @@ -0,0 +1,32 @@ + +
请选择课程大纲
+ +
+
+ + + +
+
+ + <%= form_tag(url_for(:controller=>'courses',:action=>'set_course_outline',:id=>course.id),:method=>'post',:remote=>'true') do %> + +
+ <% unless articles.blank? %> + <% articles.each do |article|%> + +
发布时间:<%= format_date(article.created_at)%>
+ <% end %> + <% end %> +
+
+ + +
+
+<% end %> diff --git a/app/views/courses/_set_join.js.erb b/app/views/courses/_set_join.js.erb index 33caf5273..dbdf3d7f3 100644 --- a/app/views/courses/_set_join.js.erb +++ b/app/views/courses/_set_join.js.erb @@ -23,4 +23,6 @@ <% else %> alert("未知错误,请稍后再试"); <% end %> +<% else %> + location.reload(); <% end %> diff --git a/app/views/courses/course_outline.js.erb b/app/views/courses/course_outline.js.erb new file mode 100644 index 000000000..490361a24 --- /dev/null +++ b/app/views/courses/course_outline.js.erb @@ -0,0 +1,9 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'course_outlines_list',:locals => {:articles=>@blog_articles,:course=>@course,:show_page=>@is_in_show_outline_page}) %>'); +showModal('ajax-modal', '300px'); +//$('#ajax-modal').css('height','250px'); +$('#ajax-modal').css('padding-top','0px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before(' '); +$('#ajax-modal').parent().css("top","30%").css("left","50%"); +$('#ajax-modal').parent().addClass("courseOutlinePopup"); +$('#ajax-modal').css("padding-left","16px")//.css("padding-bottom","16px"); diff --git a/app/views/courses/join.js.erb b/app/views/courses/join.js.erb index 8e6f8ce20..721367549 100644 --- a/app/views/courses/join.js.erb +++ b/app/views/courses/join.js.erb @@ -4,7 +4,7 @@ $("#join_in_course_header").html("<%= escape_javascript(join_in_course_header(@c <% if @state %> <% if @state == 0 %> alert("加入成功"); -hidden_join_course_form(); +hideModal(); $("#try_join_course_link").replaceWith(" 'index',:course=>@course.id, :host=>Setting.host_course)%>' target='_blank' class='blue_n_btn fr mt20'>提交作品"); window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" <% elsif @state == 1 %> diff --git a/app/views/courses/set_course_outline.js.erb b/app/views/courses/set_course_outline.js.erb new file mode 100644 index 000000000..af075d2b8 --- /dev/null +++ b/app/views/courses/set_course_outline.js.erb @@ -0,0 +1,8 @@ +hideModal(); +<%if @course.tea_id == User.current.id && @course.outline == 0 %> +<% else %> + $("#course_outline_bar").html(' ') +<%end %> +<%if @is_in_show_outline_page && @is_in_show_outline_page == 'Y'%> + window.location.href='<%=show_course_outline_course_path(@course) %>'; +<% end %> diff --git a/app/views/courses/show_course_outline.html.erb b/app/views/courses/show_course_outline.html.erb new file mode 100644 index 000000000..18a980209 --- /dev/null +++ b/app/views/courses/show_course_outline.html.erb @@ -0,0 +1,212 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %> + + + +
+
+
+ <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> +
+
+ <% if User.current && @article.author.id == User.current.id%> + + + + + + + + + + <%end%> + +
+ +
+ <% if @article.try(:author).try(:realname) == ' ' %> + <%= link_to @article.try(:author), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% else %> + <%= link_to @article.try(:author).try(:realname), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% end %> +
+
<%= format_time( @article.created_on)%>
+
+
+ <%= @article.content.html_safe%> +
+
+
+ <%#= link_to_attachments_course @topic, :author => false %> + <% if @article.attachments.any?%> + <% options = {:author => true, :deletable => false} %> + <%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => @article.attachments, :options => options, :is_float => true} %> + <% end %> +
+
+
+
+
+ <% count=0 %> + <% if @article.parent %> + <% count=@article.parent.children.count%> + <% else %> + <% count=@article.children.count%> + <% end %> +
+ <% unless count == 0 %> +
+
回复(<%=count %>)
+
+ +
+
+ <%@article.children.reorder('created_on desc').each_with_index do |reply,i| %> + +
+
+ <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
+
+
+ <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% end %> +
+
+ <%= reply.content.html_safe%> +
+
+ <%= format_time(reply.created_on) %> + +
+

+
+
+
+ <% end %> +
+ + <% end %> +
+ <% if !@article.locked? && User.current.logged?%> + + + + + + + + + + + + + +
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@article.author_id), :alt => "用户头像" %>
+
+
+ <%= form_for 'blog_comment',:url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id},:method => "post",:html => {:multipart => true, :id => 'message_form'} do |f|%> + + + + + +
+ +
+

+ <% end%> +
+
+
+
+
+ <% end %> +
+
\ No newline at end of file diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 04d16a334..305eaaa29 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -54,17 +54,51 @@
-
- - <%= @course.name %> - - <% if @course.is_public == 0%> + + + + + + + + + + + + + + + + + + + +
+ +
+ + <%= @course.name %> + + <% if @course.is_public == 0%> + <%= l(:field_is_private)%> - <% end %> - -
+ <% end %> + + <%if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %> + + <% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0%> + + <% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course)%> + + <% elsif User.current && @course.tea_id != User.current.id && @course.is_public?%> + + <%else%> + <%end %> + +
+
<%= l(:label_account_identity_teacher)%>(<%= course_teacher_link teacher_num %>) @@ -167,5 +201,51 @@ <%= call_hook :view_layouts_base_body_bottom %> + \ No newline at end of file diff --git a/app/views/projects/_new_join.html.erb b/app/views/projects/_new_join.html.erb index c406ac2e6..c823f5ed0 100644 --- a/app/views/projects/_new_join.html.erb +++ b/app/views/projects/_new_join.html.erb @@ -18,13 +18,6 @@ @@ -40,7 +33,7 @@ <%= text_field_tag 'course_password', nil, :style=>'width:300px;'%>
- + 确  定 diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb index 891952559..fe60f8933 100644 --- a/app/views/repositories/_revisions.html.erb +++ b/app/views/repositories/_revisions.html.erb @@ -1,53 +1,35 @@ -<% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %> -<%= if show_revision_graph && revisions && revisions.any? - indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid| - url_for( - :controller => 'repositories', - :action => 'revision', - :id => project, - :repository_id => @repository.identifier_param, - :rev => scmid) - end - render :partial => 'revision_graph', - :locals => { - :commits => indexed_commits, - :space => graph_space - } - end %> <%= form_tag( {:controller => 'repositories', :action => 'diff', :id => project, :repository_id => @repository.identifier_param, :path => to_path_param(path)}, :method => :get ) do %> - - - - - - - - + + + + + + + + <% show_diff = revisions.size > 1 %> <% line_num = 1 %> <% revisions.each do |changeset| %> - <% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %> - <%= content_tag(:td, :class => 'id', :style => id_style) do %> - <%= link_to_revision(changeset, @repository) %> - <% end %> - - - - - + + + + + + <% line_num += 1 %> <% end %>
#<%= l(:label_date) %><%= l(:field_author) %><%= l(:field_comments) %>
<%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %><%= format_time(changeset.committed_on) %><%= h truncate(changeset.author.to_s, :length => 30) %><%= textilizable(truncate_at_line_break(changeset.comments)) %><%= h truncate(changeset.id.to_s, :length => 20) %><%= format_time(changeset.created_at) %><%= h truncate(changeset.author_name.to_s, :length => 30) %><%= textilizable(truncate_at_line_break(changeset.message)) %>

- <%= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %> + <%#= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>

+ <% end %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index a1dd44cb7..7f9f675d2 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -30,10 +30,10 @@
<% if @changesets && !@changesets.empty? %> - <%= image_tag(url_to_avatar(@changesets_latest_coimmit.user), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> -
<%=link_to @changesets_latest_coimmit.user, user_path(@changesets_latest_coimmit.user) %>
-
提交于<%= time_tag(@changesets_latest_coimmit.committed_on) %>:
-
<%= @changesets_latest_coimmit.comments %>
+ <%= image_tag(url_to_avatar(@changesets_latest_coimmit.author_name), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> +
<%=link_to @changesets_latest_coimmit.author_name, user_path(@changesets_latest_coimmit.author_name) %>
+
提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
+
<%= @changesets_latest_coimmit.message %>
<% end %> @@ -59,15 +59,7 @@ <%= render_properties(@properties) %> -<% if authorize_for('repositories', 'revisions') %> - <% if @changesets && !@changesets.empty? %> - <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0) - sep = '' %> - <% if @repository.supports_all_revisions? && @path.blank? %> - <%= link_to l(:label_view_all_revisions_commits), :action => 'revisions', :id => @project, :repository_id => @repository.identifier_param %> - <% end %> | - <% end %> -<% end %> +
如何提交代码 <% content_for :header_tags do %> diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index ed0147be8..678fac93b 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -426,10 +426,16 @@

课程名称:<%= ma.course_message.name %>

开课学期:<%= ma.course_message.time.to_s + '年' + ma.course_message.term %>

-
课程描述:
-
<%= ma.course_message.description.html_safe %>
-

学时总数:<%= ma.course_message.class_period%>

+

课程ID:<%= ma.course_message.id %>

+

课程密码:<%= ma.course_message.password %>

+

学时总数:<%= ma.course_message.class_period %>

创建时间:<%= format_time(ma.course_message.created_at) %>

+

您可以点击左上角的“配置”按钮,修改课程基本信息,添加及删除课程成员。您也可以把课程ID及密码告诉学生和其他成员,让他们输入ID及密码加入课程。

+ <% if ma.course_message.is_public %> +

您的课程是公开的,所有人都能访问您的课程。若不想设置为公开,您可以在配置中设置。

+ <% else %> +

您的课程是私有的,非课程成员不能访问您的课程。如果想设置为公开,您可以在配置中设置。

+ <% end %>
  • <%= time_tag(ma.created_at).html_safe %>
  • @@ -505,7 +511,7 @@ <% end %> - <% if ma.course_message_type == "JoinCourse" %> + <% if ma.course_message_type == "JoinCourse" and ma.status == 0 %>
    • <%=link_to image_tag(url_to_avatar(User.find(ma.course_message_id)), :width => "30", :height => "30"), user_path(ma.course_message_id) %> @@ -521,8 +527,44 @@
    • +
    • <%= time_tag(ma.created_at).html_safe %>
    • +
    + <% end %> + + + <% if ma.course_message_type == "JoinCourse" and ma.status == 1 %> +
      +
    • + +
    • +
    • + 系统提示 + ">您增加了新的课程成员: +
    • +
    • + <%= link_to User.find(ma.course_message_id), user_path(ma.course_message_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", + :onmouseover => "message_titile_show($(this),event)", + :onmouseout => "message_titile_hide($(this))" %> +
    • +