Sha256: 4ea5c19c7c7eaf3a72e347715f3b6a9add457734227f6cb78f669bd513d9e56f

Contents?: true

Size: 1.66 KB

Versions: 3

Compression:

Stored size: 1.66 KB

Contents

<% @page_title = l(:weekly_work_sheet) + " " + @week.to_s + (user? ? " for #{user.login}" : '')%>

<div id="spotlight">
<% columns = 2 %>

<%=render :partial => 'weekly_work_sheet_buttons'%>

<table border="1">
  <tr>
    <th><%=l :work_account %></th>
  	<% [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday].each_with_index do |day, i| %>
    <th align="center"><%=detour_to "#{l(day)} #{week_date(i+1)}", :action => :daily_work_sheet, :id => (@first_date + i).strftime('%Y-%m-%d') %></th>
	<% end %>
    <th align="center" nowrap="true"><%=l :week %> <%=@week%></th>
  </tr>

<% week_totals = Hash.new(0) %>
<% day_totals = Array.new(7, 0) %>
<% for work_account, totals in @work_accounts %>
  <tr>
    <td valign="top">
      <%=detour_to(h(work_account.name), :controller => 'work_accounts', :action => :show, :id => work_account.id) %>
    </td>
    <% totals.each_with_index do |total, day| %>
      <% if total %>
        <% day_totals[day] += total %>
        <% week_totals[work_account] += total %>
        <td align="right" valign="top"><%='%d:%02d' % [total, 60 * total % 60]%></td>
      <% else %>
        <td/>
      <% end %>
    <% end %>
    <td align="right"><%='%d:%02d' % [week_totals[work_account], 60 * week_totals[work_account] % 60]%></td>
  </tr>
<% end %>
  <tr>
  	<th><%=l :totals%></th>
<% (0..6).each do |day| %>
    <th class="hours"><%='%d:%02d' % [day_totals[day], 60 * day_totals[day] % 60] if day_totals[day] > 0%></th>
<% end %>
<% week_total = week_totals.values.inject(0) {|total, work_account_total| total + work_account_total} %>
    <th class="hours"><%= '%d:%02d' % [week_total, 60 * week_total % 60] %></th>
  </tr>
</table>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
backlog-0.21.1 app/views/works/weekly_work_sheet_by_work_account.rhtml
backlog-0.21.2 app/views/works/weekly_work_sheet_by_work_account.rhtml
backlog-0.21.3 app/views/works/weekly_work_sheet_by_work_account.rhtml