From b5817f3b24b4194c460450ffb1c1250a10222dfd Mon Sep 17 00:00:00 2001 From: ishikawa Date: Wed, 12 Jul 2017 15:58:40 +0900 Subject: [PATCH 1/2] Add context menu to the issue subjects --- app/views/gantts/show.html.erb | 7 +++++-- lib/redmine/helpers/gantt.rb | 3 ++- public/stylesheets/application.css | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index 9a74f72ba..6a3fdd06b 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -153,7 +153,9 @@ %> <%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %> <%= content_tag(:div, :class => "gantt_subjects") do %> - <%= @gantt.subjects.html_safe %> + <%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do -%> + <%= @gantt.subjects.html_safe %> + <% end %> <% end %> <% end %> @@ -272,7 +274,7 @@ wday = 1 if wday > 7 %> <% end %> -<% end %> +<% end %> <% ###### Days headers ####### %> <% if show_days %> @@ -376,3 +378,4 @@ $("#draw_progress_line").change(drawGanttHandler); }); <% end %> +<%= context_menu %> diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index 4ff2ec944..277694152 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -670,6 +670,7 @@ module Redmine :title => assigned_string).to_s.html_safe end s << view.link_to_issue(issue).html_safe + s << view.content_tag(:input, nil, :type => 'checkbox', :name => 'ids[]', :value => issue.id, :style => 'display:none;', :class => 'toggle-selection') view.content_tag(:span, s, :class => css_classes).html_safe when Version version = object @@ -704,7 +705,7 @@ module Redmine case object when Issue tag_options[:id] = "issue-#{object.id}" - tag_options[:class] = "issue-subject" + tag_options[:class] = "issue-subject hascontextmenu" tag_options[:title] = object.subject when Version tag_options[:id] = "version-#{object.id}" diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 005dcfef9..a04d8b100 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1151,6 +1151,7 @@ div.wiki img {vertical-align:middle; max-width:100%;} .gantt_subjects { font-size: 0.8em; } .gantt_subjects div { line-height:16px;height:16px;overflow:hidden;white-space:nowrap;text-overflow: ellipsis; } +.gantt_subjects div.issue-subject:hover { background-color:#ffffdd; } .task { position: absolute; -- 2.11.0 (Apple Git-81)