From f35194e6046e1be5a81d5e26705c032e4d0a4406 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 9 Jan 2007 21:27:21 +0000 Subject: [PATCH] tooltips added on Gantt chart to view the details of the issues (added csshover behaviour to make it work under IE) git-svn-id: http://redmine.rubyforge.org/svn/trunk@160 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/projects_controller.rb | 2 +- app/views/layouts/base.rhtml | 5 ++ app/views/projects/gantt.rhtml | 23 +++++-- public/stylesheets/application.css | 17 ++++- public/stylesheets/csshover.htc | 120 +++++++++++++++++++++++++++++++++ 5 files changed, 158 insertions(+), 9 deletions(-) create mode 100644 public/stylesheets/csshover.htc diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 68dc1a66..7b62312b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -485,7 +485,7 @@ class ProjectsController < ApplicationController @date_from = Date.civil(@year_from, @month_from, 1) @date_to = (@date_from >> @months) - 1 - @issues = @project.issues.find(:all, :order => "start_date, due_date", :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date?)) and start_date is not null and due_date is not null)", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to]) + @issues = @project.issues.find(:all, :order => "start_date, due_date", :include => [:tracker, :status, :author, :priority], :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date?)) and start_date is not null and due_date is not null)", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to]) if params[:output]=='pdf' @options_for_rfpdf ||= {} diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 85f41e32..4768f29d 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -5,6 +5,11 @@ + <%= stylesheet_link_tag "application" %> <%= stylesheet_link_tag "print", :media => "print" %> <%= javascript_include_tag :defaults %> diff --git a/app/views/projects/gantt.rhtml b/app/views/projects/gantt.rhtml index 615d8323..5f6c96e9 100644 --- a/app/views/projects/gantt.rhtml +++ b/app/views/projects/gantt.rhtml @@ -55,7 +55,7 @@ if @zoom >1 end g_width = (@date_to - @date_from + 1)*zoom -g_height = [(20 * @issues.length + 6), 206].max +g_height = [(20 * @issues.length + 6)+150, 206].max t_height = g_height + headers_heigth %> @@ -65,14 +65,14 @@ t_height = g_height + headers_heigth
-
+
<% # # Tasks subjects # top = headers_heigth + 8 @issues.each do |i| %> -
+
<%= link_to "#{i.tracker.name} ##{i.id}", { :controller => 'issues', :action => 'show', :id => i }, :title => "#{i.subject}" %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %>
@@ -82,7 +82,7 @@ end %> -
+
 
<% # @@ -167,7 +167,7 @@ if Date.today >= @date_from and Date.today <= @date_to %> # # Tasks # -top = headers_heigth + 12 +top = headers_heigth + 10 @issues.each do |i| %> <% i_start_date = (i.start_date >= @date_from ? i.start_date : @date_from ) @@ -183,7 +183,7 @@ top = headers_heigth + 12 i_width = ((i_end_date - i_start_date + 1)*zoom).floor - 2 # total width of the issue (- 2 for left and right borders) d_width = ((i_done_date - i_start_date)*zoom).floor - 2 # done width l_width = i_late_date ? ((i_late_date - i_start_date+1)*zoom).floor - 2 : 0 # delay width - %> + %>
 
<% if l_width > 0 %>
 
@@ -194,7 +194,16 @@ top = headers_heigth + 12
<%= i.status.name %> <%= (i.done_ratio).to_i %>% -
+
+ <% # === tooltip === %> +
+ <%= "#{i.tracker.name} ##{i.id}" %>: <%=h i.subject %>
+
+ <%= l(:field_start_date) %>: <%= format_date(i.start_date) %>
+ <%= l(:field_due_date) %>: <%= format_date(i.due_date) %>
+ <%= l(:field_assigned_to) %>: <%= i.assigned_to ? i.assigned_to.name : "-" %>
+ <%=l(:field_priority)%>: <%= i.priority.name %> +
<% top = top + 20 end %>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index ea033c55..6fed472a 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -548,7 +548,6 @@ font-size: 1em; height:8px; font-size:0.8em; color:#888; - background:#aaa; padding:0; margin:0; line-height:0.8em; @@ -558,6 +557,22 @@ font-size: 1em; .task_done { background:#66f url(../images/task_done.png); border: 1px solid #66f; } .task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; } +/***** Tooltips ******/ +.tooltip{position:absolute;z-index:24;} +.tooltip:hover{z-index:25;color:#000;} +.tooltip span.tip{display: none} + +div.tooltip:hover span.tip{ +display:block; +position:absolute; +top:12px; left:20px; width:270px; +border:1px solid #555; +background-color:#fff; +padding: 4px; +font-size: 0.8em; +color:#505050; +} + /***** CSS FORM ******/ .tabular p{ margin: 0; diff --git a/public/stylesheets/csshover.htc b/public/stylesheets/csshover.htc new file mode 100644 index 00000000..3ba936ac --- /dev/null +++ b/public/stylesheets/csshover.htc @@ -0,0 +1,120 @@ + + \ No newline at end of file -- 2.11.0