% content_for :head do %>
<%= stylesheet_link_tag "index" , :media => "all"%>
<%= stylesheet_link_tag "workArea" , :media => "all"%>
<%= stylesheet_link_tag "formtastic" , :media => "all"%>
<% end -%>
<% form_tag({:action => :update}, {:method => :put, :class => "formtastic", :id=> "edit_shifts"}) do %>
<%= hidden_field_tag :view_type, @view_type%>
<%= hidden_field_tag :empl_id, params[:empl_id]%>
<%= hidden_field_tag :date, @date%>
<%= hidden_field_tag :regular, :id => "regular" %>
<%= link_to "<", edit_work_shift_path(:id => 1, :date => (@date - 1.day), :view_type => @view_type), :method => :get, :html =>{:style =>"text-decoration:none;"} %>
Смены за <%= Russian::strftime(@date) %> (<%=Russian::strftime(@date, "%A") %>) <%= link_to ">", edit_work_shift_path(:id => 1, :date => (@date + 1.day), :view_type => @view_type), :method => :get, :html =>{:style =>"text-decoration:none;"} %>
Сотрудник
<%= check_box_tag("checked_all", value = "1", checked = false) %> | ФИО | Комментарий | Кол-во отчетов |
<% @employees.each do |person| %>
<% fields_for "employees[#{person.id}]", person do |c| -%>
<% (dm = @shifts.select{|i| i.employee == person}.first).nil? ? dm=person.work_shifts.build(:department => @department, :shift_date => @date) : dm%>
<% c.fields_for :work_shifts, dm do |e| -%>
|
<%= e.check_box :status, :class => 'people', :id => person.id.to_s+'e'%>
|
<%=h person.surname.to_s + " " + person.name.to_s + " " + person.middle_name.to_s%> |
<%= e.text_field :description, :size => 50 %> |
<%= (rs=@reports.select{|i| i.id.to_i == person.id}).size >0 ? rs.first.works_count : 0%>
<%= e.hidden_field :employee_id %>
<%= e.hidden_field :shift_date, :id => person.id.to_s+"i" %>
<%= e.hidden_field :department %>
<%= e.hidden_field :id %> |
<% end %>
<% end %>
<% end %>
<%= submit_tag "Сохранить"%>
<% end %>