issue回复的删除功能

This commit is contained in:
lizanle 2015-12-17 17:15:03 +08:00
parent 1809a93770
commit 1dbccd81d6
6 changed files with 44 additions and 5 deletions

View File

@ -430,6 +430,20 @@ class IssuesController < ApplicationController
end
end
#对某个journ回复
def reply
end
#
def delete_journal
@issue = Issue.find(params[:id])
Journal.destroy(params[:journal_id])
respond_to do |format|
format.js
end
end
private
def find_project

View File

@ -6,8 +6,8 @@
});
</script>
<% replies_all_i=replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" >
<div class="homepagePostReplyPortrait">
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();" >
<div class="homepagePostReplyPortrait" >
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
@ -27,6 +27,26 @@
<% end %>
<P><%= reply.notes.html_safe %></P>
</div>
<div style="margin-top: 7px">
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
<%= link_to(
l(:button_reply),
{:controller => 'issues',:action => 'reply',:user_id=>reply.user_id, :id => issue.id,:journal_id=>reply.id},
:remote => true,
:method => 'get',
:class => 'fr newsBlue',
:title => l(:button_reply)) if User.current.logged? %>
<%= link_to(
l(:button_delete),
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>reply.id},
:method => :get,
:remote=>true,
:class => 'fr newsGrey mr10',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.user_id == User.current.id %>
</div>
</div>
</div>
<div class="cl"></div>
</li>

View File

@ -4,6 +4,6 @@
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
<%else%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%");
// sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%");
<%end %>

View File

@ -0,0 +1,3 @@
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");

View File

@ -705,6 +705,8 @@ RedmineApp::Application.routes.draw do
member do
post 'add_journal'
post 'add_journal_in_org'
get 'delete_journal'
post 'reply'
end
resources :time_entries, :controller => 'timelog' do
collection do

View File

@ -26,7 +26,7 @@ function sd_create_editor(params){
afterBlur:function(){
//params.toolbar_container.hide();
sd_check_editor_form_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
if(this.edit.html()=="") {
if(this.isEmpty()) {
this.edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
}
//params.toolbar_container.hide();