diff options
author | Go MAEDA <maeda@farend.jp> | 2019-03-04 12:47:07 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-03-04 12:47:07 +0000 |
commit | 54bffb5ed6ab1a72aa4c45453851ccf5c81f7ee5 (patch) | |
tree | 09da70f50bff99a0a4d236b134c7fb4eed5e1700 /lib/redmine/helpers/gantt.rb | |
parent | a925f9603d6b7df86cf7f19f4358c4eb355146f4 (diff) | |
download | redmine-54bffb5ed6ab1a72aa4c45453851ccf5c81f7ee5.tar.gz redmine-54bffb5ed6ab1a72aa4c45453851ccf5c81f7ee5.zip |
Reverted r17925 (#6417). The change breaks GanttHelperTest.
git-svn-id: http://svn.redmine.org/redmine/trunk@17926 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/helpers/gantt.rb')
-rw-r--r-- | lib/redmine/helpers/gantt.rb | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index 35323b0f9..312a3133a 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -195,7 +195,6 @@ module Redmine options = {:top => 0, :top_increment => 20, :indent_increment => 20, :render => :subject, :format => :html}.merge(options) - options[:indent_increment] += 12 if options[:format] == :html indent = options[:indent] || 4 @subjects = '' unless options[:only] == :lines @lines = '' unless options[:only] == :subjects @@ -222,9 +221,7 @@ module Redmine # then render project versions and their issues versions = project_versions(project) self.class.sort_versions!(versions) - indent = options[:indent] versions.each do |version| - options[:indent] = indent render_version(project, version, options) end end @@ -701,38 +698,21 @@ module Redmine end def html_subject(params, subject, object) + style = "position: absolute;top:#{params[:top]}px;left:#{params[:indent]}px;" + style << "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width] content = html_subject_content(object) || subject - tag_options = {} + tag_options = {:style => style} case object when Issue tag_options[:id] = "issue-#{object.id}" tag_options[:class] = "issue-subject hascontextmenu" tag_options[:title] = object.subject - children = object.children & project_issues(object.project) - has_children = children.present? && (children.collect(&:fixed_version).uniq & [object.fixed_version]).present? when Version tag_options[:id] = "version-#{object.id}" tag_options[:class] = "version-name" - has_children = object.fixed_issues.exists? when Project tag_options[:class] = "project-name" - has_children = object.issues.exists? || object.versions.exists? - end - tag_options[:data] = { - :collapse_expand => { - :top_increment => params[:top_increment], - :obj_id => "#{object.class}-#{object.id}".downcase, - }, - } - if has_children - content = view.content_tag(:span, nil, :class => :expander) + content - params = params.dup - params[:indent] -= 12 if params[:indent] >= 12 - tag_options[:class] << ' open' end - style = "position: absolute;top:#{params[:top]}px;left:#{params[:indent]}px;" - style << "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width] - tag_options[:style] = style output = view.content_tag(:div, content, tag_options) @subjects << output output @@ -771,9 +751,6 @@ module Redmine def html_task(params, coords, markers, label, object) output = '' - data_options = { - :collapse_expand => "#{object.class}-#{object.id}".downcase, - } css = "task " + case object when Project @@ -797,15 +774,13 @@ module Redmine html_id = "task-todo-version-#{object.id}" if object.is_a?(Version) content_opt = {:style => style, :class => "#{css} task_todo", - :id => html_id, - :data => {}} + :id => html_id} if object.is_a?(Issue) rels = issue_relations(object) if rels.present? content_opt[:data] = {"rels" => rels.to_json} end end - content_opt[:data].merge!(data_options) output << view.content_tag(:div, ' '.html_safe, content_opt) if coords[:bar_late_end] width = coords[:bar_late_end] - coords[:bar_start] - 2 @@ -815,8 +790,7 @@ module Redmine style << "width:#{width}px;" output << view.content_tag(:div, ' '.html_safe, :style => style, - :class => "#{css} task_late", - :data => data_options) + :class => "#{css} task_late") end if coords[:bar_progress_end] width = coords[:bar_progress_end] - coords[:bar_start] - 2 @@ -829,8 +803,7 @@ module Redmine output << view.content_tag(:div, ' '.html_safe, :style => style, :class => "#{css} task_done", - :id => html_id, - :data => data_options) + :id => html_id) end end # Renders the markers @@ -842,8 +815,7 @@ module Redmine style << "width:15px;" output << view.content_tag(:div, ' '.html_safe, :style => style, - :class => "#{css} marker starting", - :data => data_options) + :class => "#{css} marker starting") end if coords[:end] style = "" @@ -852,8 +824,7 @@ module Redmine style << "width:15px;" output << view.content_tag(:div, ' '.html_safe, :style => style, - :class => "#{css} marker ending", - :data => data_options) + :class => "#{css} marker ending") end end # Renders the label on the right @@ -864,8 +835,7 @@ module Redmine style << "width:15px;" output << view.content_tag(:div, label, :style => style, - :class => "#{css} label", - :data => data_options) + :class => "#{css} label") end # Renders the tooltip if object.is_a?(Issue) && coords[:bar_start] && coords[:bar_end] @@ -881,8 +851,7 @@ module Redmine style << "height:12px;" output << view.content_tag(:div, s.html_safe, :style => style, - :class => "tooltip hascontextmenu", - :data => data_options) + :class => "tooltip hascontextmenu") end @lines << output output |