<%=@user.name%>
<%= form_for @history, url: create_history_admin_ruling_timers_path(@history), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<%= f.hidden_field :user_id%> <%= f.hidden_field :time_offset, :id=>"history_timeoffset" %>
<%= t("ruling_timer.date") %>
<%= f.datetime_picker :date, {:picker_type=>"date",:no_label=>true,:format=>"yyyy/MM/dd"} %>
<%= t("ruling_timer.summary") %>
<%= f.text_area :summary,:id=>"edit_summary" %>
<%=t("ruling_timer.work_time")%>
<% work_times = @history.get_work_times(true) %> <% work_times.each_with_index do |t,i| %> <% if i % 2 == 0 next_t = work_times[i+1] else next end %>
X
<%= f.text_field_tag "#{f.object_name}[work_times][]", t ,:id=>nil %> ~ <%= f.text_field_tag "#{f.object_name}[work_times][]", next_t ,:id=>nil %>
<% end %>
<%=t(:add)%>
<% referer = request.referer rescue nil %> <% referer = get_referer_url if referer.blank? || request.host != URI.parse(URI.encode(referer)).host %> <%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), referer, :class=>"btn" %>
<% end %>