From 22460005c8db78ef6a09539be8edcb0cc717177d Mon Sep 17 00:00:00 2001 From: ishikawa Date: Thu, 13 Jul 2017 10:25:42 +0900 Subject: [PATCH 2/2] Add context menu to the task bar --- app/views/gantts/show.html.erb | 4 +++- lib/redmine/helpers/gantt.rb | 3 ++- public/stylesheets/context_menu.css | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index 6a3fdd06b..5b10b580c 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -307,7 +307,9 @@ <% end %> <% end %> -<%= @gantt.lines.html_safe %> +<%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do -%> + <%= @gantt.lines.html_safe %> +<% end %> <% ###### Today red line (excluded from cache) ###### %> <% if User.current.today >= @gantt.date_from and User.current.today <= @gantt.date_to %> diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index 277694152..b4106629e 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -842,6 +842,7 @@ module Redmine s = view.content_tag(:span, view.render_issue_tooltip(object).html_safe, :class => "tip") + s += view.content_tag(:input, nil, :type => 'checkbox', :name => 'ids[]', :value => object.id, :style => 'display:none;', :class => 'toggle-selection') style = "" style << "position: absolute;" style << "top:#{params[:top]}px;" @@ -850,7 +851,7 @@ module Redmine style << "height:12px;" output << view.content_tag(:div, s.html_safe, :style => style, - :class => "tooltip") + :class => "tooltip hascontextmenu") end @lines << output output diff --git a/public/stylesheets/context_menu.css b/public/stylesheets/context_menu.css index 2b9799387..7dcd9c81c 100644 --- a/public/stylesheets/context_menu.css +++ b/public/stylesheets/context_menu.css @@ -54,3 +54,6 @@ .context-menu-selection { background-color:#507AAA !important; color:#f8f8f8 !important; } .context-menu-selection a, .context-menu-selection a:hover { color:#f8f8f8 !important; } .context-menu-selection:hover { background-color:#507AAA !important; color:#f8f8f8 !important; } +div#gantt_area .context-menu-selection { background-color: rgba(80, 122, 170, 0.48) !important; } +div#gantt_area .context-menu-selection:hover { background-color: rgba(80, 122, 170, 0.48) !important; } +div#gantt_area .context-menu-selection a { color: #169 !important; } -- 2.11.0 (Apple Git-81)