Sha256: 4235b1091b3c9d8d77830ac17faa03401e79df941602ddbe66d90625fb1ac90e

Contents?: true

Size: 979 Bytes

Versions: 29

Compression:

Stored size: 979 Bytes

Contents

class PartiesController < ApplicationController
  skip_before_filter :populate_layout, :only => [:burn_down_chart, :burn_down_chart_thumbnail, :burn_down_chart_large]
  skip_before_filter :authenticate_user, :only => [:burn_down_chart, :burn_down_chart_thumbnail, :burn_down_chart_large]
  
  def burn_down_chart
    send_burn_down_chart Chart::NORMAL
  end
  
  def burn_down_chart_thumbnail
    send_burn_down_chart Chart::THUMBNAIL
  end
  
  def burn_down_chart_large
    send_burn_down_chart Chart::LARGE
  end
  
  private
  
  def send_burn_down_chart(size)
    party = Party.find(params[:id])
    if period = party.periods.select{|p| p.active?}.first || party.periods.last 
      g = period.burn_down_graph(size)
      send_data(g,
                :disposition => 'inline', 
      :type => 'image/png', 
      :filename => "burn_down_chart.png")
    else
      populate_layout
      render :file => "public/404.html", :layout => true, :status => 404
    end
  end
  
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
backlog-0.10.0 app/controllers/parties_controller.rb
backlog-0.10.1 app/controllers/parties_controller.rb
backlog-0.10.5 app/controllers/parties_controller.rb
backlog-0.10.4 app/controllers/parties_controller.rb
backlog-0.10.3 app/controllers/parties_controller.rb
backlog-0.10.2 app/controllers/parties_controller.rb
backlog-0.10.7 app/controllers/parties_controller.rb
backlog-0.10.6 app/controllers/parties_controller.rb
backlog-0.11.0 app/controllers/parties_controller.rb
backlog-0.10.8 app/controllers/parties_controller.rb
backlog-0.12.0 app/controllers/parties_controller.rb
backlog-0.12.1 app/controllers/parties_controller.rb
backlog-0.12.2 app/controllers/parties_controller.rb
backlog-0.12.3 app/controllers/parties_controller.rb
backlog-0.12.4 app/controllers/parties_controller.rb
backlog-0.13.0 app/controllers/parties_controller.rb
backlog-0.14.0 app/controllers/parties_controller.rb
backlog-0.13.1 app/controllers/parties_controller.rb
backlog-0.14.2 app/controllers/parties_controller.rb
backlog-0.14.1 app/controllers/parties_controller.rb