From f4690f0cab71113b336a9a236d9a2ada64d58747 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 21 Oct 2016 11:09:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=EF=BC=8C=E4=BA=8C=E7=BA=A7?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=EF=BC=8C=E5=88=A0=E9=99=A4=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=A1=86=E5=AE=BD=E5=BA=A6=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/add_journal.js.erb | 21 ++++++---- app/views/issues/delete_journal.js.erb | 14 ++++--- app/views/projects/_act_issues.html.erb | 2 +- .../projects/_project_issue_detail.html.erb | 8 ++-- .../projects/_project_issue_reply.html.erb | 6 +-- app/views/projects/_reply_to.html.erb | 38 +++++++++++++++++++ app/views/users/reply_to.js.erb | 22 ++++++----- public/stylesheets/css/common.css | 1 + public/stylesheets/css/public.css | 2 +- 9 files changed, 83 insertions(+), 31 deletions(-) create mode 100644 app/views/projects/_reply_to.html.erb diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index eeaa52faa..3a34647e8 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,8 +1,13 @@ -<% if @issue_id %> //issue详情中回复 - <%= render "jounal_refresh" %> -<%else%> - $("#div_user_issue_reply_<%=@user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); - sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity"); -//init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity'); - // sd_create_editor_from_data(<%#= @issue.id%>, null, "100%"); -<%end %> +<% if @issue_id %> //issue详情中回复 +<%= render "jounal_refresh" %> +<%else%> +<% if params[:is_project] %> +$("#div_user_issue_reply_<%=@user_activity_id %>").html("<%= escape_javascript(render :partial => 'projects/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); +<% else %> +$("#div_user_issue_reply_<%=@user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); +<% end %> + +sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity"); +//init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity'); +// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%"); +<%end %> diff --git a/app/views/issues/delete_journal.js.erb b/app/views/issues/delete_journal.js.erb index d105fe90f..393c1e5fa 100644 --- a/app/views/issues/delete_journal.js.erb +++ b/app/views/issues/delete_journal.js.erb @@ -1,6 +1,10 @@ -<% if @user_activity_id %> -$("#div_user_issue_reply_<%=@user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); -sd_create_editor_from_data(<%= @user_activity_id%>, null, "100%","<%=@issue.class.name%>"); -<% else %> - <%= render "jounal_refresh" %> +<% if @user_activity_id %> +<% if params[:id_project] %> +$("#div_user_issue_reply_<%=@user_activity_id%>").html("<%= escape_javascript(render :partial => 'projects/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); +<% else %> +$("#div_user_issue_reply_<%=@user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); +<% end %> +sd_create_editor_from_data(<%= @user_activity_id%>, null, "100%","<%=@issue.class.name%>"); +<% else %> +<%= render "jounal_refresh" %> <% end %> \ No newline at end of file diff --git a/app/views/projects/_act_issues.html.erb b/app/views/projects/_act_issues.html.erb index ef86c2118..07f800eb9 100644 --- a/app/views/projects/_act_issues.html.erb +++ b/app/views/projects/_act_issues.html.erb @@ -76,7 +76,7 @@ <% end %> <% end %>
-
+
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
diff --git a/app/views/projects/_project_issue_detail.html.erb b/app/views/projects/_project_issue_detail.html.erb index ff70849e1..947178cb5 100644 --- a/app/views/projects/_project_issue_detail.html.erb +++ b/app/views/projects/_project_issue_detail.html.erb @@ -48,7 +48,7 @@

<%= activity.status.name %>

<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), {:include_blank => false, :selected => @status_id ? @status_id : 0 }, - {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit",:style=>"white-space:nowrap; overflow:hidden;"} + {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w130 undis issueEdit",:style=>"white-space:nowrap; overflow:hidden;"} ) %> @@ -62,7 +62,7 @@ <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), { :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0}, - {:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"undis issueEdit", :style => "width:130px;"}) %> + {:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"w130 undis issueEdit"}) %> <% end %>
@@ -75,7 +75,7 @@ <%= activity.priority.name %> <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), {:include_blank => false,:selected=>@priority_id ? @priority_id : 0}, - {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %> + {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w130 undis issueEdit"}) %> <% end %>
@@ -85,7 +85,7 @@ <%= activity.done_ratio %>% <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0}, - {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %> + {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w130 undis issueEdit"}) %> <% end %> diff --git a/app/views/projects/_project_issue_reply.html.erb b/app/views/projects/_project_issue_reply.html.erb index 3e21d49c8..78f5ce14c 100644 --- a/app/views/projects/_project_issue_reply.html.erb +++ b/app/views/projects/_project_issue_reply.html.erb @@ -43,7 +43,7 @@ <%= link_to( l(:button_reply), - {:controller => 'users', :action => 'reply_to', :reply_id => comment.id, :type => 'Issue', :user_activity_id => user_activity_id, :activity_id => activity.id}, + {:controller => 'users', :action => 'reply_to', :reply_id => comment.id, :type => 'Issue', :user_activity_id => user_activity_id, :activity_id => activity.id, :is_project => true}, :remote => true, :method => 'get', :title => l(:button_reply)) %> @@ -51,7 +51,7 @@ <%= link_to( l(:button_delete), - {:controller => 'issues',:action => 'delete_journal', :id => activity.id,:journal_id=>comment.id, :user_activity_id => user_activity_id}, + {:controller => 'issues',:action => 'delete_journal', :id => activity.id,:journal_id=>comment.id, :user_activity_id => user_activity_id, :is_project => true}, :method => 'get', :confirm => l(:text_are_you_sure), :remote=>true, @@ -81,7 +81,7 @@
<% if User.current.logged? %>
- <%= form_for('new_form',:url => add_journal_issue_path(activity.id, :user_activity_id => user_activity_id),:method => "post", :remote => true) do |f| %> + <%= form_for('new_form',:url => add_journal_issue_path(activity.id, :user_activity_id => user_activity_id, :is_project => true),:method => "post", :remote => true) do |f| %>
diff --git a/app/views/projects/_reply_to.html.erb b/app/views/projects/_reply_to.html.erb new file mode 100644 index 000000000..bc60de13a --- /dev/null +++ b/app/views/projects/_reply_to.html.erb @@ -0,0 +1,38 @@ +
+ <% if User.current.logged? %> +
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
+
+
+ <% if @type == 'Message' %> + <%= form_for('new_form',:url => {:controller => 'messages', :action => 'reply', :id => reply.id, :board_id => reply.board.id}, :method => "post", :remote => true) do |f|%> + <%= hidden_field_tag 'is_course', params[:is_course], :value => @is_course %> + <%= hidden_field_tag 'is_board', params[:is_board], :value => @is_board %> + <%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %> + <%= hidden_field_tag 'activity_id',params[:activity_id],:value =>@activity_id %> + <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %> +
+ + +
+

+ <% end%> + <% elsif @type == 'Issue' %> + <%= form_for('new_form',:url => add_reply_issue_path(reply.issue.id),:method => "post", :remote => true) do |f|%> + <%= hidden_field_tag 'journal_id',params[:journal_id],:value =>reply.id %> + <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %> +
+ + +
+

+ <% end %> + + <% end %> +
+
+
+ <% else %> + <%= render :partial => "users/show_unlogged_reply" %> + <% end %> +
+
\ No newline at end of file diff --git a/app/views/users/reply_to.js.erb b/app/views/users/reply_to.js.erb index f3408abad..f58130c13 100644 --- a/app/views/users/reply_to.js.erb +++ b/app/views/users/reply_to.js.erb @@ -1,10 +1,14 @@ -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(); +if($("#reply_message_<%= @reply.id%>").length > 0) { + <% if params[:is_project] %> + $("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/reply_to', :locals => {:reply => @reply}) %>"); + <% else %> + $("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'users/reply_to', :locals => {:reply => @reply}) %>"); + <% end %> + $("#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/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index a70365283..9490efc45 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -233,6 +233,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .w108 {width:108px;} .w125{width:125px;} .w128{ width:128px;} +.w130{ width:130px;} .w140{ width:140px;} .w150{ width:150px;} .w170{width:170px;} diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 04f2bae89..ce3f1385a 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -1156,7 +1156,7 @@ input.new_loggin_input{ margin-top:250px; } /*未登录回复提示*/ -.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;} +.visitor-box {height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;} /* 个人资料修改弹框 */ .winbox{