tooltips added on calendar

git-svn-id: http://redmine.rubyforge.org/svn/trunk@161 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-01-13 10:36:18 +00:00
parent f35194e604
commit 51ea8b0295
6 changed files with 24 additions and 17 deletions

View File

@ -463,7 +463,7 @@ class ProjectsController < ApplicationController
# finish on sunday # finish on sunday
@date_to = @date_to + (7-@date_to.cwday) @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? render :layout => false if request.xhr?
end end
@ -485,7 +485,7 @@ class ProjectsController < ApplicationController
@date_from = Date.civil(@year_from, @month_from, 1) @date_from = Date.civil(@year_from, @month_from, 1)
@date_to = (@date_from >> @months) - 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' if params[:output]=='pdf'
@options_for_rfpdf ||= {} @options_for_rfpdf ||= {}

View File

@ -56,12 +56,12 @@ module IssuesHelper
unless no_html unless no_html
label = content_tag('strong', label) label = content_tag('strong', label)
old_value = content_tag("i", h(old_value)) if old_value old_value = content_tag("i", h(old_value)) if detail.old_value
old_value = content_tag("strike", h(old_value)) if old_value and !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 value = content_tag("i", h(value)) if value
end end
if value if detail.value and !detail.value.empty?
if old_value if old_value
label + " " + l(:text_journal_changed, old_value, value) label + " " + l(:text_journal_changed, old_value, value)
else else

View File

@ -0,0 +1,6 @@
<%= 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 %>

View File

@ -41,11 +41,12 @@ while day <= @date_to
if day.cwday == 1 %> if day.cwday == 1 %>
<th><%= day.cweek %></th> <th><%= day.cweek %></th>
<% end %> <% 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> <p class="textright"><%= day==Date.today ? "<b>#{day.day}</b>" : day.day %></p>
<% day_issues = [] <% day_issues = []
@issues.each { |i| day_issues << i if i.start_date == day or i.due_date == day } @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 <%= if day == i.start_date and day == i.due_date
image_tag('arrow_bw.png') image_tag('arrow_bw.png')
elsif day == i.start_date elsif day == i.start_date
@ -53,7 +54,11 @@ while day <= @date_to
elsif day == i.due_date elsif day == i.due_date
image_tag('arrow_to.png') image_tag('arrow_to.png')
end %> 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 %> <% end %>
</td> </td>
<%= '</tr><tr style="height:100px">' if day.cwday >= 7 and day!=@date_to %> <%= '</tr><tr style="height:100px">' if day.cwday >= 7 and day!=@date_to %>

View File

@ -196,13 +196,9 @@ top = headers_heigth + 10
<%= (i.done_ratio).to_i %>% <%= (i.done_ratio).to_i %>%
</div> </div>
<% # === tooltip === %> <% # === tooltip === %>
<div style="position: absolute;top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;height:12px;" class="tooltip"><span class="tip"> <div class="tooltip" style="position: absolute;top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;height:12px;">
<strong><%= "#{i.tracker.name} ##{i.id}" %></strong>: <%=h i.subject %><br /> <span class="tip">
<br /> <%= render :partial => "issues/tooltip", :locals => { :issue => i }%>
<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 %>
</span></div> </span></div>
<% top = top + 20 <% top = top + 20
end %> end %>

View File

@ -558,14 +558,14 @@ font-size: 1em;
.task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; } .task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; }
/***** Tooltips ******/ /***** Tooltips ******/
.tooltip{position:absolute;z-index:24;} .tooltip{position:relative;z-index:24;}
.tooltip:hover{z-index:25;color:#000;} .tooltip:hover{z-index:25;color:#000;}
.tooltip span.tip{display: none} .tooltip span.tip{display: none}
div.tooltip:hover span.tip{ div.tooltip:hover span.tip{
display:block; display:block;
position:absolute; position:absolute;
top:12px; left:20px; width:270px; top:12px; left:24px; width:270px;
border:1px solid #555; border:1px solid #555;
background-color:#fff; background-color:#fff;
padding: 4px; padding: 4px;