Merge branch 'develop' into hjq_new_course

This commit is contained in:
huang 2016-01-18 08:55:35 +08:00
commit 8b815f95bb
31 changed files with 471 additions and 142 deletions

View File

@ -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

View File

@ -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

View File

@ -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) %>
<div class="subNav">
<%= 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 %>
</div>
<% end %>
<% if show_nav?(@course.news.count) %>
<div class="subNav">
<%= 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 %>
</div>
<% end %>
<% if show_nav?(course_file_num) %>
<div class="subNav">
<%= 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)) %>
<!--link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white')-->
<a class="courseMenuSetting" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();"> </a>
@ -23,25 +23,25 @@
<% end %>
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<div class="subNav">
<%= 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 %>
</div>
<% end %>
<% if show_nav?(course_feedback_count) %>
<div class="subNav">
<%= 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"%>
</div>
<% end %>
<% if show_nav?(course_poll_count) %>
<div class="subNav">
<%= 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 %>
</div>
<% end %>
<% if show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status=2").count) %>
<div class="subNav">
<%= 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 %>
</div>
<% end %>

View File

@ -71,7 +71,7 @@
<a href="javascript:void(0)" class="grey_btn fl ml10" onclick="nh_reset_form();" >清空</a>
</div><!--problem_search end-->
<%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %>
<p class="problem_p fl" ><%= l(:label_issues_sum) %><a href="javascript:void(0)" class="c_red"><%= @project.issues.visible.all.count %></a>
<p class="problem_p fl" ><%= l(:label_issues_sum) %><a href="javascript:void(0)" class="c_red"><%= @project.project_score.issue_num %></a>
<%= l(:lable_issues_undo) %><a href="javascript:void(0)" class="c_red"><%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> </a>
</p>

View File

@ -102,9 +102,9 @@
</div>
<div class="navHomepageNews">
<%= 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 %>
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive" %></div>
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %></div>
<% end %>
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
</div>

View File

@ -98,7 +98,7 @@
<% unless show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<div class="subNav">
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{@course.boards.first ? @course.boards.first.topics.count : 0})", course_boards_path(@course), :class => "subnav_num c_orange" %>
<%= link_to "(#{@course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0})", course_boards_path(@course), :class => "subnav_num c_orange" %>
<%= 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 %>
</div>
<% end %>
@ -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 %>
<div class="subNav subNav_jiantou" id="expand_tools_expand" nhtype="toggle4cookie" data-id="expand_tool_more" data-target="#navContentCourse" data-val="retract"><%= l(:label_project_more) %></div>
<div class="subNav subNav_jiantou" id="expand_tools_expand" nhtype="toggle4cookiecourse" data-id="expand_tool_more" data-target="#navContentCourse" data-val="retract"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContentCourse">
<%= render 'courses/tool_expand', :locals => {:is_teacher => is_teacher, :course_file_num => course_file_num} %>
</ul>

View File

@ -223,10 +223,16 @@
<% count=activity.journals_for_messages.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount">
回复(<%= count %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.user == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"></div>
<%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) %>
<span id="reply_praise_count_<%=comment.id %>">
<% if comment.user == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %>
</span>
<div id="message_edit_<%=comment.id %>" style="display: none" class="mr10 fr">
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
<% end %>
</div>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>

View File

@ -72,11 +72,17 @@
<% count=activity.children.count%>
<% end %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count<=0 && !activity.locked ? '': 'none' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
<%= count %>
)</div>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count > 3 %>
<div class="homepagePostReplyBannerMore">
@ -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) %>
<span id="reply_praise_count_<%=reply.id %>">
<% if reply.author == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %>

View File

@ -44,10 +44,16 @@
</div>
<% count=activity.comments.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
回复(<%= count %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%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) %>
<span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div>

View File

@ -57,9 +57,17 @@
</div>
<% count = activity.journals.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(<%= count %></div>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<% if count > 3 %>
<div class="homepagePostReplyBannerMore">
@ -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) %>
<span id="reply_praise_count_<%=reply.id %>">
<% if reply.user == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<% if reply.details.any? %>

View File

@ -57,12 +57,17 @@
<% count=activity.children.count%>
<% end %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
<%=count %>
)</div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
<% 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) %>
<span id="reply_praise_count_<%=reply.id %>">
<% if reply.author == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %></div>

View File

@ -57,11 +57,17 @@
<% count=activity.children.count%>
<% end %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
<%=count %>
)</div>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
@ -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) %>
<span id="reply_praise_count_<%=reply.id %>">
<% if reply.author == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %></div>

View File

@ -54,13 +54,13 @@
<div class="cl"></div>
</div>
<div style="margin-left: 80px " id="check_desc_hint"></div>
<!--<div class="orgRow mb10"><span class="ml10">组织URL</span>-->
<!--<div class="w607 fr">http//-->
<!--<input type="text" name="organization[domain]" id="domain" value="<%#= @organization.domain%>" class="orgUrlInput" />-->
<!--.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;" onclick="apply_subdomain(<%#= @organization.id %>,$('#domain').val());">申请</a>-->
<!--<p class="c_green f12" id="apply_hint" ></p></div>-->
<!--&lt;!&ndash;class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 &ndash;&gt;-->
<!--</div>-->
<div class="orgRow mb10"><span class="ml10">组织URL</span>
<div class="w607 fr">http//
<input type="text" name="organization[domain]" id="domain" value="<%= @organization.domain%>" class="orgUrlInput" />
.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;" onclick="apply_subdomain(<%= @organization.id %>,$('#domain').val());">申请</a>
<p class="c_green f12" id="apply_hint" ></p></div>
<!--class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 -->
</div>
<div class="cl"></div>
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开&nbsp;: </span>
<input type="checkbox" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
@ -115,15 +115,15 @@
<p class="fontBlue fb mb5">新增栏目</p>
<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %>
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" />
<!--<div class="mb5">-->
<!--<p class="fontGrey3"><span class="fb">域名目录</span>用户自定义url可选</p>-->
<!--<%# if @organization.domain %>-->
<!--<span class="fl"><%#= @organization.domain %>.trustie.net/</span><input class="fl personalUrl ml3" type="text" name="sub_dir">-->
<!--<%# else %>-->
<!--<span class="fl">您还没有子域名,请先在左侧信息栏申请子域名</span>-->
<!--<%# end %>-->
<!--<div class="cl"></div>-->
<!--</div>-->
<div class="mb5">
<p class="fontGrey3"><span class="fb">域名目录</span>用户自定义url可选</p>
<% if @organization.domain %>
<span class="fl"><%= @organization.domain %>.trustie.net/</span><input class="fl personalUrl ml3" type="text" name="sub_dir">
<% else %>
<span class="fl">您还没有子域名,请先在左侧信息栏申请子域名</span>
<% end %>
<div class="cl"></div>
</div>
<ul class="orgAddRole">
<li class="fontGrey3 fb mb10">栏目类型</li>
<li class="fl mr15">

View File

@ -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? %>
<a href="<%= praise_tread_praise_plus_path({:obj_id=>activity.id,:obj_type=>activity.class,:user_activity_id=>user_activity_id,:type=>type })%>" data-remote="true" class="<%=type == 'reply'? 'fr' : 'ml15' %> likeButton" title="点赞" >
<span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></a>
<% else %>
<a href="<%= praise_tread_praise_minus_path({:obj_id=>activity.id,:obj_type=>activity.class,:user_activity_id=>user_activity_id,:type=>type })%>" data-remote="true" class="<%=type == 'reply'? 'fr' : 'ml15' %> likeButton" title="取消点赞" >
<span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></a>
<% end %>

View File

@ -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 %>

View File

@ -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}

View File

@ -44,10 +44,16 @@
</div>
<% count=activity.comments.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
回复(<%= count %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%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) %>
<span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div>

View File

@ -223,10 +223,16 @@
<% count=activity.journals_for_messages.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount">
回复(<%= count %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.user == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"></div>
<%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) %>
<div id="message_edit_<%=comment.id %>" style="display: none" class="fr">
<span id="reply_praise_count_<%=comment.id %>">
<% if comment.user == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %>
</span>
<div id="message_edit_<%=comment.id %>" style="display: none" class="mr10 fr">
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
<% end %>
</div>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>

View File

@ -22,7 +22,7 @@
<% end %>
</div>
<% if activity.sticky == 1%>
<span class="sticky_btn_cir ml10">置顶</span>
<span class="sticky_btn_cir ml10">置顶</span>
<% end%>
<% if activity.locked%>
<span class="locked_btn_cir ml10 fl" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
@ -92,11 +92,17 @@
<% count=activity.children.count%>
<% end %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count<=0 && !activity.locked ? '': 'none' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
<%= count %>
)</div>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count > 3 %>
<div class="homepagePostReplyBannerMore">
@ -114,9 +120,9 @@
<ul>
<% activity.children.reorder("created_on desc").each do |reply|%>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= reply.id %>');
});
$(function(){
showNormalImage('reply_content_<%= reply.id %>');
});
</script>
<% replies_all_i=replies_all_i+1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
@ -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) %>
<span id="reply_praise_count_<%=reply.id %>">
<% if reply.author == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %>
@ -144,26 +158,26 @@
<% end %>
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= 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|%>
<input type="hidden" name="quote[quote]" value="">
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= 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|%>
<input type="hidden" name="quote[quote]" value="">
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%>
<div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
</div>
</div>
<script type="text/javascript">

View File

@ -44,10 +44,16 @@
</div>
<% count=activity.comments.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
回复(<%= count %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%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) %>
<span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div>

View File

@ -69,9 +69,17 @@
</div>
<% count = activity.journals.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(<%= count %></div>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<% if count > 3 %>
<div class="homepagePostReplyBannerMore">
@ -105,6 +113,13 @@
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>">
<% if reply.user == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<% if reply.details.any? %>

View File

@ -91,9 +91,17 @@
<% count=activity.children.count%>
<% end %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(<%=count %>)</div>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
@ -124,6 +132,13 @@
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>">
<% if reply.author == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %></div>

View File

@ -226,10 +226,16 @@
<% count=homework_common.journals_for_messages.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount">
回复(<%= count %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=homework_common.id %>">
<% if homework_common.user == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(homework_common) > 0 ? "#{get_praise_num(homework_common)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>homework_common, :user_activity_id=>homework_common.id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
@ -263,8 +269,14 @@
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<div class="fr" id="message_edit_<%=comment.id %>" style="display: none">
<%= format_time(comment.created_on) %><span id="reply_praise_count_<%=comment.id %>">
<% if comment.user == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %>
</span>
<div id="message_edit_<%=comment.id %>" style="display: none" class="mr10 fr">
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course,:course_activity=>-1},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>

View File

@ -35,10 +35,16 @@
</div>
<% count=fetch_user_leaveWord_reply(activity).count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
回复(<%= count %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.user == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
@ -68,6 +74,13 @@
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<% if comment.user == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= user_activity_id %>">
<%= comment.notes.html_safe %>

View File

@ -0,0 +1,9 @@
class Subdomain
def matches?(request)
o = Organization.where(domain: request.subdomain).first
request.path_parameters[:id] = o.id if o
!o.nil?
end
end

View File

@ -73,12 +73,8 @@ RedmineApp::Application.routes.draw do
end
end
get '/', to: 'organizations#show', constraints:lambda{|request|Organization.where("domain is not null").map(&:domain).include?(request.subdomain)}
Organization.where("domain is not null").each do |org|
# org_domains = []
# org_domains << org.domain
get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: {subdomain: org.domain}
#get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: lambda{ |request| org_domains.include?(request.remote_ip) }
constraints(Subdomain.new) do
get '/', to: 'organizations#show'
end
get '/', to: 'organizations#show', defaults: { id: 5 }, constraints: {subdomain: 'micros'}
get '/', to: 'organizations#show', defaults: { id: 23 }, constraints: {subdomain: 'nubot'}
@ -393,6 +389,7 @@ RedmineApp::Application.routes.draw do
get "tags/show"
get "praise_tread/praise_plus"
get "praise_tread/praise_minus"
get "praise_tread/tread_plus"
#end

View File

@ -0,0 +1,32 @@
class UpdateBoardsAttach < ActiveRecord::Migration
def up
project_count = Project.all.count / 30 + 2
transaction do
for i in 1 ... project_count do i
Project.page(i).per(30).each do |project|
puts project.id
if ProjectScore.where("project_id=?", project.id).first.nil?
puts "create project ==>#{project.id}"
ProjectScore.create(:project_id => project.id, :score => false)
end
unless project.project_score.nil?
# update boards
unless project.boards.first.nil?
boards_count = project.boards.first.topics.count
project.project_score.update_attribute(:board_num, boards_count)
end
# update attach
unless project.attachments.nil?
attachments_count = project.attachments.count
project.project_score.update_attribute(:attach_num, attachments_count)
end
end
end
end
end
end
def down
end
end

View File

@ -0,0 +1,32 @@
class UpdateRepCommits < ActiveRecord::Migration
def up
project_count = Project.all.count / 30 + 2
transaction do
for i in 1 ... project_count do i
Project.page(i).per(30).each do |project|
puts project.id
if ProjectScore.where("project_id=?", project.id).first.nil?
puts "create project ==>#{project.id}"
ProjectScore.create(:project_id => project.id, :score => false)
end
unless project.project_score.nil?
# update boards
unless project.gpid.nil?
g = Gitlab.client
begin
puts project.id
count = g.project(project.gpid).commit_count
rescue
logger.error("The project's rep is not exit!")
end
project.project_score.update_attribute(:changeset_num, count)
end
end
end
end
end
end
def down
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160114131753) do
ActiveRecord::Schema.define(:version => 20160115125217) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -1389,7 +1389,7 @@ $(function(){
var personalized_map = cookieget(personalized_expand_key);
if(personalized_map!=false){
personalized_map = JSON.parse(personalized_map);
$("*[nhtype='toggle4cookie']").each(function(){
$("*[nhtype='toggle4cookiecourse']").each(function(){
var personalized_id=$(this).data('id');
var val = personalized_map[personalized_id];
if(val!=undefined && val!=$(this).data('val')){
@ -1415,7 +1415,7 @@ $(function(){
cookiesave(personalized_expand_key,JSON.stringify(personalized_map));
target.toggle(timeout);
}
$("*[nhtype='toggle4cookie']").on('click',function(){
$("*[nhtype='toggle4cookiecourse']").on('click',function(){
personalized_click($(this),500);
});
@ -1428,3 +1428,7 @@ function submit_course_feedback() {
var flag = true
}
}
function show_more_tool(){
$('#navContentCourse').css('display', 'block');
}