Skip to content

Instantly share code, notes, and snippets.

@dchapman1988
Created June 24, 2011 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dchapman1988/1044013 to your computer and use it in GitHub Desktop.
Save dchapman1988/1044013 to your computer and use it in GitHub Desktop.
%h2 Admin Control Panel
%br/
%div{ :style => "float:left;" }
%h3 Add stocks
%br/
= form_tag(new_admin_stock_path, :method => :get) do
= label_tag(:symbol, "Symbols")
%br/
= text_area_tag(:symbol, nil, :cols => 30, :rows => 10)
%br/
= "(seperate with comma)"
%br/
%br/
= submit_tag("Add Stock")
%div{ :style => "float:right;" }
%div{:style => "width:auto;overflow:hidden;"}
%br/
.clear
= form_tag update_multiple_admin_stocks_path do
= submit_tag 'Update selected'
= submit_tag 'Remove selected', :confirm => "You sure?"
%br/
%br/
= link_to_function 'Select all', "$('.stocks .checkable').trigger('click');"
%table.stocks
%thead
%tr
%th Remove
%th Company Name
%th Symbol
%th Last Price
%th Ex Date
%th Pay Date
%th Yield
%th.last Dividend / share
%tbody
- @stocks.each do |s|
%tr{ :class => cycle("odd", "even") }
%td
= check_box_tag("selected[#{s.id}]", s.id, checked = false, :class => "checkable")
%td
= link_to s.try(:company_name), stock_path(s)
%td
= s.try(:symbol)
%td
= s.quotes.last.try(:last_price)
%td
= s.quotes.last.try(:ex_dividend_date)
%td
= s.quotes.last.try(:dividend_pay_date)
%td
= s.quotes.last.try(:dividend_yield)
%td.last
= s.quotes.last.try(:dividends_per_share)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment