diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-30 15:48:44 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-30 15:48:44 +0000 |
commit | 40c771b339001317a5c68fcb6f7a060e3b05c344 (patch) | |
tree | 2c0b882181d7f795e9c4c804306827c131ea20a1 /app/helpers/issues_helper.rb | |
parent | 5f1bce00322552d23bd486fc0f9858512267aced (diff) | |
download | redmine-40c771b339001317a5c68fcb6f7a060e3b05c344.tar.gz redmine-40c771b339001317a5c68fcb6f7a060e3b05c344.zip |
shorten long line of IssuesHelper
git-svn-id: http://svn.redmine.org/redmine/trunk@20523 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r-- | app/helpers/issues_helper.rb | 55 |
1 files changed, 48 insertions, 7 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 5a392350d..0bcb90ad0 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -623,13 +623,55 @@ module IssuesHelper 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 => 'issues/tabs/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? + tabs << + { + :name => 'history', + :label => :label_history, + :onclick => 'showIssueHistory("history", this.href)', + :partial => 'issues/tabs/history', + :locals => {:issue => @issue, :journals => @journals} + } + if journals_with_notes.any? + tabs << + { + :name => 'notes', + :label => :label_issue_history_notes, + :onclick => 'showIssueHistory("notes", this.href)' + } + end + if journals_without_notes.any? + tabs << + { + :name => 'properties', + :label => :label_issue_history_properties, + :onclick => 'showIssueHistory("properties", this.href)' + } + end + end + if User.current.allowed_to?(:view_time_entries, @project) && @issue.spent_hours > 0 + tabs << + { + :name => 'time_entries', + :label => :label_time_entry_plural, + :remote => true, + :onclick => + "getRemoteTab('time_entries', " \ + "'#{tab_issue_path(@issue, :name => 'time_entries')}', " \ + "'#{issue_path(@issue, :tab => 'time_entries')}')" + } + end + if @has_changesets + tabs << + { + :name => 'changesets', + :label => :label_associated_revisions, + :remote => true, + :onclick => + "getRemoteTab('changesets', " \ + "'#{tab_issue_path(@issue, :name => 'changesets')}', " \ + "'#{issue_path(@issue, :tab => 'changesets')}')" + } end - tabs << {:name => 'time_entries', :label => :label_time_entry_plural, :remote => true, :onclick => "getRemoteTab('time_entries', '#{tab_issue_path(@issue, :name => 'time_entries')}', '#{issue_path(@issue, :tab => 'time_entries')}')"} if User.current.allowed_to?(:view_time_entries, @project) && @issue.spent_hours > 0 - tabs << {:name => 'changesets', :label => :label_associated_revisions, :remote => true, :onclick => "getRemoteTab('changesets', '#{tab_issue_path(@issue, :name => 'changesets')}', '#{issue_path(@issue, :tab => 'changesets')}')"} if @has_changesets tabs end @@ -648,5 +690,4 @@ module IssuesHelper user_default_tab end end - end |