From 590e63911291bb2f5c4c022c50db81093de09053 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 19 Oct 2016 14:43:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E9=A1=B9=E7=9B=AEissue?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attachments/_activity_attach.html.erb | 1 + app/views/projects/_act_issues.html.erb | 6 +- .../_project_issue_comments_reply.html.erb | 8 ++ ...oject_issue_comments_reply_detail.html.erb | 20 +++ .../projects/_project_issue_contents.html.erb | 29 +++++ .../projects/_project_issue_detail.html.erb | 116 ++++++++++++++++++ .../projects/_project_issue_reply.html.erb | 101 +++++++++++++++ .../projects/_project_reply_banner.html.erb | 32 +++++ app/views/projects/_show_unlogged.html.erb | 4 + 9 files changed, 314 insertions(+), 3 deletions(-) create mode 100644 app/views/projects/_project_issue_comments_reply.html.erb create mode 100644 app/views/projects/_project_issue_comments_reply_detail.html.erb create mode 100644 app/views/projects/_project_issue_contents.html.erb create mode 100644 app/views/projects/_project_issue_detail.html.erb create mode 100644 app/views/projects/_project_issue_reply.html.erb create mode 100644 app/views/projects/_project_reply_banner.html.erb create mode 100644 app/views/projects/_show_unlogged.html.erb diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb index 48c01468a..ad87d28bf 100644 --- a/app/views/attachments/_activity_attach.html.erb +++ b/app/views/attachments/_activity_attach.html.erb @@ -1,3 +1,4 @@ + <% if activity.attachments.any? %> <% activity.attachments.each do |attachment| %>
diff --git a/app/views/projects/_act_issues.html.erb b/app/views/projects/_act_issues.html.erb index 551a07df2..75f4d73b3 100644 --- a/app/views/projects/_act_issues.html.erb +++ b/app/views/projects/_act_issues.html.erb @@ -3,7 +3,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> - <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> + <%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
@@ -84,7 +84,7 @@ <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> <% unless params[:action] == "index" %>
- <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> + <%= render :partial => 'projects/project_issue_detail', :locals => {:activity => activity} %>
<% end %> <% end %> @@ -96,7 +96,7 @@
- <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %> + <%= render :partial => 'projects/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
+
+
+
    + <%#= labelled_fields_for :issue, @issue do |f| %> + <%#= f.select :status_id, ([["新增",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"} %> + <%# end %> + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %> +
  • +

     状态  : 

    +

    <%= 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;"} + ) + %> +
  • + <% end %> +
    + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %> +
  • +

     指派  : 

    + + <%= link_to activity.try(:assigned_to).show_name, user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:100px; display:inline-block;" %> + + <%= 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;"}) %> +
  • + <% end %> +
    +
+ +
    + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %> +
  • +

     优先级  : 

    + <%= 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"}) %> +
  • + <% end %> +
    + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %> +
  • +

     完成度  : 

    + <%= 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"}) %> + <% end %> +
  • + +
    +
+
    +
  • +

     开始  : 

    +

    <%= format_date(activity.start_date) %>

    +
  • +
    +
  • +

     周期  : 

    + <%= l_hours(activity.estimated_hours) %>
  • +
    +
+
    +
  • +

     计划完成  : 

    + <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
  • +
    +
  • +

     <%=l(:milestone)%>  : 

    + <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
  • +
    +
+ +
\ No newline at end of file diff --git a/app/views/projects/_project_issue_reply.html.erb b/app/views/projects/_project_issue_reply.html.erb new file mode 100644 index 000000000..019e435b8 --- /dev/null +++ b/app/views/projects/_project_issue_reply.html.erb @@ -0,0 +1,101 @@ +<% count = activity.journals.count %> +
+ <%= render :partial => 'projects/project_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> + + <% comments = activity.journals.includes(:user, :details).reorder("created_on desc").limit(3) %> + <% if count > 0 %> +
+
    + <% comments.each do |comment| %> + +
  • +
    + <%= 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 => 'projects/project_issue_contents', :locals => {:comment => comment}%> + + <% if !comment.content_detail.blank? || comment.class == Journal %> +
    + <% if comment.class == Journal %> + <% if comment.details.any? %> + <% details_to_strings(comment.details).each do |string| %> +

    <%= string %>

    + <% end %> + <% end %> +

    <%= comment.notes.html_safe %>

    + <% else %> + <%= comment.content_detail.html_safe %> + <% end %> +
    +
    +
    + + + <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> + + + + <%= 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}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> + + + <%= link_to( + l(:button_delete), + {:controller => 'issues',:action => 'delete_journal', :id => activity.id,:journal_id=>comment.id, :user_activity_id => user_activity_id}, + :method => 'get', + :confirm => l(:text_are_you_sure), + :remote=>true, + :id => "delete_reply_#{activity.id}_#{comment.id}", + :class => 'fr mr20 undis', + :title => l(:button_delete) + ) if comment.user_id == User.current.id %> + + +
    +
    +
    +

    + <% end %> +
    +
    +
  • + <% end %> +
+ + <%#= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Issue', :activity_id => activity.id} %> +
+ <% end %> + +
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
+
+ <% 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| %> + +
+ + +
+

+ <% end%> +
+ <% else %> + <%= render :partial => "projects/show_unlogged" %> + <% end %> +
+
+
+
+ +
\ No newline at end of file diff --git a/app/views/projects/_project_reply_banner.html.erb b/app/views/projects/_project_reply_banner.html.erb new file mode 100644 index 000000000..58c0688ee --- /dev/null +++ b/app/views/projects/_project_reply_banner.html.erb @@ -0,0 +1,32 @@ +
+
+ 回复 + ︿ + <%= count>0 ? "(#{count})" : "" %> + + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> + +
+
<%#= format_date(activity.updated_on) %>
+ <%if count>3 %> +
+ <% if activity.class.to_s == 'HomeworkCommon' %> + + 展开更多 + + <% elsif activity.class.to_s == 'Message' %> + + 展开更多 + + <% elsif activity.class.to_s == 'BlogComment' %> + + 展开更多 + + <% else %> + + 展开更多 + + <% end %> +
+ <% end %> +
\ No newline at end of file diff --git a/app/views/projects/_show_unlogged.html.erb b/app/views/projects/_show_unlogged.html.erb new file mode 100644 index 000000000..223ee3f40 --- /dev/null +++ b/app/views/projects/_show_unlogged.html.erb @@ -0,0 +1,4 @@ +
+ 登录后可添加回复 + <%#= link_to "登录", signin_path, :class => "linkBlue", :target => "_blank" %> +
\ No newline at end of file