二级回复功能(回复未刷新)

This commit is contained in:
daiao 2017-02-21 16:24:30 +08:00
parent 818d7ad2ef
commit 43c990c0a9
2 changed files with 11 additions and 11 deletions

View File

@ -411,7 +411,7 @@ class TrainingTasksController < ApplicationController
jour = Journal.find(params[:journal_id])
@training_task = TrainingTask.find params[:id]
@project = @training_task.project
@allowed_statuses = @training_task.new_statuses_allowed_to(User.current)
# @allowed_statuses = @training_task.new_statuses_allowed_to(User.current)
@priorities = IssuePriority.active
new_jour = Journal.new
new_jour.user_id = User.current.id
@ -423,18 +423,18 @@ class TrainingTasksController < ApplicationController
# new_jour = @issue.journals.build(:user_id => User.current.id, :reply_id => params[:journal_id], :notes => params[:content], :parent_id => jour.id)
@user_activity_id = params[:user_activity_id]
if new_jour.save
update_user_activity(@training_task.class,@issue.id)
update_forge_activity(@training_task.class,@issue.id)
update_user_activity(@training_task.class, @training_task.id)
update_forge_activity(@training_task.class, @training_task.id)
end
respond_to do |format|
if params[:is_issue_show]
format.js{ redirect_to project_training_task_path(@training_task) }
format.js{ redirect_to training_task_path(@training_task) }
else
format.js
end
end
end
end
end
# 需要刷新详情页面,代码同步一致
# 获取project和issue状态是为了刷新页面

View File

@ -7,11 +7,11 @@
<div class="ReplyToMessageInputContainer">
<% if User.current.logged? %>
<div nhname='new_message_<%= @jour.id %>' style="display:none;">
<%= form_for('new_form',:url => add_reply_training_tasks_path(@training_task.id, :is_issue_show => true),:method => "post", :remote => true) do |f|%>
<%= form_for('new_form', :url => add_reply_training_tasks_path(@training_task.id, :is_issue_show => true, :id => @training_task.id), :method => "post", :remote => true) do |f|%>
<input type="hidden" name="journal_id" value="<%= @jour.id %>"/>
<div nhname='toolbar_container_<%= @jour.id %>' ></div>
<div class="cl"></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @jour.id%>' name="content"></textarea>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @jour.id %>' name="content"></textarea>
<div class="cl"></div>
<span nhname='contentmsg_<%= @jour.id %>' class="fl"></span>
<a id="new_message_submit_btn_<%= @jour.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>