summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 07:07:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 07:07:22 +0000
commitb132b8e914c5612218bb161af19aa916b18deab3 (patch)
tree154933794125163c63050d37fa01613e7a1aede7 /app
parentd4312d25656283d34202cede73e9e1fff61a7db6 (diff)
downloadredmine-b132b8e914c5612218bb161af19aa916b18deab3.tar.gz
redmine-b132b8e914c5612218bb161af19aa916b18deab3.zip
Show issue history in tabs (#3058).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18272 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/issues_helper.rb14
-rw-r--r--app/views/issues/_history.html.erb5
-rw-r--r--app/views/issues/show.html.erb6
3 files changed, 22 insertions, 3 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index cfdb15ad1..ccf89e8fa 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -545,4 +545,18 @@ module IssuesHelper
end
end
end
+
+ # Issue history tabs
+ def issue_history_tabs()
+ tabs = []
+ if @journals.present?
+ journals_without_notes = @journals.select{|value| value.notes.blank?}
+ journals_with_notes = @journals.reject{|value| value.notes.blank?}
+
+ tabs << {:name => 'history', :label => :label_history, :onclick => 'showIssueHistory("history", this.href)', :partial => 'history', :locals => {:issue => @issue, :journals => @journals}}
+ tabs << {:name => 'notes', :label => :label_issue_history_notes, :onclick => 'showIssueHistory("notes", this.href)'} if journals_with_notes.any?
+ tabs << {:name => 'properties', :label => :label_issue_history_properties, :onclick => 'showIssueHistory("properties", this.href)'} if journals_without_notes.any?
+ end
+ tabs
+ end
end
diff --git a/app/views/issues/_history.html.erb b/app/views/issues/_history.html.erb
index 297771d7d..6571bea45 100644
--- a/app/views/issues/_history.html.erb
+++ b/app/views/issues/_history.html.erb
@@ -1,3 +1,8 @@
+<%
+ issue = tab[:locals][:issue]
+ journals = tab[:locals][:journals]
+%>
+
<% reply_links = issue.notes_addable? -%>
<% for journal in journals %>
<div id="change-<%= journal.id %>" class="<%= journal.css_classes %>">
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 6c0018f24..3a17cc49a 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -129,12 +129,12 @@ end %>
</div>
<% end %>
-<% if @journals.present? %>
+<%= render partial: 'action_menu_edit' if User.current.wants_comments_in_reverse_order? %>
+
<div id="history">
<h3><%=l(:label_history)%></h3>
-<%= render :partial => 'history', :locals => { :issue => @issue, :journals => @journals } %>
+<%= render_tabs issue_history_tabs, params[:tab] ? params[:tab] : 'notes' %>
</div>
-<% end %>
<%= render partial: 'action_menu_edit' unless User.current.wants_comments_in_reverse_order? %>