Sha256: 7af176aff60e04c35a8ead5f17ca0ba9c923919ca40d29cf34139e976a2319b2

Contents?: true

Size: 1.68 KB

Versions: 2

Compression:

Stored size: 1.68 KB

Contents

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

<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| %>
	<% day_totals[day] += 8 if @absences[day] %>
    <th class="hours"><%='%d:%02d' % [day_totals[day], 60 * day_totals[day] % 60] if day_totals[day] > 0%></th>
<% end %>
<% week_total = day_totals.inject(0) {|total, day_total| total + day_total} %>
    <th class="hours"><%= '%d:%02d' % [week_total, 60 * week_total % 60] %></th>
  </tr>
</table>
</div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
backlog-0.28.0 app/views/works/weekly_work_sheet_by_work_account.rhtml
backlog-0.29.0 app/views/works/weekly_work_sheet_by_work_account.rhtml