Skip to content

Instantly share code, notes, and snippets.

View c3mediagroup's full-sized avatar

Robert Pierce c3mediagroup

View GitHub Profile
~/www/railsmachine/statusroom(11-update-premium-views) > ls -alh /usr/local/src/ruby-1.8.6-p287
total 18048
drwxr-xr-x 156 rpierce2 admin 5.2K Jun 7 09:12 .
drwxrwxr-x 38 root admin 1.3K Jun 1 07:05 ..
-rw-r--r-- 1 rpierce2 admin 438B Feb 12 2007 .cvsignore
-rw-r--r-- 1 rpierce2 admin 329B Feb 12 2007 .document
drwxr-xr-x 5 rpierce2 admin 170B Jun 7 09:03 .ext
-rw-r--r-- 1 root admin 44K Jun 7 09:13 .installed.list
-rw-r--r-- 1 rpierce2 admin 0B Jun 7 09:12 .rbconfig.time
-rw-r--r-- 1 rpierce2 admin 2.4K Feb 12 2007 COPYING
Feature: Advisor Performance Feature
In order to show advisor performance
As an application user
I should be able to see accurate advisor performance data
Scenario: User views advisor's current premium status
Given I am an authorized user
When I view an advisor's Current Status Indicator mini-panel
Then I should see the amount of his current premium ytd
And the current premium ytd should match the table number
----------------------------------------------------------------------------------------------------
* executing "sudo -p 'sudo password: ' RAILS_ROOT=/srv/statusroom/releases/20090608213304 RAILS_ENV=production shadow_puppet /srv/statusroom/releases/20090608213304/app/manifests/application_manifest.rb"
servers: ["staging.statusroom.c3media.managedmachine.com"]
[staging.statusroom.c3media.managedmachine.com] executing command
** [out :: staging.statusroom.c3media.managedmachine.com] /usr/lib/ruby/gems/1.8/gems/facter-1.5.4/lib/facter/util/loader.rb:72: command not found:
** [out :: staging.statusroom.c3media.managedmachine.com] Uncaught exception
** [out :: staging.statusroom.c3media.managedmachine.com]
** [out :: staging.statusroom.c3media.managedmachine.com] NameError
** [out :: staging.statusroom.c3media.managedmachine.com]
** [out :: staging.statusroom.c3media.managedmachine.com] uninitialized constant Configatron
~/www/railsmachine/statusroom(stable_edge) > git log
commit bee48814f4078969f2dfe56249cb3cc329410ec2
Merge: 85e18e7... 4c9a054...
Author: Robert Pierce <[email protected]>
Date: Mon Jun 8 15:41:10 2009 -0700
Merge branch 'stable_edge' of [email protected]:railsmachine/statusroom into stable_edge
commit 85e18e7b250adec9928ae9c667e543278f406ede
Merge: f89c508... ce6ed09...
~/www/railsmachine/statusroom(dev_robert) > git push origin dev_robert:stable_edge ; cap staging deploy
Total 0 (delta 0), reused 0 (delta 0)
To [email protected]:c3mediagroup/statusroom.git
382c243..15a8e7b dev_robert -> stable_edge
* executing `staging'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
* executing `deploy:update'
** transaction: start
def premiums
# Chart used for Agency, Unit and Producer Run Rate charts.
# Use this as a template for cleaning up/creating other chart methods.
require 'enumerator'
whom = current_account
whom = User.find(params[:advisor_id]) if params[:advisor_id]
whom = Team.find(params[:team_id]) if params[:team_id]
goal = whom.premiums_goal(@year_num)
def apr_status_indicator(advisor)
# Version that matches feature. Expanding status possibilities to match clubsumm field
# qualified, on_target, not_on_target
status = advisor.apr_status.blank? ? "not_found" : advisor.apr_status
image_tag "icons/#{status}.png", :size => "16x16", :class => "tooltip", :title => status.humanize
end
def advisor
advisor = User.advisor.find(params[:id])
category = params[:category]
case category
when 'fixed'
chart_years = advisor.fixed_product_years.find_all_by_year(@year_num)
chart_yaml = "advisor_runrate"
when 'combined'
chart_years = advisor.combined_product_years.find_all_by_year(@year_num)
chart_yaml = "advisor_runrate_combined"
#left
-if current_account.dashboard_news.present?
.information{:style => "height:auto"}
.title Current News
.content= current_account.dashboard_news
%br.clear
#top_producers.section
.title<
%h3<
class DashboardController < ApplicationController
def index
# @charts = OrderedHash.new
# @charts['Overall Performance'] = Chart.new(current_account.categorical_years.for(@year_num)).generate(:size => '310x220')
# @charts['Fixed Products'] = Chart.new(current_account.fixed_product_years.for(@year_num)).generate(:size => '310x220')
# @top_producers_premium = PaymentEvent.year(Time.now.year).sum_total.all(:order => "total DESC", :limit => 10, :include => :advisor)
@top_producers_premium = PaymentEvent.year(Time.now.year).sum_total.all(:order => "total DESC", :limit => 10, :include => :advisor).collect{|prem| p [prem.advisor_id, prem.total] }