<% @task = task %> <% if @task.enable_subtasks? && @task.period.active_or_future? && active %> <% form_tag({:controller => 'tasks', :action => :specify, :id => @task}) do %> <%= image_button_to('add.png', l(:specify), :controller => 'tasks', :action => :specify, :id => @task.id)%> <% end %> <% end %> <% form_tag({:controller => 'tasks', :action => 'update', :id => @task}) do %> <%= submit_tag('checkmark', :value => l(:save), :style => 'display: none')%> <%= (" " * @task.depth * 4) if @task.depth > 0 %> <%= l @task.resolution.downcase if @task.finished_at %> <%= "-" if @task.children.size > 0 %> <% end %> class="tasks" style=cursor:move;"<%end%>> <% if @task.active? -%> <%= in_place_editor_field(:task, :description, {:id => "#{@task.id}_description", :tabindex => i}, :url => url_for(:controller => 'tasks', :action => "set_task_description", :id => @task)) %> <% else -%> <%= @task.description -%> <% end -%> <% if @task.loggable? -%> <% form_tag({:controller => 'works', :action => 'update', :id => @task.started_work(user)}) do %> <%= submit_tag('checkmark', :value => l(:save), :style => 'display: none')%> <% if @task.work_started?(user) -%> <%= text_field 'work', 'started_at_time', :tabindex => i+1, :value => @task.started_work(user).started_at.strftime('%H:%M'), :class => :task_time, :maxlength => 5, :onkeypress => "handleEvent(this, event, #{@task.id})" %> <%= image_button_to('ernes_stop.png', l(:end_work), :controller => 'tasks', :action => :end_work, :id => @task.id) %> <% elsif @task.track_times? && @task.period.active? %> <%= image_button_to 'hammer.png', l(:start_work), :controller => 'tasks', :action => :start_work, :id => @task.id %> <% end -%> <% end %> <% end -%> <% if @task.track_done? %> <% if @task.loggable? || @task.finished_at -%> <% form_tag({:controller => 'works', :action => (@task.work_started?(user) ? :edit : :create), :id => @task.started_work(user)}) do %> <%= hidden_field('work', 'task_id', :value => @task.id)%> <%= submit_tag('checkmark', :value => l(:save), :style => 'display: none')%> <% unless @task.track_times? || @task.work_started?(user) || @task.finished_at -%> <%= text_field 'work', 'hours', :tabindex => i+1, :id => "#{@task.id}_done", :class => :task_hours, :maxlength => 4, :onkeypress => "handleEvent(this, event, #{@task.id})", :ondblclick => "form.elements[1].style.display = 'inline';this.style.display = 'none'" -%> <% end -%> <%=t @task.total_done if @task.total_done != 0%> <% end -%> <% end -%> <% end -%> <% if @task.loggable? -%> <% form_tag({:controller => 'estimates', :action => 'create', :id => @task}) do %> <%= submit_tag('checkmark', :value => l(:save), :style => 'display: none')%> <% if @task.track_todo? %> <% if @task.period.active? %> <%= text_field 'estimate', 'todo', :tabindex => i+2, :id => "#{@task.id}_todo", :value => @task.todo, :class => :task_hours, :maxlength => 4, :onkeypress => "handleEvent(this, event, #{@task.id})" %> <% else %> <%= @task.todo %> <% end %> <% end -%> <% if (not @task.track_times?) && !@task.work_started?(user) && @task.period.active? %> <%= image_button_to('checkmark.png', l(:complete), :controller => 'tasks', :action => :finish, :id => @task)%> <% end -%> <% end -%> <% end -%> <% form_tag({:controller => 'tasks', :action => 'update', :id => @task}) do %> <% if @task.active? %> <% if @task.loggable? %> <% unless @task.work_started?(user) %> <%= image_button_to('arrow_right.png', l(:move_to_next_period), :controller => 'tasks', :action => :move_to_next_period, :id => @task)%> <%= image_button_to('ernes_stop.png', l(:abort), :controller => 'tasks', :action => :abort, :id => @task)%> <% end %> <% end %> <% elsif not @task.period.passed? && @task.leaf? %> <%=image_button_to('/images/eraser.png', l(:reopen), :controller => 'tasks', :action => :reopen, :id => @task) %> <% end -%> <% end -%> <% if active && @task.period.active_or_future? %> <%= draggable_element "#{@task.id}", :revert => true, :constraint => "'vertical'" %> <%= drop_receiving_element "#{@task.id}", :update => "spotlight", :url => {:controller => 'tasks', :action => "move_to", :position => @task.position}, :accept => "tasks", :loading => "", :complete => "", :hoverclass => 'highlight' %> <% end %> <% for subtask in task.children %> <%=render :partial => '/tasks/task', :locals => { :task => subtask, :i => i, :active => active } if (active && subtask.active?) || (!active && subtask.completed?) %> <% i += 1 %> <% end %>