diff --git a/app/controllers/praise_tread_controller.rb b/app/controllers/praise_tread_controller.rb
index acfd785d9..b99963e2f 100644
--- a/app/controllers/praise_tread_controller.rb
+++ b/app/controllers/praise_tread_controller.rb
@@ -5,39 +5,73 @@ class PraiseTreadController < ApplicationController
def praise_plus
@obj = nil
- # @is_in_list = nil
+ @activity = false
+
if request.get?
@obj_id = params[:obj_id]
@obj_type = params[:obj_type]
- @horizontal = params[:horizontal].downcase == "false" ? false:true
+ if !params[:user_activity_id].nil? && !params[:type].nil?
+ @user_activity_id = params[:user_activity_id]
+ @type = params[:type]
+ @activity = true
+ end
+ # @is_in_list = nil
@obj = find_object_by_type_and_id(@obj_type,@obj_id)
- unless @obj.author_id == User.current.id
+ pts = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?",@obj_id,@obj_type.to_s,User.current.id)
+ unless pts.empty?
+ respond_to do |format|
+ format.js
+ end
+ return
+ end
+ #@horizontal = params[:horizontal].downcase == "false" ? false:true
+ if @obj.respond_to?("author_id")
+ author_id = @obj.author_id
+ elsif @obj.respond_to?("user_id")
+ author_id = @obj.user_id
+ end
+ unless author_id == User.current.id
praise_tread_plus(@obj_type,@obj_id,1)
end
-
+ respond_to do |format|
+ format.js
+ end
end
end
def praise_minus
@obj = nil
+ @activity = false
if request.get?
- @obj = params[:obj] # 传的是对象,最后变成id了
-
+ #@obj = params[:obj] # 传的是对象,最后变成id了
#首先更新praise_tread 表 删除关注记录
- @pt = PraiseTread.find_by_user_id_and_praise_tread_object_id_and_praise_tread_object_type(User.current.id,@obj,"user")
- @pt.delete
-
+ #@pt = PraiseTread.find_by_user_id_and_praise_tread_object_id_and_praise_tread_object_type(User.current.id,@obj,"user")
+ @obj_id = params[:obj_id]
+ @obj_type = params[:obj_type]
+ if !params[:user_activity_id].nil? && !params[:type].nil?
+ @user_activity_id = params[:user_activity_id]
+ @type = params[:type]
+ @activity = true
+ end
+ @obj = find_object_by_type_and_id(@obj_type,@obj_id)
+ @pt = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?",@obj_id,@obj_type.to_s,User.current.id).first
+ if @pt.nil?
+ respond_to do |format|
+ format.js
+ end
+ return
+ end
+ @pt.delete if !@pt.nil?
#再更新praise_tread_cache表 使相应的记录减1 当为0时删除
- @ptc = PraiseTreadCache.find_by_object_id(@obj)
- @ptc.minus(1)
+ @ptc = PraiseTreadCache.where("object_id=? and object_type=?",@obj_id,@obj_type.to_s).first
+ @ptc.minus(1) if !@ptc.nil?
if @ptc.praise_num == 0
- @ptc.delete
+ @ptc.delete
end
end
- @obj = User.find_by_id(@obj)
+ #@obj = User.find_by_id(@obj)
respond_to do |format|
- format.html
format.js
end
end
@@ -48,7 +82,7 @@ class PraiseTreadController < ApplicationController
if request.get?
@obj_id = params[:obj_id]
@obj_type = params[:obj_type]
- @horizontal = params[:horizontal].downcase == "false" ? false:true
+ #@horizontal = params[:horizontal].downcase == "false" ? false:true
@obj = find_object_by_type_and_id(@obj_type,@obj_id)
unless @obj.author_id == User.current.id
praise_tread_plus(@obj_type,@obj_id,0)
@@ -83,6 +117,16 @@ class PraiseTreadController < ApplicationController
@obj = Memo.find_by_id(id)
when 'Message'
@obj = Message.find_by_id(id)
+ when 'HomeworkCommon'
+ @obj = HomeworkCommon.find_by_id(id)
+ when 'JournalsForMessage'
+ @obj = JournalsForMessage.find_by_id(id)
+ when 'News'
+ @obj = News.find_by_id(id)
+ when 'Comment'
+ @obj = Comment.find_by_id(id)
+ when 'Journal'
+ @obj = Journal.find_by_id(id)
end
return @obj
end
@@ -106,10 +150,6 @@ class PraiseTreadController < ApplicationController
@ptc.save
@ptc.plus(flag,1)
end
- respond_to do |format|
- format.html
- format.js
- end
end
end
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 0a9de787a..cafec1c62 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -122,8 +122,8 @@ class RepositoriesController < ApplicationController
if project.save
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r])
- if ProjectScore.where("project_id=?", @project.id).first.nil?
- ProjectScore.create(:project_id => @project.id, :score => false)
+ if ProjectScore.where("project_id=?", project.id).first.nil?
+ ProjectScore.create(:project_id => project.id, :score => false)
end
project_info = ProjectInfo.new(:user_id => User.current.id, :project_id => project.id)
user_grades = UserGrade.create(:user_id => User.current.id, :project_id => project.id)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index be9c59992..07f7a0ed8 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2792,7 +2792,7 @@ int main(int argc, char** argv){
g = Gitlab.client
project.gpid.nil? ? 0 : g.project(project.gpid).commit_count
# project.changesets.count
- end
+end
#课程动态的更新
def update_course_activity type, id
diff --git a/app/views/courses/_tool_expand.html.erb b/app/views/courses/_tool_expand.html.erb
index 50854cf23..3ded0cb1d 100644
--- a/app/views/courses/_tool_expand.html.erb
+++ b/app/views/courses/_tool_expand.html.erb
@@ -2,19 +2,19 @@
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<% if show_nav?(@course.homework_commons.count) %>
- <%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f14 c_blue02 ml10 fn"%>
+ <%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f12 c_blue02 ml10 fn"%>
<%= link_to( "", homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_course_homework_new)}") if is_teacher %>
<% end %>
<% if show_nav?(@course.news.count) %>
- <%= link_to l(:label_course_news), course_news_index_path(@course), :class => "f14 c_blue02 ml10 fn" %>
+ <%= link_to l(:label_course_news), course_news_index_path(@course), :class => "f12 c_blue02 ml10 fn" %>
<%= link_to( "", new_course_news_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
<% end %>
<% if show_nav?(course_file_num) %>
- <%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02 ml10 fn" %>
+ <%= link_to l(:label_course_file), course_files_path(@course), :class => "f12 c_blue02 ml10 fn" %>
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
@@ -23,25 +23,25 @@
<% end %>
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
- <%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02 ml10 fn" %>
+ <%= link_to l(:label_course_board), course_boards_path(@course), :class => "f12 c_blue02 ml10 fn" %>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}") if User.current.member_of_course?(@course) && @course.boards.first %>
<% end %>
<% if show_nav?(course_feedback_count) %>
- <%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f14 c_blue02 ml10 fn" %>
+ <%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f12 c_blue02 ml10 fn" %>
<%= link_to "", course_feedback_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%>
<% end %>
<% if show_nav?(course_poll_count) %>
- <%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => " f14 c_blue02 ml10 fn"%>
+ <%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => " f12 c_blue02 ml10 fn"%>
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'courseMenuSetting', :title =>"#{l(:label_new_poll)}") if is_teacher %>
<% end %>
<% if show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status=2").count) %>
- <%= link_to "在线测验", exercise_index_path(:course_id => @course.id), :class => " f14 c_blue02 ml10 fn"%>
+ <%= link_to "在线测验", exercise_index_path(:course_id => @course.id), :class => " f12 c_blue02 ml10 fn"%>
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'courseMenuSetting', :title =>"新建试卷") if is_teacher %>
<% end %>
\ No newline at end of file
diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb
index 86f007e82..424319889 100644
--- a/app/views/files/_org_subfield_list.html.erb
+++ b/app/views/files/_org_subfield_list.html.erb
@@ -17,6 +17,7 @@
私有
<%end %>
+
上传时间:<%= format_date(file.created_on)%>
diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb
index 7332f4892..31fb38cce 100644
--- a/app/views/files/_subfield_files.html.erb
+++ b/app/views/files/_subfield_files.html.erb
@@ -50,7 +50,7 @@
- <%#= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
+ <%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
共有 <%= @all_attachments.count %> 个资源
diff --git a/app/views/files/create.js.erb b/app/views/files/create.js.erb
index 49198e680..1d66c2955 100644
--- a/app/views/files/create.js.erb
+++ b/app/views/files/create.js.erb
@@ -60,9 +60,9 @@ $('#upload_file_div').slideToggle('slow');
$("#resource_list").html('<%= j(render partial: "subfield_files" ,locals: {org_subfield: @org_subfield}) %>');
// 添加文件上传成功提示,
<% unless params[:attachments].nil? %>
- var div = $('
文件上传成功!
');
- $("#org_subfield_list").prepend(div);
- setTimeout( function(){div.remove();},3000);
+// var div = $('
文件上传成功!
');
+// $("#org_subfield_list").prepend(div);
+// setTimeout( function(){div.remove();},3000);
<% end %>
<% end %>
<% end %>
diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb
index b28e6843f..48cd4ab53 100644
--- a/app/views/layouts/_logined_header.html.erb
+++ b/app/views/layouts/_logined_header.html.erb
@@ -102,9 +102,9 @@
- <%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon" %>
+ <%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank" %>
<% if User.current.count_new_message >0 %>
-
<%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive" %>
+
<%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %>
<% end %>
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index cb5c2502f..bef5b7f4a 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -126,7 +126,7 @@
<%# 工具栏展开 %>
<% if @course.homework_commons.count == 0 || @course.news.count == 0 || course_file_num == 0 || course_poll_count == 0 || @course.exercises.count == 0 ||
course_feedback_count == 0 || @course.exercises.count == 0 || (@course.boards.first ? @course.boards.first.topics.count : 0) == 0 %>
-
<%= l(:label_project_more) %>
+
<%= l(:label_project_more) %>
<%= render 'courses/tool_expand', :locals => {:is_teacher => is_teacher, :course_file_num => course_file_num} %>
diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb
index 5d4aebcf7..631385e22 100644
--- a/app/views/organizations/_org_course_homework.html.erb
+++ b/app/views/organizations/_org_course_homework.html.erb
@@ -223,10 +223,16 @@
<% count=activity.journals_for_messages.count %>
-
-
-
- 回复(<%= count %>)
+
+
回复
+ <%= count>0 ? "(#{count})" : "" %> ▪
+
+ <% if activity.user == User.current %>
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
+ <% end %>
+
<%if count>3 %>
@@ -261,6 +267,19 @@
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
+
+
diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb
index 93aa7a97b..55be0bf91 100644
--- a/app/views/organizations/_org_course_message.html.erb
+++ b/app/views/organizations/_org_course_message.html.erb
@@ -72,11 +72,17 @@
<% count=activity.children.count%>
<% end %>
-
-
-
回复(
- <%= count %>
- )
+
+
回复
+ <%= count>0 ? "(#{count})" : "" %> ▪
+
+ <% if activity.author == User.current %>
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
+ <% end %>
+
+
<%#=format_date(activity.updated_on)%>
<%if count > 3 %>
@@ -111,6 +117,13 @@
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
+
+ <% if reply.author == User.current %>
+ 赞 <%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
+ <% end %>
+
<%= reply.content.html_safe %>
diff --git a/app/views/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb
index 7926d2737..ddad08279 100644
--- a/app/views/organizations/_org_course_news.html.erb
+++ b/app/views/organizations/_org_course_news.html.erb
@@ -44,10 +44,16 @@
<% count=activity.comments.count %>
-
-
-
- 回复(<%= count %>)
+
+
回复
+ <%= count>0 ? "(#{count})" : "" %> ▪
+
+ <% if activity.author == User.current %>
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
+ <% end %>
+
<%#= format_date(activity.updated_on) %>
<%if count>3 %>
@@ -82,6 +88,13 @@
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
+
diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb
index 32b717896..9c1863992 100644
--- a/app/views/organizations/_org_project_issue.html.erb
+++ b/app/views/organizations/_org_project_issue.html.erb
@@ -57,9 +57,17 @@
<% count = activity.journals.count %>
-
-
-
回复(<%= count %>)
+
+
回复
+ <%= count>0 ? "(#{count})" : "" %> ▪
+
+ <% if activity.author == User.current %>
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
+ <% end %>
+
+
<%#= format_date(activity.updated_on) %>
<% if count > 3 %>
@@ -93,6 +101,13 @@
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
+
+ <% if reply.user == User.current %>
+ 赞 <%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
+ <% end %>
+
<% if reply.details.any? %>
diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb
index bc9e28de0..901c2ecf4 100644
--- a/app/views/organizations/_org_subfield_message.html.erb
+++ b/app/views/organizations/_org_subfield_message.html.erb
@@ -57,12 +57,17 @@
<% count=activity.children.count%>
<% end %>
-
-
-
回复(
- <%=count %>
- )
-
<%#=format_date(activity.updated_on)%>
+
+
回复
+ <%= count>0 ? "(#{count})" : "" %> ▪
+
+ <% if activity.author == User.current %>
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
+ <% end %>
+
+
<%if count>3 %>
<% end %>
@@ -92,6 +97,13 @@
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
+
+ <% if reply.author == User.current %>
+ 赞 <%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
+ <% end %>
+
<%= reply.content.html_safe %>
diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb
index 7e8746fc4..c7d99c5fb 100644
--- a/app/views/organizations/_project_message.html.erb
+++ b/app/views/organizations/_project_message.html.erb
@@ -57,11 +57,17 @@
<% count=activity.children.count%>
<% end %>
-
-
-
回复(
- <%=count %>
- )
+
+
回复
+ <%= count>0 ? "(#{count})" : "" %> ▪
+
+ <% if activity.author == User.current %>
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
+ <% end %>
+
+
<%#=format_date(activity.updated_on)%>
<%if count>3 %>
@@ -92,6 +98,13 @@
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
+
+ <% if reply.author == User.current %>
+ 赞 <%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
+ <% end %>
+
<%= reply.content.html_safe %>
diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb
index 10cf6fc00..b49436d4e 100644
--- a/app/views/organizations/_subfield_list.html.erb
+++ b/app/views/organizations/_subfield_list.html.erb
@@ -28,9 +28,15 @@
新增
<%= field.field_type == "Post" ? "帖子" : "资源" %>
-
- <%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
-
+ <% if @organization.domain %>
+
+ <%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
+
+ <% else %>
+
+ <%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
+
+ <% end %>
diff --git a/app/views/praise_tread/_praise.html.erb b/app/views/praise_tread/_praise.html.erb
index e69de29bb..4fd961251 100644
--- a/app/views/praise_tread/_praise.html.erb
+++ b/app/views/praise_tread/_praise.html.erb
@@ -0,0 +1,7 @@
+<% if PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?",activity.id,activity.class.to_s,User.current.id).empty? %>
+
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+<% else %>
+
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/praise_tread/praise_minus.js.erb b/app/views/praise_tread/praise_minus.js.erb
index ab298ba2e..b55624930 100644
--- a/app/views/praise_tread/praise_minus.js.erb
+++ b/app/views/praise_tread/praise_minus.js.erb
@@ -1,3 +1,11 @@
-$('#praise_tread').html('<%= j(
-render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:show_flag => false,:user_id => User.current.id,:horizontal=>@horizontal}
-)%>');
+<% if @activity %>
+ <% if @type.to_s == 'activity' %>
+ $('#praise_count_<%=@user_activity_id %>').html('<%= j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
+ <% else @type.to_s == 'reply' %>
+ $('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
+ <% end %>
+<% else %>
+ $('#praise_tread').html('<%= j(
+ render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:show_flag => false,:user_id => User.current.id,:horizontal=>@horizontal}
+ )%>');
+<% end %>
\ No newline at end of file
diff --git a/app/views/praise_tread/praise_plus.js.erb b/app/views/praise_tread/praise_plus.js.erb
index 30a53723e..29041cd57 100644
--- a/app/views/praise_tread/praise_plus.js.erb
+++ b/app/views/praise_tread/praise_plus.js.erb
@@ -2,6 +2,12 @@
$('#praise_tread_<%= @obj.id %>').html('<%= j(
render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
)%>');
+<% elsif @activity %>
+ <% if @type.to_s == 'activity' %>
+ $('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
+ <% else @type.to_s == 'reply' %>
+ $('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
+ <% end %>
<% else %>
$('#praise_tread_<%= @obj.id %>').html('<%= j(
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
diff --git a/app/views/projects/_project_news.html.erb b/app/views/projects/_project_news.html.erb
index a2809280e..2e7b1316a 100644
--- a/app/views/projects/_project_news.html.erb
+++ b/app/views/projects/_project_news.html.erb
@@ -44,10 +44,16 @@
<% count=activity.comments.count %>
-
-
-
- 回复(<%= count %>)
+
+
回复
+ <%= count>0 ? "(#{count})" : "" %> ▪
+
+ <% if activity.author == User.current %>
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
+ <% end %>
+
<%#= format_date(activity.updated_on) %>
<%if count>3 %>
@@ -82,6 +88,13 @@
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
+
diff --git a/app/views/tags/update_org_subfield_tag_name.js.erb b/app/views/tags/update_org_subfield_tag_name.js.erb
index 4fabc1afd..418d05363 100644
--- a/app/views/tags/update_org_subfield_tag_name.js.erb
+++ b/app/views/tags/update_org_subfield_tag_name.js.erb
@@ -8,4 +8,5 @@
<% else %>
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'files/org_subfield_list',
:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments}) %>");
+ $("#files_tag").html("<%= j(render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}) %>")
<% end %>
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index 66d348d98..81627f9d6 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -223,10 +223,16 @@
<% count=activity.journals_for_messages.count %>
-
-
-
- 回复(<%= count %>)
+
+
回复
+ <%= count>0 ? "(#{count})" : "" %> ▪
+
+ <% if activity.user == User.current %>
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
+ <% end %>
+
<%if count>3 %>
@@ -261,12 +267,20 @@
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
-
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb
index 21a3ff076..d8268d698 100644
--- a/app/views/users/_course_message.html.erb
+++ b/app/views/users/_course_message.html.erb
@@ -22,7 +22,7 @@
<% end %>
<% if activity.sticky == 1%>
-
置顶
+
置顶
<% end%>
<% if activity.locked%>
@@ -92,11 +92,17 @@
<% count=activity.children.count%>
<% end %>
-
-
-
回复(
- <%= count %>
- )
+
+
回复
+ <%= count>0 ? "(#{count})" : "" %> ▪
+
+ <% if activity.author == User.current %>
+ 赞 <%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
+ <% end %>
+
+
<%#=format_date(activity.updated_on)%>
<%if count > 3 %>
@@ -114,9 +120,9 @@
<% activity.children.reorder("created_on desc").each do |reply|%>
<% replies_all_i=replies_all_i+1 %>
@@ -131,6 +137,14 @@
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
+
+ <% if reply.author == User.current %>
+ 赞 <%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
+ <% end %>
+
+
<%= reply.content.html_safe %>
@@ -144,26 +158,26 @@
<% end %>
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
-
-
<%= 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=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => is_board,is_course=>is_course},:method => "post", :remote => true) do |f|%>
-
-
-
-
-
发送
+
+
<%= 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=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => is_board,is_course=>is_course},:method => "post", :remote => true) do |f|%>
+
+
+
+
+
发送
+
+
+ <% end%>
-
- <% end%>
+
+
+
-
-
-
-
- <% end %>
+ <% end %>