<%=l :work_account%>:
<%= select 'work', 'work_account_id', @work_accounts.map{|wa| [wa.name, wa.id]}.sort %> <% if @work.work_account -%> <%=image_detour_to('work_account.png', "#{l(:work_account)} #{@work.work_account.name}", {:controller => 'work_accounts', :action => :edit, :id => @work.work_account}, {:class => 'image-submit', :style => 'vertical-align: bottom'}) %> <% end -%> <%=detour_to l(:new_work_account), :controller => 'work_accounts', :action => :new %>

<%=l :task%>:
<% if @work.task %>

<%=link_to @work.task.description, :controller => 'tasks', :action => :edit, :id => @work.task.id %>

<%= hidden_field 'work', 'task_id' %> <% else %> <%= select 'work', 'task_id', [['', '']] + @tasks.map{|task| [task.description_with_parents, task.id]}.sort %>

<% end %> <% if @work.task.nil? || @work.task.track_times?%>


<%= text_field 'work', 'started_at', :size => 16, :value => @work.started_at ? @work.started_at.strftime('%Y-%m-%d %H:%M') : nil %>


<%= text_field 'work', 'completed_at', :size => 16, :value => (@work.completed_at && @work.completed_at.strftime('%Y-%m-%d %H:%M')) %>

<% end %> <% if @work.task.nil? || @work.task.enable_users? %>


<%= select 'work', 'user_id', @users.map{|user| [user.login, user.id]} %>

<% end %> <% if @work.task.nil? || @work.task.track_done?%>


<%= text_field 'work', 'hours_time', :class => :task_hours, :value => t(@work.hours) %>

<% end %> <% if @work.task.nil? || @work.task.enable_invoicing? %>


<%= check_box 'work', 'invoice' %>

<% end %>
<% if params[:estimate] %> <% if @work.task.nil? || @work.task.track_todo?%>


<%= text_field 'estimate', 'todo', :class => :task_hours %> <%= image_tag('checkmark.png', :onclick => "document.getElementById('estimate_todo').value='0'", :style => 'vertical-align: bottom; height: 24px; float: none')%>

<% else %>


<%= check_box 'estimate', 'todo', {:checked => @estimate.todo == 0}, 0, 1 %>

<% end %> <% end %>