Commit 51ea8b02 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

tooltips added on calendar

git-svn-id: http://redmine.rubyforge.org/svn/trunk@161 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent f35194e6
......@@ -463,7 +463,7 @@ class ProjectsController < ApplicationController
# finish on sunday
@date_to = @date_to + (7-@date_to.cwday)
@issues = @project.issues.find(:all, :include => :tracker, :conditions => ["((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", @date_from, @date_to, @date_from, @date_to])
@issues = @project.issues.find(:all, :include => [:tracker, :status, :assigned_to, :priority], :conditions => ["((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", @date_from, @date_to, @date_from, @date_to])
render :layout => false if request.xhr?
end
......@@ -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", :include => [:tracker, :status, :author, :priority], :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_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, :assigned_to, :priority], :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_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 ||= {}
......
......@@ -56,12 +56,12 @@ module IssuesHelper
unless no_html
label = content_tag('strong', label)
old_value = content_tag("i", h(old_value)) if old_value
old_value = content_tag("strike", h(old_value)) if old_value and !value
old_value = content_tag("i", h(old_value)) if detail.old_value
old_value = content_tag("strike", old_value) if detail.old_value and (!detail.value or detail.value.empty?)
value = content_tag("i", h(value)) if value
end
if value
if detail.value and !detail.value.empty?
if old_value
label + " " + l(:text_journal_changed, old_value, value)
else
......
<%= link_to "#{issue.tracker.name} ##{issue.id}", { :controller => 'issues', :action => 'show', :id => issue } %></strong>: <%=h issue.subject %><br />
<br />
<strong><%= l(:field_start_date) %></strong>: <%= format_date(issue.start_date) %><br />
<strong><%= l(:field_due_date) %></strong>: <%= format_date(issue.due_date) %><br />
<strong><%= l(:field_assigned_to) %></strong>: <%= issue.assigned_to ? issue.assigned_to.name : "-" %><br />
<strong><%= l(:field_priority) %></strong>: <%= issue.priority.name %>
......@@ -41,11 +41,12 @@ while day <= @date_to
if day.cwday == 1 %>
<th><%= day.cweek %></th>
<% end %>
<td valign="top" style="width:14%" class="<%= day.month==@month ? "even" : "odd" %>">
<td valign="top" class="<%= day.month==@month ? "even" : "odd" %>" style="width:14%; <%= Date.today == day ? 'background:#FDFED0;' : '' %>">
<p class="textright"><%= day==Date.today ? "<b>#{day.day}</b>" : day.day %></p>
<% day_issues = []
@issues.each { |i| day_issues << i if i.start_date == day or i.due_date == day }
day_issues.each do |i| %>
day_issues.each do |i| %>
<div class="tooltip">
<%= if day == i.start_date and day == i.due_date
image_tag('arrow_bw.png')
elsif day == i.start_date
......@@ -53,7 +54,11 @@ while day <= @date_to
elsif day == i.due_date
image_tag('arrow_to.png')
end %>
<small><%= link_to "#{i.tracker.name} ##{i.id}", { :controller => 'issues', :action => 'show', :id => i }, :title => "#{i.subject}" %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
<small><%= link_to "#{i.tracker.name} ##{i.id}", { :controller => 'issues', :action => 'show', :id => i } %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small>
<span class="tip">
<%= render :partial => "issues/tooltip", :locals => { :issue => i }%>
</span>
</div>
<% end %>
</td>
<%= '</tr><tr style="height:100px">' if day.cwday >= 7 and day!=@date_to %>
......
......@@ -196,13 +196,9 @@ top = headers_heigth + 10
<%= (i.done_ratio).to_i %>%
</div>
<% # === tooltip === %>
<div style="position: absolute;top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;height:12px;" class="tooltip"><span class="tip">
<strong><%= "#{i.tracker.name} ##{i.id}" %></strong>: <%=h i.subject %><br />
<br />
<strong><%= l(:field_start_date) %></strong>: <%= format_date(i.start_date) %><br />
<strong><%= l(:field_due_date) %></strong>: <%= format_date(i.due_date) %><br />
<strong><%= l(:field_assigned_to) %></strong>: <%= i.assigned_to ? i.assigned_to.name : "-" %><br />
<strong><%=l(:field_priority)%></strong>: <%= i.priority.name %>
<div class="tooltip" style="position: absolute;top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;height:12px;">
<span class="tip">
<%= render :partial => "issues/tooltip", :locals => { :issue => i }%>
</span></div>
<% top = top + 20
end %>
......
......@@ -558,14 +558,14 @@ font-size: 1em;
.task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; }
/***** Tooltips ******/
.tooltip{position:absolute;z-index:24;}
.tooltip{position:relative;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;
top:12px; left:24px; width:270px;
border:1px solid #555;
background-color:#fff;
padding: 4px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment