diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb
index 95790a68d..14a0a3536 100644
--- a/app/controllers/blog_comments_controller.rb
+++ b/app/controllers/blog_comments_controller.rb
@@ -89,6 +89,9 @@ class BlogCommentsController < ApplicationController
#回复
def reply
+ if params[:in_user_center]
+ @in_user_center = true
+ end
@article = BlogComment.find(params[:id]).root
@quote = params[:quote][:quote]
@blogComment = BlogComment.new
@@ -101,7 +104,11 @@ class BlogCommentsController < ApplicationController
@blogComment.title = "RE: #{@article.title}" unless params[:blog_comment][:title]
@article.children << @blogComment
@user_activity_id = params[:user_activity_id]
-
+ user_activity = UserActivity.where("act_type='BlogComment' and act_id =#{@article.id}").first
+ if user_activity
+ user_activity.updated_at = Time.now
+ user_activity.save
+ end
attachments = Attachment.attach_files(@blogComment, params[:attachments])
render_attachment_warning_if_needed(@blogComment)
#@article.save
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 7793ef097..55807886b 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -217,7 +217,12 @@ class HomeworkCommonController < ApplicationController
#评分设置
def score_rule_set
-
+ if params[:user_activity_id]
+ @user_activity_id = params[:user_activity_id]
+ else
+ @user_activity_id = -1
+ end
+ @is_in_course = params[:is_in_course]
end
private
diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb
index 6bb61e6a1..34e039ae0 100644
--- a/app/controllers/members_controller.rb
+++ b/app/controllers/members_controller.rb
@@ -159,6 +159,14 @@ class MembersController < ApplicationController
if role && (role.name == "学生" || role.name == "Student")
StudentsForCourse.create(:student_id => user_id, :course_id =>@course.id)
end
+
+ #给新成员和老师发送加入课程的消息,发送者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.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)
+
members << member
#user_grades << UserGrade.new(:user_id => user_id, :course_id => @course.id)
if (params[:membership][:role_ids])
@@ -305,7 +313,8 @@ class MembersController < ApplicationController
grade.destroy
end
end
- ForgeMessage.create(:user_id => @member.user_id, :project_id => @project.id, :forge_message_type => "RemoveFromProject", :viewed => false, :forge_message_id => User.current.id)
+ #移出项目发送消息
+ ForgeMessage.create(:user_id => @member.user_id, :project_id => @project.id, :forge_message_type => "RemoveFromProject", :viewed => false, :forge_message_id => User.current.id)
end
respond_to do |format|
format.html { redirect_to_settings_in_projects }
@@ -333,6 +342,8 @@ class MembersController < ApplicationController
end
@roles = Role.givable.all[3..5]
@members = @course.member_principals.includes(:roles, :principal).all.sort
+ #移出课程发送消息
+ CourseMessage.create(:user_id => @member.user_id, :course_id => @course.id, :course_message_type => "RemoveFromCourse", :viewed => false, :course_message_id => User.current.id)
end
respond_to do |format|
format.html { redirect_to_settings_in_courses }
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 529c5ea72..25782ec4b 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -108,6 +108,7 @@ class StudentWorkController < ApplicationController
else
@stundet_works = []
end
+ @student_work_count = (search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count
else
if @is_teacher || @homework.homework_detail_manual.nil? #老师 || 超级管理员 显示所有列表
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
@@ -128,6 +129,7 @@ class StudentWorkController < ApplicationController
else
@stundet_works = []
end
+ @student_work_count = (search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name).count
end
@score = @b_sort == "desc" ? "asc" : "desc"
@@ -456,14 +458,14 @@ class StudentWorkController < ApplicationController
student_work.save
end
end
- respond_to do |format|
- format.html{
- if params[:student_path]
- redirect_to student_work_index_url(:homework => @homework.id)
- else
- redirect_to user_homeworks_user_path(User.current.id)
- end
- }
+ if params[:student_path]
+ redirect_to student_work_index_url(:homework => @homework.id)
+ else
+ @user_activity_id = params[:user_activity_id]
+ @is_in_course = params[:is_in_course]
+ respond_to do |format|
+ format.js
+ end
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 6d049783e..7c41dd038 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -949,10 +949,19 @@ class UsersController < ApplicationController
when "current_user"
@user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10)
else
- @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
+ blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
+ @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
+ "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
+ "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
+ "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
end
else
- @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
+ # @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
+ blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
+ @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
+ "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
+ "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
+ "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
end
# @user_activities = paginateHelper @user_activities,500
@type = params[:type]
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 7289d534b..84364b4f6 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2355,16 +2355,16 @@ module ApplicationHelper
else #学生显示提交作品、修改作品等按钮
work = cur_user_works_for_homework homework
if work.nil?
- link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
+ link_to "提交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue'
else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
link_to "匿评结束", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "匿评已结束"
elsif homework.homework_type == 2 #编程作业不能修改作品
- link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
+ link_to "修改作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue'
else
- link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue'
+ link_to "修改作品(#{homework.student_works.count})", edit_student_work_path(work.id),:class => 'c_blue'
end
end
end
diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb
index 92970b663..9bb28ddd8 100644
--- a/app/models/blog_comment.rb
+++ b/app/models/blog_comment.rb
@@ -7,7 +7,8 @@ class BlogComment < ActiveRecord::Base
acts_as_tree :counter_cache => :comments_count, :order => "#{BlogComment.table_name}.sticky desc ,#{BlogComment.table_name}.created_on ASC"
acts_as_attachable
belongs_to :last_reply, :class_name => 'BlogComment', :foreign_key => 'last_comment_id'
-
+ # 虚拟关联
+ has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
acts_as_watchable
validates_presence_of :title, :content
@@ -15,6 +16,31 @@ class BlogComment < ActiveRecord::Base
#validate :cannot_reply_to_locked_comment, :on => :create
safe_attributes 'title', 'content',"sticky", "locked"
+ after_save :add_user_activity
+ before_destroy :destroy_user_activity
+
+ #在个人动态里面增加当前动态
+ def add_user_activity
+ if self.parent_id.nil? #只有发博文才插入动态
+ user_activity = UserActivity.where("act_type = '#{self.class.to_s}' and act_id = '#{self.id}'").first
+ if user_activity
+ user_activity.save
+ else
+ user_activity = UserActivity.new
+ user_activity.act_id = self.id
+ user_activity.act_type = self.class.to_s
+ user_activity.container_type = "Blog"
+ user_activity.container_id = self.blog_id
+ user_activity.user_id = self.author_id
+ user_activity.save
+ end
+ end
+ end
+
+ def destroy_user_activity
+ user_activity = UserActivity.where("act_type = '#{self.class.to_s}' and act_id = '#{self.id}'")
+ user_activity.destroy_all
+ end
def deleted_attach_able_by? user
(user && user.logged? && (self.author == user) ) || user.admin?
end
diff --git a/app/views/blog_comments/reply.js.erb b/app/views/blog_comments/reply.js.erb
index 7ebe4d077..f8ed4bb24 100644
--- a/app/views/blog_comments/reply.js.erb
+++ b/app/views/blog_comments/reply.js.erb
@@ -1,2 +1,7 @@
+<% if @in_user_center%>
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
+ init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+<% else%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
\ No newline at end of file
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+<% end %>
\ No newline at end of file
diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb
index 943d21852..33a3201c0 100644
--- a/app/views/blogs/_article.html.erb
+++ b/app/views/blogs/_article.html.erb
@@ -1,10 +1,36 @@
-
-
+
+
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
-
+ <% if activity.author.id == User.current.id%>
+
+
+
+
+
+ <%= link_to(
+ l(:button_edit),
+ {:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
+ :class => 'postOptionLink'
+ ) if User.current && User.current.id == activity.author.id %>
+
+
+ <%= link_to(
+ l(:button_delete),
+ {:controller => 'blog_comments',:action => 'destroy',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
+ :method => :delete,
+ :data => {:confirm => l(:text_are_you_sure)},
+ :class => 'postOptionLink'
+ ) if User.current && User.current.id == activity.author.id %>
+
+
+
+
+
+ <%end%>
+
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %>
@@ -13,6 +39,7 @@
TO
<%= link_to activity.blog.name+" | 博客", user_blogs_path(:user_id=>activity.author_id,:host=>Setting.host_user), :class => "newsBlue ml15 mr5"%>
+
<% if activity.parent_id.nil? %>
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey" %>
diff --git a/app/views/courses/join_private_courses.js.erb b/app/views/courses/join_private_courses.js.erb
index 8a1680030..0c44770bd 100644
--- a/app/views/courses/join_private_courses.js.erb
+++ b/app/views/courses/join_private_courses.js.erb
@@ -1,3 +1,4 @@
+$('#topnav_course_menu').hide();
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>');
showModal('ajax-modal', '540px');
$('#ajax-modal').css('height','390px');
diff --git a/app/views/homework_common/_set_evalutation_att.html.erb b/app/views/homework_common/_set_evalutation_att.html.erb
index 01d9351ee..d51713e9a 100644
--- a/app/views/homework_common/_set_evalutation_att.html.erb
+++ b/app/views/homework_common/_set_evalutation_att.html.erb
@@ -7,7 +7,7 @@
开启匿评
- <%= calendar_for('evaluation_start_time')%>
+ <%#= calendar_for('evaluation_start_time')%>
@@ -18,7 +18,7 @@
关闭匿评
- <%= calendar_for('evaluation_end_time')%>
+ <%#= calendar_for('evaluation_end_time')%>
diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb
index 5ff42dff7..a3afb0c9a 100644
--- a/app/views/homework_common/score_rule_set.js.erb
+++ b/app/views/homework_common/score_rule_set.js.erb
@@ -1,4 +1,4 @@
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false}) %>');
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:remote=>true}) %>');
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("
" +
diff --git a/app/views/homework_common/start_evaluation_set.js.erb b/app/views/homework_common/start_evaluation_set.js.erb
index 9d494f908..aac4ecd66 100644
--- a/app/views/homework_common/start_evaluation_set.js.erb
+++ b/app/views/homework_common/start_evaluation_set.js.erb
@@ -1,6 +1,10 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>');
+var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
" ");
-$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
\ No newline at end of file
+$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
+$(function() { $('#evaluation_start_time').datepicker(datepickerOptions);
+ $('#evaluation_end_time').datepicker(datepickerOptions);
+});
\ 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 9b1dfbb7f..04d16a334 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -54,15 +54,16 @@
-
-
+
+
<%= @course.name %>
<% if @course.is_public == 0%>
-
+
<%= l(:field_is_private)%>
<% end %>
+
diff --git a/app/views/student_work/set_score_rule.js.erb b/app/views/student_work/set_score_rule.js.erb
new file mode 100644
index 000000000..ff3a0e7ed
--- /dev/null
+++ b/app/views/student_work/set_score_rule.js.erb
@@ -0,0 +1,8 @@
+clickCanel();
+<% if @user_activity_id %>
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id}) %>");
+ init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+<% else %>
+ $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
+ init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index 70494192d..aa0344800 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -56,28 +56,31 @@
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
- <%# if is_teacher%>
-
+ <% end%>
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index b7981bdbc..f4ddcc050 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -92,6 +92,13 @@
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
<% end %>
<% end %>
+ <% when 'Blog'%>
+ <%if act %>
+ <% case user_activity.act_type.to_s %>
+ <% when 'BlogComment' %>
+ <%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
+ <% end %>
+ <% end %>
<% end %>
<% else %>
<%= render :partial => 'project_create', :locals => {:activity => user_activity,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb
new file mode 100644
index 000000000..c1219eb25
--- /dev/null
+++ b/app/views/users/_user_blog.html.erb
@@ -0,0 +1,119 @@
+
+
+
+ <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
+
+
+
+ <% if @ctivity.try(:author).try(:realname) == ' ' %>
+ <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% else %>
+ <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% end %> TO
+ <%= link_to activity.author.name.to_s+" | 博客", user_blogs_path(:user_id=>activity.author_id), :class => "newsBlue ml15" %>
+
+
+
+ <%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id), :class => "postGrey" %>
+
+ <% if activity.sticky == 1%>
+
置顶
+ <% end%>
+ <% if activity.locked%>
+
+ <% end%>
+
+
+
+
+ 发布时间:<%= format_time(activity.created_on) %>
+
+
+
+ <%= activity.content.html_safe %>
+
+
+
+
+
+
+
+
+
+ <% count=activity.children.count %>
+
+
+
+
+ 回复(<%= count %>)
+
+
<%#= format_date(activity.updated_on) %>
+ <%if count>3 %>
+
+ <% end %>
+
+
+ <% replies_all_i = 0 %>
+ <% if count > 0 %>
+
+
+ <% activity.children.reorder("created_on desc").each do |comment| %>
+
+ <% replies_all_i = replies_all_i + 1 %>
+
+
+ <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
+
+
+
+ <% if comment.try(:author).try(:realname) == ' ' %>
+ <%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= format_time(comment.created_on) %>
+
+
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+ <% if activity.locked == false && User.current.logged?%>
+
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
+
+
+ <%= form_for('new_form',:url => {:controller => 'blog_comments', :action => 'reply', :user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id},:method => "post", :remote => true) do |f|%>
+
+
+
+
+
+
+
+
+
发送
+
+
+ <% end%>
+
+
+
+
+
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb
index 4570f365c..25f14ab31 100644
--- a/app/views/users/_user_homework_detail.html.erb
+++ b/app/views/users/_user_homework_detail.html.erb
@@ -69,7 +69,7 @@
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
- <%= link_to("评分设置", score_rule_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) %>
+ <%= link_to("评分设置", score_rule_set_homework_common_path(homework_common, :is_in_course => is_in_course),:class => "postOptionLink", :remote => true) %>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) if homework_common.homework_detail_manual.comment_status == 1%>
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index afbeb5ed5..ed0147be8 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -503,4 +503,64 @@
<%= time_tag(ma.created_at).html_safe %>
<% end %>
+
+
+ <% if ma.course_message_type == "JoinCourse" %>
+
+
+ <%=link_to image_tag(url_to_avatar(User.find(ma.course_message_id)), :width => "30", :height => "30"), user_path(ma.course_message_id) %>
+
+
+ <%=link_to User.find(ma.course_message_id), user_path(User.find(ma.course_message_id)), :class => "newsBlue homepageNewsPublisher" %>
+ ">将您加入了课程:
+
+
+ <%= link_to ma.course.name, course_member_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+ <% if ma.course.is_public? || User.current.member_of_course?(ma.course) || User.current.admin? %>
+
课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
+
课程描述:<%= ma.course.description.blank? ? '无':ma.course.description %>
+
课时总数:<%= ma.course.class_period %>
+ <% else %>
+
+ 您已经被移出该私有课程,非课程成员没有权限访问私有课程
+
+ <% end %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+
+
+ <% if ma.course_message_type == "RemoveFromCourse" %>
+
+
+ <%=link_to image_tag(url_to_avatar(User.find(ma.course_message_id)), :width => "30", :height => "30"), user_path(ma.course_message_id) %>
+
+
+ <%=link_to User.find(ma.course_message_id), user_path(User.find(ma.course_message_id)), :class => "newsBlue homepageNewsPublisher" %>
+ ">将您移出了课程:
+
+
+ <%= link_to ma.course.name, member_course_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+ <% if ma.course.is_public? || User.current.member_of?(ma.course) || User.current.admin? %>
+
课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
+
课程描述:<%= ma.course.description.blank? ? '无' : ma.course.description %>
+
学时总数:<%= ma.course.class_period %>
+ <% else %>
+
+ 您已经被移出该私有课程,非课程成员没有权限访问私有课程
+
+ <% end %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
<% end %>
\ No newline at end of file
diff --git a/app/views/users/_user_message_system.html.erb b/app/views/users/_user_message_system.html.erb
index efbd5d76b..e3037f227 100644
--- a/app/views/users/_user_message_system.html.erb
+++ b/app/views/users/_user_message_system.html.erb
@@ -2,7 +2,7 @@
<%# @user_system_messages.each do |usm| %>
- <%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %>
+ <%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
Trustie平台 发布新消息:
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index fc87bd3a0..2805c4379 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -1,3 +1,4 @@
+