Skip to content

Commit

Permalink
Merge pull request #315 from savoirfairelinux/fix-regresion
Browse files Browse the repository at this point in the history
Fix regresion in the order/list, (sorry for that I made a mistake
  • Loading branch information
manumilou authored Aug 5, 2016
2 parents 39e3e85 + 9b819a0 commit f433a31
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 33 deletions.
60 changes: 38 additions & 22 deletions django/santropolFeast/member/templates/client/orders_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,45 @@ <h2 class="ui header">
</h2>
<div class="ui divider"></div>

<table class="ui very basic stripped celled table">
<thead>
<th class="sorted descending">Order</th>
<th class="">{% trans 'Delivery Date' %}</th>
<th class="">{% trans 'Status' %}</th>
<th class="">{% trans 'Amount' %}</th>
<th class=""></th>
</thead>
<tbody>
{% for order in orders %}
<tr>
<td><strong>{{order.id}}</strong></td>
<td>{{order.delivery_date}}</td>
<td>{{order.get_status_display}}</td>
<td>${{order.price}}</td>
<td><button class="ui button" onclick="location.href='{% url 'order:view' pk=order.id %}';" value="View Order" >View</button></td>
</tr>
{% endfor %}
</tbody>

</table>

<table class="ui very basic stripped celled table">
<thead>
<th class="sorted descending">Order</th>
<th class="">{% trans 'Delivery Date' %}</th>
<th class="">{% trans 'Status' %}</th>
<th class="">{% trans 'Amount' %}</th>
<th class="">{% trans 'Actions' %}</th>
</thead>
<tbody>
{% for order in orders %}
<tr>
<td><strong>{{order.id}}</strong></td>
<td>{{order.delivery_date}}</td>
<td>{{order.get_status_display}}</td>
<td>${{order.price}}</td>
<td>
<a class="ui blue icon button" href="{% url 'order:view' pk=order.id %}"><i class="icon unhide"></i></a>
<a class="ui green icon button" href="{% url 'order:update' pk=order.id %}"><i class="icon edit"></i></a>
<a class="ui red icon button order-delete" href="#" data-order-id="{{order.id}}"><i class="icon trash"></i></a>
</td>
</tr>
{% include "order_confirm_delete.html" %}
{% endfor %}
</tbody>

</table>
</div>
{% endblock %}

{% block extrajs %}
<script type="text/javascript">
document.addEventListener( 'DOMContentLoaded', function () {
$('table').tablesort();
})

$('.order-delete').click(function(){
var order_id = $(this).attr('data-order-id');
var selector = '.ui.basic.modal.order-' + order_id;
$(selector).modal('show');
});
</script>
{% endblock %}
13 changes: 2 additions & 11 deletions django/santropolFeast/order/templates/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2 class="ui header">Orders</h2>
</div>
</div>

{% if order %}
{% if orders %}
<table class="ui very basic stripped celled table">
<thead>
<th class="sorted descending">Order</th>
Expand Down Expand Up @@ -90,19 +90,10 @@ <h2 class="ui header">Orders</h2>
</tr>
</tfoot>
</table>
<<<<<<< 624d3955fddeaf057141dc575e2c316d0d782e59


=======
{% else %}
<div class="ui row"><p>Sorry, no result found.</p></div>
{% endif %}
<script type="text/javascript">
document.addEventListener( 'DOMContentLoaded', function () {
$('table').tablesort();
})
</script>
>>>>>>> Fix formating with the order list when empty
{% endif %}

{% endblock %}

Expand Down

0 comments on commit f433a31

Please sign in to comment.