app/pdfs/flyboy/roadmap.rb in flyboy-0.0.6 vs app/pdfs/flyboy/roadmap.rb in flyboy-1.0.0
- old
+ new
@@ -1,9 +1,12 @@
#encoding: utf-8
module Flyboy
class Roadmap < Prawn::Document
+ include ActionView::Helpers::NumberHelper
+ include Dorsale::TextHelper
+
attr_accessor :tasks
def initialize(tasks)
super(:page_layout => :landscape)
@tasks = tasks
@@ -15,20 +18,29 @@
move_down(10)
display_tasks(@tasks)
end
def display_tasks(tasks)
- display = [['Action', 'Titre', 'Echéance']]
+ display = [[
+ "Dossier",
+ "Avancement dossier",
+ "Tâche",
+ "Avancement tâche",
+ "Echéance"
+ ]]
tasks.each do |t|
display << [
t.goal.title,
+ percentage(t.goal.progress),
t.title,
+ percentage(t.progress),
I18n.l(t.term)
]
end
table display
move_down(10)
end
+
end
end