-## Good, remove trash, leave as implemented. -# - left = "#{ (stock.last - pos.inner_strike - pos.begin_inner_price) * u}px" -# - width = "#{ pos.begin_inner_price * u}px" - unit = u = 50 # pixels per dollar - grid_size = 100 # dollars to each side of origin .purses-gameui.padded = render '/iro/purses/header', purse: @purse - @positions.each_with_index do |position, idx| - stock = position.stock - if idx == 0 %h4= stock - else - prev_ = @positions[idx-1] - if stock != prev_.stock %hr %h4= stock .header = position.quantity = stock = position.expires_on.to_datetime.strftime("%b %d") = link_to '[roll]', roll_position_path(position) = link_to '[~]', edit_position_path(position) - nearest_strike = stock.last.round .StockCoordinatesW .StockCoordinates .grid-mark.mark0 .label= nearest_strike - (1...grid_size).each_with_index do |idx| .grid-mark{ class: "mark#{idx}", style: "left: -#{idx * u}px" } .label = nearest_strike + idx .grid-mark{ class: "mark-#{idx}", style: "left: #{idx * u}px" } .label = nearest_strike - idx .Origin{ style: "left: #{ ( nearest_strike - stock.last )* u}px" } .label Last: = stock.last - left = "#{ (stock.last - position.inner_strike - position.begin_inner_price) * u}px" - width = "#{ position.begin_inner_price * u}px" .PositionW{ style: "left: #{left}; width: #{width}; " } .Position - if position.net_amount >= 0 .Net.NetPositive{ style: "width: #{ (position.net_amount / 100) * u }px; right: 0" } .label net = pp_amount position.net_amount - else .Net.NetNegative{ style: "width: #{ (-1 * position.net_amount / 100) * u }px; left: 100%" } .label net = pp_amount position.net_amount %br %br