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

<%=l :task%>:
<%=select 'work', 'task_id', [['', '']] + @tasks.map{|task| [task.description_with_parents, task.id]}.sort %> <% if @work.task %> <%=image_detour_to 'task.png', l(:edit_task), :controller => 'tasks', :action => :edit, :id => @work.task.id %> <% end %> <%=detour_to l(:new_task), :controller => 'tasks', :action => :new %>

<%=l :description%>:
<%=text_field 'work', 'description' %>

<% 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.track_done?%>


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


<%=image_link_to_remote 'refresh.png', l(:refresh), {:url => {:action => :calculate_hours}, :with => "'started_at=' + $('work_started_at').value + '&completed_at=' + $('work_completed_at').value"} %>

<% 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 %>