Sha256: 62314409fee01fbee3c73ab577a32fd4fb48bd09c9004f5e42c8fe84c47b2ce9

Contents?: true

Size: 863 Bytes

Versions: 8

Compression:

Stored size: 863 Bytes

Contents

#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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
flyboy-1.0.7 app/pdfs/flyboy/roadmap.rb
flyboy-1.0.6 app/pdfs/flyboy/roadmap.rb
flyboy-1.0.5 app/pdfs/flyboy/roadmap.rb
flyboy-1.0.4 app/pdfs/flyboy/roadmap.rb
flyboy-1.0.3 app/pdfs/flyboy/roadmap.rb
flyboy-1.0.2 app/pdfs/flyboy/roadmap.rb
flyboy-1.0.1 app/pdfs/flyboy/roadmap.rb
flyboy-1.0.0 app/pdfs/flyboy/roadmap.rb