Skip to content

Commit

Permalink
Merge pull request #124 from MakerDAO/113-cancel-order-2-modals
Browse files Browse the repository at this point in the history
Cancel order no longer shows 2 modals
  • Loading branch information
jorisbontje committed May 21, 2016
2 parents ea2d009 + 1f02a53 commit 9b7a744
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions frontend/client/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ <h1>
{{#if contractExists}}
<div class=row>
<section>
{{> orderbook title='Buy orders' subtitle=(concat '(click to sell ' baseCurrency ')') priceLabel='Bid Price' priceClass='bid' orders=(findOffers 'bid')}}
{{> orderbook title='Buy orders' subtitle=(concat '(click to sell ' baseCurrency ')') priceLabel='Bid Price' priceClass='bid' orders=(findOffers 'bid') canAccept=true}}
</section>
<section>
{{> orderbook title='Sell orders' subtitle=(concat '(click to buy ' baseCurrency ')') priceLabel='Ask Price' priceClass='ask' orders=(findOffers 'ask')}}
{{> orderbook title='Sell orders' subtitle=(concat '(click to buy ' baseCurrency ')') priceLabel='Ask Price' priceClass='ask' orders=(findOffers 'ask') canAccept=true}}
</section>
</div>
<div class=row>
Expand Down
2 changes: 1 addition & 1 deletion frontend/client/templates/myorders.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2>

<div class="tab-content">
<div role="tabpanel" class="tab-pane active o" id="myorders">
{{> orders orders=(findOffers 'mine') priceLabel='Price'}}
{{> orders orders=(findOffers 'mine') priceLabel='Price' showCancel=true}}
</div>
<div role="tabpanel" class="tab-pane o" id="lasttrades">
{{> orders orders=lastTrades priceLabel='Price'}}
Expand Down
3 changes: 0 additions & 3 deletions frontend/client/templates/offermodal.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ <h4 class="modal-title">Offer</h4>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
{{#if offer}}
{{#if offer.isMine}}
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#cancelModal" disabled={{not offer.canCancel}}>Cancel Order</button>
{{/if}}
<button type="button" class="btn btn-primary" data-dismiss="modal" {{b "enable: canBuy, click: buy"}}>
{{#if equals offer.type 'bid'}}Sell{{else}}Buy{{/if}} {{baseCurrency}}
</button>
Expand Down
2 changes: 1 addition & 1 deletion frontend/client/templates/orderbook.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ <h2>
</h2>

<div class=o>
{{> orders orders=orders priceLabel=priceLabel priceClass=priceClass}}
{{> orders orders=orders priceLabel=priceLabel priceClass=priceClass canAccept=canAccept}}
</div>
</template>
6 changes: 5 additions & 1 deletion frontend/client/templates/orderrow.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<td>{{formatBalance (order.volume baseCurrency)}}</td>
<td>
{{#if order.canCancel}}
[<a href="#" class="cancel">x</a>]
{{#if showCancel}}
<button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-remove cancel" aria-hidden="true"></span>
</button>
{{/if}}
{{/if}}
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion frontend/client/templates/orderrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Template.orderRow.events({
},
'click tr': function (event, template) {
event.preventDefault()
if (template.data.order.event !== 'Trade') {
if (template.data.canAccept) {
var _id = template.data.order._id
Session.set('selectedOffer', _id)
$('#offerModal').modal('show')
Expand Down
3 changes: 1 addition & 2 deletions frontend/client/templates/orders.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
<th title={{concat quoteCurrency ' / ' baseCurrency}} class={{priceClass}}>{{priceLabel}}</th>
<th>{{quoteCurrency}}</th>
<th>{{baseCurrency}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{#each orders}}
{{> orderRow order=this}}
{{> orderRow order=this canAccept=../canAccept showCancel=../showCancel}}
{{/each}}
</tbody>
</table>
Expand Down

0 comments on commit 9b7a744

Please sign in to comment.