<% content_for :head do %> <% end %>
<% form_tag "", :method => :get do -%> <%= label_tag 'Дата с:' %><%= calendar_field_tag 'date_from', Russian::strftime(@date_from), { :class => 'plaintext', :size=> 9 }, {} %> <%= label_tag 'Дата по:' %><%= calendar_field_tag 'date_to', Russian::strftime(@date_to), { :class => 'plaintext', :size=> 9 }, {} %>
Сотрудник: <%= select_tag(:filter_empl, options_for_select(@employee.sort.insert(0, ['--- Все ---', ""]), (params[:filter_empl].to_i if params[:filter_empl]))) %> <%= button_to "Фильтр" %> <% end %>
Всего отписок: <%=@reports.length%>
<% @reports.each do |rep| %> > <% if @boss %> <% else %> <% end %> <% end %>
# Дата Сотрудник Офис Оборудование Коммент Статус Удалить
<%= rep.id %> <%=rep.date.to_datetime.strftime("%d.%m.%Y")%> <%= rep.done_materials.first.employee_name if rep.done_materials.size > 0 %> <%=rep.done_materials.map{|m| [m.material_name+(m.count.to_i > 1 ? " " +m.count.to_s + " шт. " : "")]}.join('
')%>
<%=rep.com_stay_work%><%= select_tag :status, options_for_select(Report.statuss, rep.status), {:onChange => "ChangeStatus( $(this).val(), #{rep.id})" } %> <%= button_to "Удалить", office_mat_path(rep), :method => :delete, :confirm => "Вы уверены?" %><%= rep.status_name %> <%= (button_to "Удалить", office_mats_path(rep.id), :method => :delete, :confirm => "Вы уверены?") if rep.status == 0%>