-
回复
+
回复
+ ︿
<%= count>0 ? "(#{count})" : "" %>▪
<% if activity.user == User.current %>
@@ -327,24 +328,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 => -1, :user_activity_id => user_activity_id, :course_activity=>course_activity},
+ :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 => -1, :user_activity_id => user_activity_id, :course_activity=>course_activity},
+ :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.html.erb b/app/views/users/_reply_to.html.erb
index ccfc07db2..30f4e3542 100644
--- a/app/views/users/_reply_to.html.erb
+++ b/app/views/users/_reply_to.html.erb
@@ -4,6 +4,8 @@
<%= form_for('new_form',:url => {:controller => 'words', :action => 'reply_to_homework', :id => reply.id},:method => "post", :remote => true) do |f| %>
>
+
>
+
>
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb
index 30bec6685..fde67f472 100644
--- a/app/views/users/_user_homework_detail.html.erb
+++ b/app/views/users/_user_homework_detail.html.erb
@@ -373,7 +373,7 @@
<%= link_to(
l(:button_reply),
- {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course},
+ {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :course_activity => -1},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
@@ -381,7 +381,7 @@
<% 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},
+ <%= 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/words/reply_to_homework.js.erb b/app/views/words/reply_to_homework.js.erb
index 85275277a..7da72fa54 100644
--- a/app/views/words/reply_to_homework.js.erb
+++ b/app/views/words/reply_to_homework.js.erb
@@ -1,4 +1,7 @@
-<% if @is_in_course %>
+<% if @user_activity_id != -1 %>
+$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id,:course_activity => @course_activity}) %>");
+sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
+<% else %>
$("#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