-
回复
+
回复
+ ︿
<%= count>0 ? "(#{count})" : "" %>▪
<% if homework_common.user == User.current %>
@@ -333,22 +334,60 @@
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
- <%= format_time(comment.created_on) %>
-
+ <%= time_from_now(comment.created_on) %>
+ <% unless comment.m_parent_id.nil? %>
+ <% parents_rely = [] %>
+ <% parents_rely = get_reply_parents parents_rely, comment %>
+ <% length = parents_rely.length %>
+
+ <% end %>
+
+
+
+
+
+ <%= link_to(
+ l(:button_reply),
+ {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course},
+ :remote => true,
+ :method => 'get',
+ :title => l(:button_reply)) %>
+
+
+
+ <% 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 => "fr mr20", :title => l(:button_delete)) %>
+ <% end %>
+
+
+
+
+
diff --git a/app/views/users/reply_to.js.erb b/app/views/users/reply_to.js.erb
new file mode 100644
index 000000000..f3408abad
--- /dev/null
+++ b/app/views/users/reply_to.js.erb
@@ -0,0 +1,10 @@
+if($("#reply_message_<%= @reply.id%>").length > 0) {
+ $("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'users/reply_to', :locals => {:reply => @reply}) %>");
+ $("#reply_iconup_<%=@reply.id %>").show();
+ $(function(){
+ sd_create_editor_from_data(<%= @reply.id%>,null,"100%", "<%=@reply.class.to_s%>");
+ });
+}else if($("#reply_to_message_<%= @reply.id%>").length >0) {
+ $("#reply_to_message_<%= @reply.id%>").replaceWith("
");
+ $("#reply_iconup_<%=@reply.id %>").hide();
+}
\ No newline at end of file
diff --git a/app/views/users/show_all_replies.js.erb b/app/views/users/show_all_replies.js.erb
new file mode 100644
index 000000000..99ab73b46
--- /dev/null
+++ b/app/views/users/show_all_replies.js.erb
@@ -0,0 +1,3 @@
+<% unless @comment.parent.nil? %>
+$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent})%>");
+<% end %>
\ No newline at end of file
diff --git a/app/views/words/reply_to_homework.js.erb b/app/views/words/reply_to_homework.js.erb
new file mode 100644
index 000000000..85275277a
--- /dev/null
+++ b/app/views/words/reply_to_homework.js.erb
@@ -0,0 +1,4 @@
+<% if @is_in_course %>
+$("#homework_common_<%= @homework_common.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>");
+sd_create_editor_from_data(<%= @homework_common.id%>,"","100%", "HomeworkCommon");
+<% end %>
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 0e67a806e..e058e72d0 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -495,6 +495,8 @@ RedmineApp::Application.routes.draw do
match "tag_saveEx" , :via => [:get, :post]
post "user_new_homework"
get 'new_user_commit_homework'
+ get 'reply_to'
+ get 'show_all_replies'
post "user_commit_homework"
post 'user_select_homework'
end
@@ -1109,6 +1111,7 @@ RedmineApp::Application.routes.draw do
match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message"
post 'words/:id/leave_homework_message', :to => 'words#leave_homework_message', :as => "leave_homework_message"
+ post 'words/:id/reply_to_homework', :to => 'words#reply_to_homework', :as => "reply_to_homework"
post 'join_in/join', :to => 'courses#join', :as => 'join'
delete 'join_in/join', :to => 'courses#unjoin'
diff --git a/lib/tasks/homework_update.rake b/lib/tasks/homework_update.rake
deleted file mode 100644
index b2246bfd5..000000000
--- a/lib/tasks/homework_update.rake
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace :homework_update do
- desc "update homework updated_at"
- task :update_homework => :environment do
- stu_pro = StudentWork.where("project_id != 0")
-
- end
-end
\ No newline at end of file
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index b22ffffb3..b81a7a7b6 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -131,7 +131,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
-.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}
+.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
.borderBottomNone {border-bottom:none !important;}
.topBorder {border-top: 1px solid #e4e4e4;}
div.minHeight48{min-height: 48px;}
@@ -1295,3 +1295,44 @@ a.contributor_course{float: right; color: #888; font-size: 12px; font-weight: no
/*20160310分班样式*/
.select-class-option {width:125px;}
+
+/* 作业二级回复 */
+.clearfix:after { content:"."; display:block; height:0; visibility:hidden; clear:both; }
+.clearfix { zoom:1; }
+.clearit { clear:both; height:0; font-size:0; overflow:hidden; }
+.comment_item{ width:720px; background-color:#f1f1f1; color:#888;}
+.comment_top{ height:15px; border: 1px solid #e4e4e4; padding:10px; position:relative;}
+.reply_iconup{ position:absolute; top:21px; left:13px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;}
+.fl{ float:left;}
+.fr{ float:right;}
+.comment_item_cont{ padding:15px; border-bottom:1px solid #e3e3e3;}
+.J_Comment_Face img{ width:40px; height:40px; }
+.t_content{ width:92%; margin-left:15px;}
+a.content-username { color:#269ac9; font-size:14px; margin-right:15px;}
+a.content-username:hover{ color:#297fb8;}
+.orig_user img{width:32px; height:32px;}
+.reply-right{ float:right; position:relative;}
+.reply_iconup02{ position:absolute; top:16px; left:4px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;}
+.comment_orig_content{margin:10px 0; color:#999;}
+.comment_orig_content .comment_orig_content{margin-top:0;}
+.orig_cont{ border:solid 1px #F3DDB3; background:#FFFEF4; padding:4px;color:#999;margin-top:-1px;}
+.orig_cont_sub{ border-top:0}
+.orig_index{ float:right; color:#666; font-family:Arial; padding-right:5px;line-height:30px;}
+.orig_user{ margin:10px 15px 10px 5px;}
+.orig_user span{ color:#999; padding-right:5px;}
+.orig_content{padding:5px 0px 5px 0px;line-height:24px; color:#333; }
+.orig_right{ width:80%; margin-top:5px;}
+a.comment_ding_link{ height:24px;line-height:24px;display:inline-block;padding-left:2px;vertical-align:middle; color:#333; }
+a:hover.comment_ding_link{ color:#269ac9;}
+.comment_ding_link span{display: inline-block;padding: 0 0px 0 8px;}
+.comment_ding_link em{font-style: normal;font-family: arial;}
+.comment_reply_link{ display:inline-block; width:50px; height:24px;line-height: 24px; vertical-align:middle;text-align: center;}
+.comment_reply_link:link,.comment_reply_link:visited{color:#333;text-decoration: none;}
+.comment_content{ color:#333;}
+.t_txt{ margin-top:10px;}
+.orig_reply_box{border-top:1px solid #e3e3e3; width:95%; padding:15px 0px 15px 25px;}
+.orig_textarea{width:90%; margin-bottom:10px;}
+.orig_sub{ float:right; background-color:#269ac9; color:#fff; height:25px; line-height:25px; text-align:center; width:80px; border:none;}
+.orig_sub:hover{ background:#297fb8;}
+.orig_cont_hide{ text-align:center; width:624px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:8px 0;}
+.orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;}
\ No newline at end of file
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index c452d014f..be6cea109 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -671,7 +671,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
-.homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}
+.homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
.borderBottomNone {border-bottom:none !important;}
.topBorder {border-top: 1px solid #e4e4e4;}
div.minHeight48{min-height: 48px;}
@@ -1494,3 +1494,46 @@ a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding
.green_btn_share{ background:#28be6c; padding:2px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;}
+/* 作业二级回复 */
+.clearfix:after { content:"."; display:block; height:0; visibility:hidden; clear:both; }
+.clearfix { zoom:1; }
+.clearit { clear:both; height:0; font-size:0; overflow:hidden; }
+.comment_item{ width:720px; background-color:#f1f1f1; color:#888;}
+.comment_top{ height:15px; border: 1px solid #e4e4e4; padding:10px; position:relative;}
+.reply_iconup{ position:absolute; top:21px; left:13px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;}
+.fl{ float:left;}
+.fr{ float:right;}
+.comment_item_cont{ padding:15px; border-bottom:1px solid #e3e3e3;}
+.J_Comment_Face img{ width:40px; height:40px; }
+.t_content{ width:92%; margin-left:15px;}
+a.content-username { color:#269ac9; font-size:14px; margin-right:15px;}
+a.content-username:hover{ color:#297fb8;}
+.orig_user img{width:32px; height:32px;}
+.reply-right{ float:right; position:relative;}
+.reply_iconup02{ position:absolute; top:16px; left:4px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;}
+.comment_orig_content{margin:10px 0; color:#999;}
+.comment_orig_content .comment_orig_content{margin-top:0;}
+.orig_cont{ border:solid 1px #F3DDB3; background:#FFFEF4; padding:4px;color:#999;margin-top:-1px;}
+.orig_cont_sub{ border-top:0}
+.orig_index{ float:right; color:#666; font-family:Arial; padding-right:5px;line-height:30px;}
+.orig_user{ margin:10px 15px 10px 5px;}
+.orig_user span{ color:#999; padding-right:5px;}
+.orig_content{padding:5px 0px 5px 0px;line-height:24px; color:#333; }
+.orig_right{ width:80%; margin-top:5px;}
+a.comment_ding_link{ height:24px;line-height:24px;display:inline-block;padding-left:2px;vertical-align:middle; color:#333; }
+a:hover.comment_ding_link{ color:#269ac9;}
+.comment_ding_link span{display: inline-block;padding: 0 0px 0 8px;}
+.comment_ding_link em{font-style: normal;font-family: arial;}
+.comment_reply_link{ display:inline-block; width:50px; height:24px;line-height: 24px; vertical-align:middle;text-align: center;}
+.comment_reply_link:link,.comment_reply_link:visited{color:#333;text-decoration: none;}
+.comment_content{ color:#333;}
+.t_txt{ margin-top:10px;}
+.orig_reply_box{border-top:1px solid #e3e3e3; width:95%; padding:15px 0px 15px 25px;}
+.orig_textarea{width:90%; margin-bottom:10px;}
+.orig_sub{ float:right; background-color:#269ac9; color:#fff; height:25px; line-height:25px; text-align:center; width:80px; border:none;}
+.orig_sub:hover{ background:#297fb8;}
+.orig_cont_hide{ text-align:center; width:624px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:8px 0;}
+.orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;}
+
+.likeText{color: #7f7f7f}
+.likeNum{color: #7f7f7f}
\ No newline at end of file
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index f711c25e2..316f34e3a 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -977,6 +977,7 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
vertical-align: middle;
font-size: 12px;
color: #888;
+ position: relative;
}
.homepagePostReplyBannerCount {
width: 255px;
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 790ca8691..7345cad35 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -111,6 +111,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mw20{ margin: 0 20px;}
.mt1{margin-top: 1px;}
.mt-4 {margin-top:-4px;}
+.mt-10 {margin-top:-10px;}
.mt0 {margin-top:0px !important;}
.mt3{ margin-top:3px;}
.mt5{ margin-top:5px;}
@@ -602,7 +603,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
-.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}
+.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
.borderBottomNone {border-bottom:none !important;}
.topBorder {border-top: 1px solid #e4e4e4;}
.homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:15px;}
@@ -1141,3 +1142,6 @@ a.program-btn{background: url(../images/homepage_icon.png) -86px -393px no-repea
/*排序样式*/
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
+
+.likeText{color: #7f7f7f}
+.likeNum{color: #7f7f7f}
\ No newline at end of file