diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index f5c7c9094..45a621816 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -134,7 +134,7 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
-
+
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> <% if !comment.content_detail.blank? %> @@ -161,7 +161,8 @@ l(:button_delete), {:controller => 'blog_comments', :action => 'destroy', :id => comment.id}, :method => :delete, - :class => 'fr mr20', + :id => "delete_reply_#{comment.id}", + :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) ) %> diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index 067064c07..35e0726a8 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -5,7 +5,7 @@
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
-
+
@@ -28,17 +28,17 @@ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> - <% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %> - <%= link_to(l(:label_bid_respond_delete), - {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', - :class => "delete", :title => l(:button_delete)) %> - <% end %> <% if reply_allow %> <%#= link_to l(:label_bid_respond_quote),'', {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> <%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>"reply_btn"} %> <% end %> + <% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %> + <%= link_to(l(:label_bid_respond_delete), + {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :id => "delete_reply_#{journal.id}", + :class => "delete undis", :title => l(:button_delete)) %> + <% end %>
<% ids = 'project_respond_form_'+ journal.id.to_s%> diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb index 070238a81..1bc8dc132 100644 --- a/app/views/issues/_issue_replies.html.erb +++ b/app/views/issues/_issue_replies.html.erb @@ -10,7 +10,7 @@
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
-
+
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
@@ -40,7 +40,8 @@ l(:button_delete), {:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>comment.id}, :method => :get, - :class => 'fr mr20', + :id => "delete_reply_#{comment.id}", + :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) ) if comment.user_id == User.current.id %> diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 7a61273bb..760e0ea24 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -109,7 +109,7 @@
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
-
+
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
@@ -134,7 +134,8 @@ l(:button_delete), {:action => 'destroy', :id => reply}, :method => :post, - :class => 'fr mr20', + :id => "delete_reply_#{reply.id}", + :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) ) if reply.course_destroyable_by?(User.current) %> diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index ff358f7c3..92474b6c5 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -170,7 +170,7 @@
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
-
+
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
@@ -195,7 +195,8 @@ l(:button_delete), {:action => 'destroy', :id => reply}, :method => :post, - :class => 'fr mr20', + :id => "delete_reply_#{reply.id}", + :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) ) if reply.course_destroyable_by?(User.current) %> diff --git a/app/views/news/_news_all_replies.html.erb b/app/views/news/_news_all_replies.html.erb index c4140cd91..7e17ac235 100644 --- a/app/views/news/_news_all_replies.html.erb +++ b/app/views/news/_news_all_replies.html.erb @@ -19,7 +19,7 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
-
+
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%> <% if !comment.content_detail.blank? %> @@ -47,7 +47,8 @@ :action => 'destroy', :id => @news, :comment_id => comment}, :method => :delete, - :class => 'fr mr20', + :id => "delete_reply_#{comment.id}", + :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) ) if @news.author == User.current %> diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index 0b5f4e693..1321fc83e 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -102,7 +102,7 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
-
+
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> <% if !comment.content_detail.blank? %> @@ -129,7 +129,8 @@ l(:button_delete), {:controller => 'org_document_comments',:action => 'delete_reply', :id => comment.id}, :method => :delete, - :class => 'fr mr20', + :id => "delete_reply_#{comment.id}", + :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete)) %> <% end %> diff --git a/app/views/projects/_history.html.erb b/app/views/projects/_history.html.erb index e5c03628c..113689344 100644 --- a/app/views/projects/_history.html.erb +++ b/app/views/projects/_history.html.erb @@ -3,7 +3,7 @@ <% for journal in journals %>
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
-
+
<%= link_to journal.user.show_name, user_path(journal.user), :class => 'c_blue fb fl mb10 f14', :target => "_blank" %> @@ -20,16 +20,16 @@ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> <% if journal.user == User.current|| User.current.admin? %> - <%= link_to(l(:label_bid_respond_delete), - {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', - :class => "delete", :title => l(:button_delete)) %> - <% end %> - <% if reply_allow %> + <% if reply_allow %> <%#= link_to l(:label_bid_respond_quote),'', {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> <%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %> + <% end %> + <%= link_to(l(:label_bid_respond_delete), + {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :id => "delete_reply_#{journal.id}", + :class => "delete undis", :title => l(:button_delete)) %> <% end %>
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 1b55b08f6..1b6d8298f 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -295,7 +295,7 @@ <% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %> <% if count > 0 %>
- <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id} %> + <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id, :activity_id => activity.id} %>
<% end %> diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb index 994c5c64e..673fae303 100644 --- a/app/views/users/_message_replies.html.erb +++ b/app/views/users/_message_replies.html.erb @@ -10,7 +10,7 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
-
+
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> <% if !comment.content_detail.blank? %> @@ -39,7 +39,8 @@ delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board), :method => :post, :remote => true, - :class => 'fr mr20', + :id => "delete_reply_#{activity_id}_#{comment.id}", + :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) ) %> @@ -56,7 +57,7 @@ <% if comment.creator_user == User.current || User.current.admin? %> <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user, :user_activity_id => user_activity_id, :activity_id => activity_id}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> + :id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %> <% end %> <% elsif type == 'OrgDocumentComment' %> @@ -74,7 +75,8 @@ {:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id}, :method => :delete, :remote => true, - :class => 'fr mr20', + :id => "delete_reply_#{activity_id}_#{comment.id}", + :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete)) %> <% end %> @@ -94,7 +96,8 @@ {:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage, :user_id => user_id}, :method => :delete, :remote => true, - :class => 'fr mr20', + :id => "delete_reply_#{activity_id}_#{comment.id}", + :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete)) %> <% end %> diff --git a/app/views/users/_news_replies.html.erb b/app/views/users/_news_replies.html.erb index fcbe59ebf..5ab4ec031 100644 --- a/app/views/users/_news_replies.html.erb +++ b/app/views/users/_news_replies.html.erb @@ -10,7 +10,7 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
-
+
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%> <% if !comment.content_detail.blank? || comment.class == Journal %> @@ -44,7 +44,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, :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)) %> + :id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %> <% end %> <% elsif type == 'News' %> @@ -56,8 +56,8 @@ :title => l(:button_reply)) %> - <%= link_to('删除', {:controller => 'comments', :action => 'destroy', :id => activity_id, :comment_id => comment, :user_activity_id => user_activity_id}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) if News.find(activity_id).author == User.current %> + <%= link_to('删除', {:controller => 'comments', :action => 'destroy', :id=>activity_id, :comment_id => comment, :user_activity_id => user_activity_id}, + :id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) if News.find(activity_id).author == User.current %> <% elsif type == 'Issue' %> <%= link_to( @@ -74,7 +74,8 @@ :method => 'get', :confirm => l(:text_are_you_sure), :remote=>true, - :class => 'fr mr20', + :id => "delete_reply_#{activity_id}_#{comment.id}", + :class => 'fr mr20 undis', :title => l(:button_delete) ) if comment.user_id == User.current.id %> <% elsif type == 'Syllabus' %> @@ -88,8 +89,8 @@ <% if User.current.admin? || User.current == Syllabus.find(activity_id).user || comment.user == User.current%> - <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> + <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user},:id => "delete_reply_#{activity_id}_#{comment.id}", + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %> <% end %> <% end %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 3f73f3b9d..49095d62f 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -307,7 +307,7 @@ <% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %> <% if count > 0 %>
- <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => is_in_course,:course_activity=>-1, :is_teacher => is_teacher, :user_activity_id => -1} %> + <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => is_in_course,:course_activity=>-1, :is_teacher => is_teacher, :user_activity_id => -1, :activity_id => homework_common.id} %>
<% end %> diff --git a/app/views/users/all_journals.js.erb b/app/views/users/all_journals.js.erb index a5fca2a60..5f60c754c 100644 --- a/app/views/users/all_journals.js.erb +++ b/app/views/users/all_journals.js.erb @@ -1,5 +1,5 @@ <% if params[:type] == 'HomeworkCommon' %> -$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>'); +$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id, :activity_id => params[:id].to_i}) %>'); <% elsif params[:type] == 'JournalsForMessage' %> $('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i}) %>'); <% elsif params[:type] == 'Message' %> diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index 8a2c14e07..b589fae56 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -39,15 +39,15 @@ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% if User.current.admin? || reply.user.id == User.current.id || allow_delete%> - <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> - <% end %> <% if reply_allow %> <%#= link_to l(:button_reply),'', {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %> <%= link_to l(:button_reply),'javascript:;',{:nhname=>"reply_btn"} %> <% end %> + <% if User.current.admin? || reply.user.id == User.current.id || allow_delete%> + <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> + <% end %>