Sha256: dc029b9e320a2de87dd1b2f55a9c0279d92cf686a4ca7d3a7877a9ebec3d599c

Contents?: true

Size: 1.88 KB

Versions: 3

Compression:

Stored size: 1.88 KB

Contents

- 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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
iron_warbler-2.0.7.22 app/views/iro/positions/_gameui_covered_call.haml-bk
iron_warbler-2.0.7.21 app/views/iro/positions/_gameui_covered_call.haml-bk
iron_warbler-2.0.7.20 app/views/iro/positions/_gameui_covered_call.haml-bk