lib/pt/ui.rb in pt-0.3.4 vs lib/pt/ui.rb in pt-0.3.5
- old
+ new
@@ -160,10 +160,18 @@
else
congrats("Task accepted, hooray!")
end
end
+ def show
+ title("Tasks for #{user_s} in #{project_to_s}")
+ tasks = @client.get_my_work(@project, @local_config[:user_name])
+ table = PT::TasksTable.new(tasks)
+ task = select("Please select a story to show", table)
+ result = show_task(task)
+ end
+
def reject
title("Tasks for #{user_s} in #{project_to_s}")
tasks = @client.get_my_tasks_to_reject(@project, @local_config[:user_name])
table = PT::TasksTable.new(tasks)
task = select("Please select a story to mark it as rejected", table)
@@ -295,8 +303,17 @@
"#{@local_config[:user_name]} (#{@local_config[:user_initials]})"
end
def project_to_s
"Project #{@local_config[:project_name].upcase}"
+ end
+
+ def show_task(task)
+ title task.name
+ estimation = task.estimate == -1 ? "Unestimated" : "#{task.estimate} points"
+ message "#{task.current_state.capitalize} #{task.story_type} | #{estimation} | Req: #{task.requested_by} | Owns: #{task.owned_by}"
+ message task.description if task.description.any?
+ task.tasks.all.each{ |t| message "- #{t.complete ? "(done) " : "(pend)"} #{t.description}" }
+ task.notes.all.each{ |n| message "#{n.author}: \"#{n.text}\"" }
end
end
\ No newline at end of file