colonizers/colonizers

View on GitHub
packages/colonizers-client/lib/components/trade-modal.html

Summary

Maintainability
Test Coverage
<div class="modal fade" id="tradeModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title">Trade</h4>
      </div>
      <div class="modal-body">

        <p>Offering a trade to other players.</p>

        <div class="row">
          <div class="col-xs-3">
            Want
          </div>
          <div class="col-xs-6">
          </div>
          <div class="col-xs-3">
            Give
          </div>
        </div>

        <div data-bind="foreach: resources">

          <div class="row" data-bind="css: key">
            <div class="col-xs-3" data-bind="text: want">
            </div>
            <div class="col-xs-6">

              <div class="input-group">
                <span class="input-group-btn">
                  <button class="btn btn-default" type="button" data-bind="click: wantUp">&#10094;</button>
                </span>
                <input type="text" class="form-control" data-bind="value: inventory">
                <span class="input-group-btn">
                  <button class="btn btn-default" type="button" data-bind="click: giveUp">&#10095;</button>
                </span>
              </div>

            </div>
            <div class="col-xs-3" data-bind="text: give">
            </div>
          </div>

        </div>

      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary"
          data-bind="click: offerTrade">Offer trade</button>
      </div>
    </div>
  </div>
</div>