Merge branch 'develop' into 'develop'

课程相关bug修复;叠层回复的“回复”、“赞”的显隐



See merge request !32
This commit is contained in:
陈晓婷 2016-12-02 10:14:07 +08:00
commit 39258f4ac5
53 changed files with 401 additions and 265 deletions

View File

@ -175,8 +175,10 @@ class AdminController < ApplicationController
def courses
@name = params[:name].to_s.strip.downcase
if @name && @name != ""
@courses = Course.select{ |course| course.teacher && ((course.teacher.show_name).include?(@name) || course.name.include?(@name))}
@courses = @courses.sort{|x, y| y.created_at <=> x.created_at}
all_user_ids = Course.all.map{|course| course.tea_id}
user_str_ids = search_user_by_name all_user_ids, @name
user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")"
@courses = Course.where("tea_id in #{user_ids} or name like '%#{@name}%'").reorder("created_at desc")
else
@courses = Course.order('created_at desc')
end

View File

@ -14,17 +14,17 @@ class MemosController < ApplicationController
# layout 'base_memos'
def quote
@subject = @memo.subject
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
@content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)} <br/> &nbsp; "
@content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "</blockquote>\n\n<br/>"
@content = "<blockquote style='word-break: break-all;word-wrap: break-word;'>" << @content
#@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> "
#@content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
#@content_html = textilizable(@content)
@temp = Memo.new
@temp.content = @content
# @subject = @memo.subject
# @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
#
# @content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)} <br/> &nbsp; "
# @content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "</blockquote>\n\n<br/>"
# @content = "<blockquote style='word-break: break-all;word-wrap: break-word;'>" << @content
# #@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> "
# #@content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
# #@content_html = textilizable(@content)
# @temp = Memo.new
# @temp.content = @content
end
def new
@ -47,6 +47,8 @@ class MemosController < ApplicationController
@quote = params[:quote]
end
#unless params[:quote].nil?
# @quote = params[:quote][:quote]
#end
@ -55,6 +57,10 @@ class MemosController < ApplicationController
@memo.forum_id = params[:forum_id]
@memo.author_id = User.current.id
if params[:memo][:parent_id]
@memo.root_id = (Memo.find params[:memo][:parent_id]).root_id.nil? ? params[:memo][:parent_id].to_i : (Memo.find params[:memo][:parent_id]).root_id
end
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
@memo.content = @quote + @memo.content
respond_to do |format|
@ -111,32 +117,37 @@ class MemosController < ApplicationController
@memo = @memo.root # 取出楼主防止输入帖子id让回复作为主贴显示
@memo.update_column(:viewed_count, (@memo.viewed_count.to_i + 1))
page = params[:page]
if params[:r] && page.nil?
offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count
page = 1 + offset / pre_count
else
end
@reply_count = @memo.children.count
@reply_pages = Paginator.new @reply_count, pre_count, page
@replies = @memo.children.
includes(:author, :attachments).
reorder("#{Memo.table_name}.created_at DESC").
limit(@reply_pages.per_page).
offset(@reply_pages.offset).
all
# page = params[:page]
# if params[:r] && page.nil?
# offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count
# page = 1 + offset / pre_count
# else
# end
# @reply_count = @memo.children.count
# @reply_pages = Paginator.new @reply_count, pre_count, page
# @replies = @memo.children.
# includes(:author, :attachments).
# reorder("#{Memo.table_name}.created_at DESC").
# limit(@reply_pages.per_page).
# offset(@reply_pages.offset).
# all
@replies = Memo.where("root_id = #{@memo.id}").reorder("created_at desc")
@reply_count = @replies.count
@replies = get_no_children_comments_all @replies
@limit_count = @replies.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@replies = @replies[@page * @limit..@page * @limit + 9]
@memo_new = Memo.new
@my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is null").count
@my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is not null").count
# @memo = Memo.find_by_id(params[:id])
# @forum = Forum.find(params[:forum_id])
# @replies = @memo.replies
# @mome_new = Memo.new
respond_to do |format|
format.js
format.html {render :layout=> 'base_forums'}#:layout=> 'base_forums',
format.json { render json: @memo }
format.xml { render xml: @memo }

View File

@ -164,6 +164,8 @@ class UsersController < ApplicationController
@comment = Comment.find params[:comment].to_i
when 'Journal','is_project_issue'
@comment = Journal.find params[:comment].to_i
when 'Memo'
@comment = Memo.find params[:comment].to_i
end
@user_activity_id = params[:user_activity_id]
@parent_id = params[:parent_id] if params[:parent_id]
@ -308,6 +310,15 @@ class UsersController < ApplicationController
@root.update_column('updated_at', Time.now)
@count = @root.journals_for_messages.count
@comments = @root.journals_for_messages.reorder("created_on desc").limit(3)
when 'Memo'
@root = reply.root
comment = Memo.new
comment.author = User.current
comment.forum = reply.forum
comment.content = params[:reply_message]
comment.subject = "#{@root.subject}"
comment.root_id = reply.root_id
reply.children << comment
end
update_course_activity(@root.class.to_s,@root.id)
update_user_activity(@root.class.to_s,@root.id)

View File

@ -3422,6 +3422,8 @@ def get_reply_by_type type, reply_id
reply = Journal.find reply_id
when 'Syllabus'
reply = JournalsForMessage.find reply_id
when 'Memo'
reply = Memo.find reply_id
end
reply
end

View File

@ -79,7 +79,8 @@ class Memo < ActiveRecord::Base
"lock",
"sticky",
"parent_id",
"replies_count"
"replies_count",
"root_id"
after_create :add_author_as_watcher, :reset_counters!, :send_message,:create_memo_ealasticsearch_index
after_update :update_memo_ealasticsearch_index
@ -126,6 +127,18 @@ class Memo < ActiveRecord::Base
Mailer.run.forum_message_added(self) if Setting.notified_events.include?('forum_message_added')
end
def creator_user
self.author
end
def created_time
self.created_on
end
def content_detail
self.content
end
# 公共贴吧消息记录
# 原则贴吧创始人发帖人wanglingchun特殊用户
def send_message

View File

@ -19,7 +19,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">

View File

@ -1,4 +1,5 @@
<% unless contributor_course_scor(course.id).count == 0 %>
<% count = contributor_course_scor(course.id).select{|ccs| ccs.con_score != 0 && !ccs.con_score.nil?}.count %>
<% unless count == 0 %>
<div>
<ul class="rankList">
<h3 style="font-size: 14px; font-weight: normal;">

View File

@ -25,7 +25,7 @@
<div class="ping_disfoot f14">
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span id="reply_praise_count_<%=journal.id %>">
<span class="reply_praise_count_<%=journal.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
</span>
<% if reply_allow %>

View File

@ -1,5 +1,9 @@
hideModal();
$("#member_li_<%=params[:member_id] %>").html("");
var all_indexes = $("#member_li_<%=params[:member_id] %>").nextAll().find("td:first-child");
for(var i = 0; i < all_indexes.length; i++){
$(all_indexes[i]).html(parseInt($(all_indexes[i]).html()) - 1);
}
$("#member_li_<%=params[:member_id] %>").remove();
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
$("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>");
$("#student_number").html("<%= studentCount(@course) %>");

View File

@ -1,20 +1,8 @@
<div class="sy_class_r sy_class_nobg fr ml10">
<div class="sy_class_r_head mb10">
<h3>学生列表(<%=@group.name %></h3>
<div class="hw_more_box">
<ul>
<li class="hw_more_icons">
<ul class="hw_more_txt">
<li><%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:group_id => @group.id ,:format => 'xls'), :class => 'hw_more_li'%></li>
<% if @canShowCode %>
<li>
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'hw_more_li' %>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
<h3 class="fl">学生列表(<%=@group.name %></h3>
<%= link_to "导出成绩", export_course_member_excel_course_path(@course,:group_id => @group.id ,:format => 'xls'), :class => 'link-blue fr mt5'%>
<div class="cl"></div>
</div>
<div class="sy_class_fenban clear">

View File

@ -17,7 +17,7 @@
<% if User.current.allowed_to?(:as_teacher,@course) %>
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'link-blue ml10 fr mt5' %>
<% end %>
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'link-blue fr mt5'%>
<%= link_to "导出成绩", export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'link-blue fr mt5'%>
<div class="cl"></div>
</div>
<%= render :partial => 'course_student', :locals => {:members => @members} %>

View File

@ -18,7 +18,8 @@
</div>
<div class="postDetailReply fr">
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
<% replies_count = Memo.where("root_id = #{topic.id}").count %>
<%= link_to (replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
</div>

View File

@ -24,7 +24,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= comment.id %>">
<span class="reply_praise_count_<%= comment.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">

View File

@ -147,7 +147,7 @@
<% end %>
<% elsif ma.class == OrgMessage %>
<% if ma.message_type == 'ApplySubdomain' && ma.organization %>
<li><a href="<%=agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%></a></li>
<li><a href="<%=organization_path(ma.organization_id) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= ma.content%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= ma.content%></a></li>
<% elsif ma.message_type == 'AgreeApplySubdomain' %>
<li><a href="javascript:void(0)" target="_blank" title="系统提示 管理员同意了您的子域名申请:<%= ma.content%>"><span class="shadowbox_news_user">系统提示 </span>管理员同意了您的子域名申请:<%= ma.content%></a></li>
<% end %>

View File

@ -7,13 +7,10 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %>
<%= import_ke(enable_at: false, prettify: true, init_activity: false) %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>

View File

@ -0,0 +1,77 @@
<% @replies.each do |reply| %>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= reply.id %> p,#activity_description_<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
postContent = postContent.replace(/<script>*/g, "<script>");
postContent = postContent.replace(/<html>*/g, "<html>");
$(this).html(postContent);
});
autoUrl('activity_description_<%= reply.id %>');
description_show_hide(<%= reply.id %>);
});
$(".homepagePostReplyDes").mouseover(function(){
$(this).find("a[id*='delete_memo_reply']").show();
}).mouseout(function(){
$(this).find("a[id*='delete_memo_reply']").hide();
});
</script>
<div class="homepagePostReplyContainer" >
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<div class="homepagePostReplyPublisher">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Memo', :user_activity_id => @memo.id}%>
</div>
<div class="homepagePostReplyContent break_word" style="margin-bottom:15px;" id="activity_description_<%= reply.id %>">
<p><%= reply.content.gsub(/script/, "script&nbsp").html_safe %></p>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span class="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
forum_memo_path(@memo.forum, reply),
:method => :delete,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if @memo.author.id == User.current.id || User.current.admin? %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @limit_count > @page * @limit + 10 %>
<div id="more_memo_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', forum_memo_path(@memo.forum_id, @memo, :page => @page),:remote=>true %>
</div>
</div>
<% end %>

View File

@ -0,0 +1,31 @@
<div class="ReplyToMessageContainer borderBottomNone" id="reply_to_message_<%= reply.id%>">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>">
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
</div>
<div class="ReplyToMessageInputContainer mb10">
<% if User.current.logged? %>
<div nhname='new_message_<%= reply.id%>'>
<%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%>
<%= f.hidden_field :subject, :required => true, value: reply.subject %>
<%= f.hidden_field :forum_id, :required => true, value: reply.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: reply.id %>
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<div nhname='toolbar_container_<%= reply.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="memo[content]"></textarea>
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= reply.id%>'></p>
<% end%>
</div>
<% else %>
<%= render :partial => "users/show_unlogged" %>
<% end %>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<script>
$(function(){
sd_create_editor_from_data(<%= reply.id%>,null,"100%", "<%=reply.class.to_s%>");
});
</script>

View File

@ -1,5 +1,5 @@
//ckeditor.setData("<%= raw escape_javascript(@content) %>");
$('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>");
$('#quote').val("<%= raw escape_javascript(@content) %>");
showAndScrollTo("new_memo", "cke_editor01");
$("img").removeAttr("align");
if($("#reply_message_<%= @memo.id%>").length > 0) {
$("#reply_message_<%= @memo.id%>").replaceWith("<%= escape_javascript(render :partial => 'memos/reply_message', :locals => {:reply => @memo}) %>");
}else if($("#reply_to_message_<%= @memo.id%>").length >0) {
$("#reply_to_message_<%= @memo.id%>").replaceWith("<p id='reply_message_<%= @memo.id%>'></p>");
}

View File

@ -4,22 +4,6 @@
<% end %>
<script>
function expand_reply(container,btnid){
var target = $(container).children();
var btn = $(btnid);
if(btn.data('init')=='0'){
btn.data('init',1);
btn.html('收起回复');
target.show();
}else{
btn.data('init',0);
btn.html('展开更多');
target.hide();
target.eq(0).show();
target.eq(1).show();
target.eq(2).show();
}
}
$(function() {
sd_create_editor_from_data(<%= @memo.id%>,null,"100%", "<%=@memo.class.to_s%>");
});
@ -82,46 +66,8 @@
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %></div>
<div class="homepagePostReplyBannerTime"></div>
</div>
<div class="" id="reply_div_<%= @memo.id %>">
<% @replies.each_with_index do |reply,i| %>
<div class="homepagePostReplyContainer" >
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.show_name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent break_word" style="margin-bottom:25px;" id="activity_description_<%= reply.id %>"><p><%= reply.content.gsub(/script/, "script&nbsp").html_safe %></p>
<% if @memo.author.id == User.current.id || User.current.admin? %>
<%= link_to "删除", forum_memo_path(@memo.forum, reply), :class => "fr undis", :method => "delete", :confirm => l(:text_are_you_sure), :id => "delete_memo_reply_#{reply.id}" %>
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= reply.id %> p,#activity_description_<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
postContent = postContent.gsub(/<script>*/, "<script>");
postContent = postContent.gsub(/<html>*/, "<html>");
$(this).html(postContent);
});
autoUrl('activity_description_<%= reply.id %>');
description_show_hide(<%= reply.id %>);
});
$(".homepagePostReplyDes").mouseover(function(){
$(this).find("a[id*='delete_memo_reply']").show();
}).mouseout(function(){
$(this).find("a[id*='delete_memo_reply']").hide();
});
</script>
<div class="cl"></div>
</div>
<% end %>
<div class="" id="reply_div_<%= @memo.id %>">
<%= render :partial => 'memos/memo_all_replies' %>
</div>
<div class="cl"></div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">

View File

@ -0,0 +1 @@
$("#more_memo_replies").replaceWith("<%= escape_javascript(render :partial => 'memos/memo_all_replies')%>");

View File

@ -18,7 +18,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<span class="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">

View File

@ -18,7 +18,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<span class="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">

View File

@ -18,7 +18,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<span class="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">

View File

@ -19,7 +19,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">

View File

@ -20,7 +20,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">

View File

@ -356,7 +356,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">

View File

@ -112,7 +112,7 @@
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>">
<span class="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span>
</div>

View File

@ -81,7 +81,7 @@
<%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>

View File

@ -92,7 +92,7 @@
<%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>">
<span class="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span>
</div>

View File

@ -91,7 +91,7 @@
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>">
<span class="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span>
</div>

View File

@ -2,7 +2,7 @@
<% 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"})%>');
$('.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(

View File

@ -1,13 +1,13 @@
<% if @obj_type == 'Memo'%>
$('#praise_tread_<%= @obj.id %>').html('<%= j(
render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
)%>');
<% elsif @activity %>
<% 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"})%>');
$('.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 %>
<% elsif @obj_type == 'Memo'%>
$('#praise_tread_<%= @obj.id %>').html('<%= j(
render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
)%>');
<% 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

@ -1,7 +1,7 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div>
<div class="orig_right fl">
<div class="orig_right fl" style="width: 93%;" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content ">
@ -16,10 +16,10 @@
<%= comment.content_detail.html_safe %>
<% end %>
</div>
<div class="orig_reply mt-10">
<div class="orig_reply mt-10 pr" style="height: 18px;">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<div class="reply-right none" style="position: absolute; right: 0px;">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">
@ -31,7 +31,7 @@
:title => l(:button_reply)) %>
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
</span>
</span>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -16,7 +16,7 @@
</div>
<div class="ping_disfoot f14">
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span id="reply_praise_count_<%=journal.id %>">
<span class="reply_praise_count_<%=journal.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
</span>
<% if journal.user == User.current|| User.current.admin? %>

View File

@ -1,7 +1,7 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div>
<div class="orig_right fl">
<div class="orig_right fl" style="width: 93%;" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content ">
@ -16,13 +16,13 @@
<%= comment.content_detail.html_safe %>
<% end %>
</div>
<div class="orig_reply mt-10">
<div class="orig_reply mt-10 pr" style="height: 18px;">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<div class="reply-right none" style="position: absolute; right: 0px;">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">
<span class="fr mr20">
<%= link_to(
l(:button_reply),
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => 'Issue', :user_activity_id => user_activity_id, :parent_id => parent_id, :is_project => true},
@ -31,7 +31,7 @@
:title => l(:button_reply)) %>
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
</span>
</span>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -29,7 +29,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= comment.id %>">
<span class="reply_praise_count_<%= comment.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %>
</span>

View File

@ -20,7 +20,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>

View File

@ -29,7 +29,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= comment.id %>">
<span class="reply_praise_count_<%= comment.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">

View File

@ -27,7 +27,21 @@
<div class="flex-cell student_work_<%= st.id%>">
<div class="<%= score_color st.student_score%> student_score_info pr">
<% if st.student_score.nil? %>
<span title="该作品未被匿评">未参与</span>
<% pro = @homework.student_work_projects.where("user_id = #{st.user_id}").first
if pro.nil? || pro.student_work_id == "" || pro.student_work_id.nil?
work = st
else
work = StudentWork.find pro.student_work_id
end %>
<% if @homework.homework_detail_manual.comment_status < 2 %>
<span title="尚未开启匿评">未参与</span>
<% elsif @homework.homework_detail_manual.comment_status == 2 && work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评期间,尚未获得他人匿评">待匿评</span>
<% elsif @homework.homework_detail_manual.comment_status == 3 && work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评已截止,未获得他人匿评">未评分</span>
<% else %>
<span title="匿评开启后提交的作品,不参加匿评">迟交</span>
<% end %>
<% else %>
<%= format("%.1f", st.student_score) %>
<% end %>

View File

@ -69,7 +69,19 @@
<% if @homework.anonymous_comment == 0%>
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info pr">
<% if student_work.student_score.nil? %>
<span title="该作品未被匿评">未参与</span>
<% if student_work.work_status != 0 %>
<% if @homework.homework_detail_manual.comment_status < 2 %>
<span title="尚未开启匿评">未参与</span>
<% elsif @homework.homework_detail_manual.comment_status >= 2 && student_work.student_works_evaluation_distributions.count == 0 %>
<span title="匿评开启后提交的作品,不参加匿评">迟交</span>
<% elsif @homework.homework_detail_manual.comment_status == 2 && student_work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评期间,尚未获得他人匿评">待匿评</span>
<% elsif @homework.homework_detail_manual.comment_status == 3 && student_work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评已截止,未获得他人匿评">未评分</span>
<% end %>
<% else %>
<span title="">--</span>
<% end %>
<% else %>
<%=format("%.1f",student_work.student_score) %>
<% end %>

View File

@ -23,7 +23,7 @@
<p class="list-info fr grayTxt">
<%= link_to project.members.count, allow_visit ? member_project_path(project) : 'javascript:void(0)', :class => "c_blue" %><span class="mr5">成员&nbsp;&nbsp;|</span>
<%= link_to project.project_score.issue_num, allow_visit ? project_issues_path(project) : 'javascript:void(0)', :class => "c_blue" %><span class="mr5">问题&nbsp;&nbsp;|</span>
<%= link_to project.project_score.attach_num, allow_visit ? file_project_path(project) : 'javascript:void(0)', :class => "c_blue" %><span>资源</span>
<%= link_to project.project_score.changeset_num, visible_repository?(project) ? ({:controller => 'repositories', :action => 'show', :id => project, :repository_id => gitlab_repository(project).try(:identifier)}) : 'javascript:void(0)', :class => "c_blue" %><span>提交</span>
</p>
</div>
</div>

View File

@ -51,37 +51,37 @@
// });
<%# end%>
function set_score_rule_submit() {
if($("#late_penalty_num").val() == ""){
$("#late_penalty_num").val("0");
}
if($("#absence_penalty_num").val() == ""){
$("#absence_penalty_num").val("0");
}
$('#muban_popup_box').find('form').submit();
hideModal();
}
// function set_score_rule_submit() {
// if($("#late_penalty_num").val() == ""){
// $("#late_penalty_num").val("0");
// }
// if($("#absence_penalty_num").val() == ""){
// $("#absence_penalty_num").val("0");
// }
// $('#muban_popup_box').find('form').submit();
// hideModal();
// }
//设置评分规则
function set_score_rule(){
<% if @homework.homework_type == 2 %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 570, 355);
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 500, 285);
<% end %>
<% else %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 500, 325);
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 500, 225);
<% end %>
<% end %>
}
// //设置评分规则
// function set_score_rule(){
<!--<%# if @homework.homework_type == 2 %>-->
<!--<%# if @homework.anonymous_comment == 0 %>-->
// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
// pop_box_new(htmlvalue, 570, 355);
<!--<%# else %>-->
// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
// pop_box_new(htmlvalue, 500, 285);
<!--<%# end %>-->
<!--<%# else %>-->
<!--<%# if @homework.anonymous_comment == 0 %>-->
// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
// pop_box_new(htmlvalue, 500, 325);
<!--<%# else %>-->
// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
// pop_box_new(htmlvalue, 500, 225);
<!--<%# end %>-->
<!--<%# end %>-->
// }
</script>
<div class="homepageRight mt0 ml10">
@ -118,10 +118,10 @@
<!--div class="hworkInfor"><a href="javascript:void(0);" class="linkBlue">作业信息</a></div-->
<% if @is_teacher%>
<div class="fr mt5">
<ul class="resourcesSelect">
<li class="resourcesSelected">
<a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="hworkMenu">
<ul class="">
<li class="pr export_icon_li">
<a href="javascript:void(0);" class="export_icon linkBlue2">导出</a>
<ul class="hworkMenu" style="top: 30px; left: -100px;">
<li>
<%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
</li>
@ -141,9 +141,6 @@
<%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
</li>
<% end %>
<li>
<a href="javascript:void(0);" class="hworkSetting resourcesGrey" onclick="set_score_rule();">评分设置</a>
</li>
</ul>
</li>
</ul>

View File

@ -1,7 +1,7 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user), :alt => "用户头像" %>
</div>
<div class="orig_right fl">
<div class="orig_right fl" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content">
@ -16,16 +16,16 @@
<%= comment.content_detail.html_safe %>
<% end %>
</div>
<div class="orig_reply mt-10">
<div class="orig_reply mt-10 pr" style="height: 18px;">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<div class="reply-right none" style="position: absolute; right: 0px;">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<% if type == 'Message' %>
<% topic = comment.root %>
<% if !topic.locked? && authorize_for('messages', 'reply') %>
<span style="position: relative" class="fr mr20">
<span class="fr mr20">
<%= link_to(
l(:button_reply),
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id},
@ -36,7 +36,7 @@
</span>
<% end %>
<% else %>
<span style="position: relative" class="fr mr20">
<span class="fr mr20">
<%= link_to(
l(:button_reply),
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id},
@ -46,7 +46,7 @@
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
</span>
<% end %>
</span>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -20,7 +20,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<% if type == 'Message' %>

View File

@ -29,7 +29,7 @@
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= comment.id %>">
<span class="reply_praise_count_<%= comment.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %>
</span>
<% if type == 'HomeworkCommon' %>

View File

@ -43,6 +43,8 @@ $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(re
window.location.href = "<%=org_document_comment_path(:id => @root.id, :organization_id => @root.organization.id) %>";
<% end %>
<% elsif @type == 'Syllabus' %>
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>");
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>");
<% elsif @type == 'Memo' %>
window.location.href = "<%=forum_memo_path(@root.forum_id, @root) %>";
<% end %>
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");

View File

@ -5,7 +5,7 @@
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'projects/journal_comment_reply', :locals => {:comment => @comment.parent, :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>");
<% elsif params[:type] == 'is_project_issue' %>
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => @comment.parent, :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>");
<% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' || @comment.class.to_s == 'OrgDocumentComment') %>
<% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' || @comment.class.to_s == 'OrgDocumentComment' || @comment.class.to_s == 'Memo') %>
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent, :type => params[:type], :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>");
<% else %>
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent, :type => params[:type], :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>");

View File

@ -36,7 +36,7 @@
<%= format_time reply.created_on %>
</span>
<div class="ping_disfoot" style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<span id="reply_praise_count_<%=reply.id %>">
<span class="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span>
<% if reply_allow %>

View File

@ -0,0 +1,26 @@
class AddRootIdToMemos < ActiveRecord::Migration
def change
add_column :memos, :root_id, :integer
add_index :memos, :root_id
def get_base_parent comment
comm = comment
while comm.parent
comm = comm.parent
end
comm
end
count = Memo.all.count / 30 + 2
transaction do
for i in 1 ... count do i
Memo.page(i).per(30).each do |memo|
unless memo.parent.nil?
parent = get_base_parent memo
memo.update_column('root_id', parent.id)
end
end
end
end
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 => 20161125024643) do
ActiveRecord::Schema.define(:version => 20161128072528) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -325,16 +325,14 @@ ActiveRecord::Schema.define(:version => 20161125024643) do
add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
create_table "changesets", :force => true do |t|
t.integer "repository_id", :null => false
t.string "revision", :null => false
t.integer "repository_id", :null => false
t.string "revision", :null => false
t.string "committer"
t.datetime "committed_on", :null => false
t.datetime "committed_on", :null => false
t.text "comments"
t.date "commit_date"
t.string "scmid"
t.integer "user_id"
t.integer "project_id"
t.integer "type", :default => 0
end
add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
@ -518,6 +516,20 @@ ActiveRecord::Schema.define(:version => 20161125024643) do
t.integer "container_id", :default => 0
end
create_table "course_class_post", :id => false, :force => true do |t|
t.integer "班级id", :default => 0, :null => false
t.string "班级名"
t.integer "帖子id", :default => 0, :null => false
t.integer "主贴id"
t.string "帖子标题", :default => "", :null => false
t.text "帖子内容"
t.integer "帖子用户id"
t.integer "帖子回复数", :default => 0, :null => false
t.integer "最后回帖id"
t.datetime "发帖时间", :null => false
t.datetime "帖子更新时间", :null => false
end
create_table "course_contributor_scores", :force => true do |t|
t.integer "course_id"
t.integer "user_id"
@ -996,10 +1008,6 @@ ActiveRecord::Schema.define(:version => 20161125024643) do
t.datetime "updated_at", :null => false
end
create_table "innodb_monitor", :id => false, :force => true do |t|
t.integer "a"
end
create_table "invite_lists", :force => true do |t|
t.integer "project_id"
t.integer "user_id"
@ -1211,8 +1219,11 @@ ActiveRecord::Schema.define(:version => 20161125024643) do
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count", :default => 0
t.integer "root_id"
end
add_index "memos", ["root_id"], :name => "index_memos_on_root_id"
create_table "message_alls", :force => true do |t|
t.integer "user_id"
t.integer "message_id"

View File

@ -3,39 +3,38 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>页面不见了</title>
<link type="text/css" rel="stylesheet" href="/stylesheets/css/common.css" />
<link type="text/css" rel="stylesheet" href="/stylesheets/css/public.css" />
<script src="/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>
<style>
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
div,img,tr,td{ border:0;}
table,tr,td{border:0 cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; }
a:hover{ }
.content{ width:550px; height:200px; margin:0 auto; padding:10px 0;}
.left{color:#15bccf; font-size:100px; font-weight:bold; font-style:oblique; width:200px; height:120px; padding-right:30px; float:left;}
.right{ width:240px; height:120px; float:left;color:#15bccf; font-size: 18px; font-weight:bold; padding-left:30px; margin-top:40px; border-left:1px dashed #CCC; }
.link{ margin-top:8px;}
.link a{ display:block; width:80px; height:30px; font-size:14px; font-weight:bold; color:#fff; text-align:center; background:#15bccf; float:left; margin-right:10px;}
.link a:hover{ background:#ff8417;}
</style>
<script type="text/javascript">
$(function(){
if(window.history.length == 1)
{
$("#history_back").css("color","#CCC");
$("#history_back").css("cursor","default");
}
});
</script>
</head>
<body>
<div class="content">
<div class="left">404</div>
<div class="right">
<p><span style="font-size:24px;">ERROR PAGE</span><br />
页面不见了!建议您</p>
<div class="link">
<!---<a href="http://forge.trustie.net/" target="_blank">返回首页</a>---->
<a href="#" target="_blank">后退一步</a>
<a href="http://user.trustie.net/users/5/user_newfeedback" target="_blank">给我留言</a>
</div>
<div class="muban_conbox_max">
<div class="pages_new_404">
<img src="/images/404/pic_404.jpg" >
<p class="pages_new_404_txt mt40">
非常抱歉,您访问的页面不存在或已删除。
<a href="javascript:history.back()" id="history_back" class="linkBlue2 mr10">返回上页>></a>
<a href="http://shang.qq.com/wpa/qunwpa?idkey=064e805dac955b8aea158c4b0dd3f033b8841bcee175fd619613f0e4ac4d8151" target="_blank" class="linkBlue2">QQ反馈>></a>
</p>
</div>
</div>
</body>
</html>

View File

@ -9,7 +9,7 @@
<style type="text/css">
body {
font-family: Trebuchet MS, Georgia, "Times New Roman", serif;
font-family: "微软雅黑","宋体";
background: #fff;
margin: 10px;
}
@ -35,25 +35,6 @@
$("#history_back").css("color","#CCC");
$("#history_back").css("cursor","default");
}
$("#subject").keydown(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
}).keyup(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
});
});
</script>
</head>

View File

@ -480,17 +480,22 @@ a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
/* commonBtn */
.grey_btn{ background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;}
a.grey_btn{ background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;}
a:hover.grey_btn{ background:#717171; color:#fff;}
.grey_n_btn{ background:#d9d9d9; color:#656565; font-weight:normal;padding:2px 10px; text-align:center;}
.grey_btn{background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;}
a.grey_btn{background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;}
a:hover.grey_btn{background:#717171; color:#fff;}
a.big_grey_btn{background:#e1e1e1; color:#333; font-weight:normal; padding:0px 15px; text-align:center; font-size: 12px; height: 30px; line-height: 30px;}
a:hover.big_grey_btn{background:#c3c3c3;}
.grey_n_btn{background:#d9d9d9; color:#656565; font-weight:normal;padding:2px 10px; text-align:center;}
a.grey_n_btn{background:#d9d9d9; color:#656565;font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.grey_n_btn{ background:#717171; color:#fff;}
.green_btn{ background:#28be6c; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;}
.green_btn{background:#28be6c; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;}
a.green_btn{background:#28be6c;color:#fff; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.green_btn{ background:#14ad5a;}
.blue_btn{ background:#64bdd9; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;}
a.blue_btn{background:#3b94d6;color:#fff; font-weight:normal; padding:2px 10px; text-align:center;}
.blue_btn{background:#64bdd9; color:#fff; font-weight:normal; padding:2px 10px; text-align:center;}
a.blue_btn{background:#3b94d6; color:#fff; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.blue_btn{background:#2788d0;}
a.big_blue_btn{background:#3b94d6; color:#fff; font-weight:normal;padding:0px 15px; text-align:center; font-size: 12px; height: 30px; line-height: 30px;}
a:hover.big_blue_btn{background:#2788d0;}
.red_btn{ background:red; color:#fff; font-size:14px; font-weight:normal;padding:2px 8px; text-align:center;}
a.red_btn{background:red; color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;}
a.orange_btn_homework{background:#d63502;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
@ -825,3 +830,7 @@ a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;}
}
.ke-block ol li{list-style-type: decimal;margin-left: 40px;}
.ke-block ul li{list-style-type: disc;margin-left: 40px;}
a.export_icon{background: url(/images/item.png) -58px -30px no-repeat; width: 45px; float: left; line-height: 41px; font-size: 14px; margin-top: -5px;}
a.export_icon:hover {background: url(/images/item.png) -58px -60px no-repeat;}
.export_icon_li:hover ul {display:block;}