#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 end def build font_size 10 text "Plan d'actions au #{I18n.l(Date.today)}", :size => 20 move_down(10) display_tasks(@tasks) end def display_tasks(tasks) 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