calendar.rhtml
73 lines
| 2.9 KiB
| text/html+ruby
|
RhtmlLexer
|
r42 | <h2><%= l(:label_calendar) %></h2> | |
|
r181 | <% form_tag({:action => 'calendar', :id => @project}) do %> | |
|
r42 | <table width="100%"> | |
<tr> | |||
|
r147 | <td align="left" style="width:150px"> | |
|
r71 | <%= link_to_remote ('« ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")), | |
{:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }}, | |||
{:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))} | |||
%> | |||
|
r42 | </td> | |
|
r71 | <td align="center"> | |
<%= select_month(@month, :prefix => "month", :discard_type => true) %> | |||
<%= select_year(@year, :prefix => "year", :discard_type => true) %> | |||
<%= submit_tag l(:button_submit), :class => "button-small" %> | |||
</td> | |||
|
r147 | <td align="right" style="width:150px"> | |
|
r71 | <%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' »'), | |
{:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }}, | |||
{:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))} | |||
%> | |||
|
r42 | </td> | |
</tr> | |||
</table> | |||
|
r181 | <% end %> | |
|
r42 | <br /> | |
|
r105 | <table class="list with-cells"> | |
<thead> | |||
<tr> | |||
<th></th> | |||
|
r42 | <% 1.upto(7) do |d| %> | |
|
r147 | <th style="width:14%"><%= day_name(d) %></th> | |
|
r42 | <% end %> | |
</tr> | |||
|
r105 | </thead> | |
<tbody> | |||
|
r147 | <tr style="height:100px"> | |
|
r42 | <% day = @date_from | |
while day <= @date_to | |||
if day.cwday == 1 %> | |||
|
r105 | <th><%= day.cweek %></th> | |
|
r42 | <% end %> | |
|
r158 | <td valign="top" class="<%= day.month==@month ? "even" : "odd" %>" style="width:14%; <%= Date.today == day ? 'background:#FDFED0;' : '' %>"> | |
|
r147 | <p class="textright"><%= day==Date.today ? "<b>#{day.day}</b>" : day.day %></p> | |
|
r42 | <% day_issues = [] | |
@issues.each { |i| day_issues << i if i.start_date == day or i.due_date == day } | |||
|
r158 | day_issues.each do |i| %> | |
<div class="tooltip"> | |||
|
r42 | <%= if day == i.start_date and day == i.due_date | |
|
r154 | image_tag('arrow_bw.png') | |
|
r42 | elsif day == i.start_date | |
|
r154 | image_tag('arrow_from.png') | |
|
r42 | elsif day == i.due_date | |
|
r154 | image_tag('arrow_to.png') | |
|
r42 | end %> | |
|
r158 | <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> | |||
|
r42 | <% end %> | |
</td> | |||
|
r147 | <%= '</tr><tr style="height:100px">' if day.cwday >= 7 and day!=@date_to %> | |
|
r42 | <% | |
day = day + 1 | |||
end %> | |||
</tr> | |||
|
r105 | </tbody> | |
|
r42 | </table> | |
|
r154 | <%= image_tag 'arrow_from.png' %> <%= l(:text_tip_task_begin_day) %><br /> | |
<%= image_tag 'arrow_to.png' %> <%= l(:text_tip_task_end_day) %><br /> | |||
<%= image_tag 'arrow_bw.png' %> <%= l(:text_tip_task_begin_end_day) %><br /> |