<%= render partial: 'tech_bonuses/styles' %>
<% if User.current.admin? %> <%= link_to sprite_icon('user', l(:label_bonus_technician_plural)), bonus_technicians_path, class: 'icon icon-user' %> <%= link_to sprite_icon('settings', l(:label_settings)), plugin_settings_path('redmine_qbo_bonus'), class: 'icon icon-settings' %> <% end %>

<%= l(:label_tech_bonus_plural) %>

<%= form_tag(tech_bonuses_path, method: :get, id: 'tech-bonus-week-picker', class: 'tech-bonus-picker') do %> <%= select_tag 'week', options_for_select(@weeks.map { |week| [bonus_week_title(week), week.to_param] }, @week.to_param), id: 'tech_bonus_week' %> <%= submit_tag l(:button_tech_bonus_preview), name: nil %> <% end %>

<%= l(:label_tech_bonus_history) %>

<% if @bonus_weeks.empty? %>

<%= l(:label_no_data) %>

<% else %>
<% @bonus_weeks.each do |bonus_week| %> <% end %>
<%= l(:label_tech_bonus_week) %> <%= l(:label_tech_bonus_hours_total_goal) %> <%= l(:label_tech_bonus_tiers) %> <%= l(:label_tech_bonus_credits) %> <%= l(:label_tech_bonus_amount) %> <%= l(:label_tech_bonus_run_by) %>
<%= link_to bonus_week_title(bonus_week.week), tech_bonus_week_path(bonus_week.week.to_param) %> <%= bonus_hours(bonus_week.total_hours) %>/<%= bonus_hours(bonus_week.goal_hours) %> <%= bonus_week.tiers %> <%= bonus_week.credits.count(&:credited?) %> <% failed = bonus_week.credits.count { |credit| credit.status == 'failed' } %> <% if failed.positive? %>(<%= l(:label_tech_bonus_failed_count, count: failed) %>)<% end %> <%= bonus_money(bonus_week.credited_total) %> <%= bonus_week.run_by ? link_to_user(bonus_week.run_by) : '' %> <%= format_time(bonus_week.updated_at) %>
<% end %> <% html_title l(:label_tech_bonus_plural) %>