From 4cf1517b438f16ed0344ef09a72b703d33c25fda Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 8 Nov 2014 12:06:33 +0100 Subject: [PATCH] Show message if there are tasks but no active tasks Show links to the task form of each of these tasks so that time can be registered there. --- stoptime.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stoptime.rb b/stoptime.rb index c51a9c1..332b961 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -1788,6 +1788,16 @@ module StopTime::Views text! "No projects/tasks found! Create one " + "#{a "here", :href => R(CustomersNTasksNew, customer.id)}." end + elsif @active_tasks[customer].empty? + p do + text! "No active projects/tasks found! " + + "Register time on one of these tasks: " + br + @tasks[customer].each do |task| + a task.name, :href => R(CustomersNTasksN, customer.id, task.id) + text! "·" unless task == @tasks[customer].last + end + end else table.table.table_condensed do col.task