Merge branch 'master' of git.2li.ch:ibz/web_AI-5
This commit is contained in:
commit
92d4e0dd71
|
@ -4,7 +4,7 @@ from currencies.models import (ExchangeRate,
|
||||||
ExchangeRate_date,
|
ExchangeRate_date,
|
||||||
ExchangeRate_name)
|
ExchangeRate_name)
|
||||||
from currencies import exchange_rates
|
from currencies import exchange_rates
|
||||||
from django.http import JsonResponse
|
from webshop.utils import get_categories
|
||||||
|
|
||||||
|
|
||||||
def currencies(request):
|
def currencies(request):
|
||||||
|
@ -160,9 +160,10 @@ def currencies(request):
|
||||||
"""
|
"""
|
||||||
# know we can query our data for presentaton:
|
# know we can query our data for presentaton:
|
||||||
ordered_currency_list = ExchangeRate.objects.order_by('name', 'date')
|
ordered_currency_list = ExchangeRate.objects.order_by('name', 'date')
|
||||||
|
category_list = get_categories()
|
||||||
# and publish it on template:
|
# and publish it on template:
|
||||||
return render(request,
|
return render(request,
|
||||||
'currencies/index.html',
|
'currencies/index.html',
|
||||||
{'ordered_currency_list': ordered_currency_list,
|
{'ordered_currency_list': ordered_currency_list,
|
||||||
|
'category_list': category_list,
|
||||||
'message': message})
|
'message': message})
|
||||||
|
|
|
@ -59,6 +59,14 @@
|
||||||
<dt><dl>{{ total }} {{ currency_name }}</dl></dt>
|
<dt><dl>{{ total }} {{ currency_name }}</dl></dt>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td scope="col" colspan="5" class="text-right">
|
||||||
|
<td scope="col" class="price-value">
|
||||||
|
<dt><dl>Exchange Rate to 1 CHF:</dl></dt></td>
|
||||||
|
<td scope="col" class="price-value">
|
||||||
|
<dt><dl>{{ exchange_rate }}</dl></dt>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<form id="checkout_form" action="{% url 'cart' %}" method="POST">
|
<form id="checkout_form" action="{% url 'cart' %}" method="POST">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
|
@ -416,10 +416,12 @@ def checkout(request):
|
||||||
'category_list': category_list,
|
'category_list': category_list,
|
||||||
'message': message,
|
'message': message,
|
||||||
'person': person,
|
'person': person,
|
||||||
|
'exchange_rate': exchange_rate,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
def order(request, order_id):
|
def order(request, order_id):
|
||||||
|
category_list = get_categories()
|
||||||
totalprice_list = []
|
totalprice_list = []
|
||||||
order_position_list = []
|
order_position_list = []
|
||||||
cart = ShoppingCart.objects.get(user=request.user)
|
cart = ShoppingCart.objects.get(user=request.user)
|
||||||
|
@ -457,4 +459,5 @@ def order(request, order_id):
|
||||||
'order_position_list': order_positions,
|
'order_position_list': order_positions,
|
||||||
'total': total,
|
'total': total,
|
||||||
'currency_name': currency_name,
|
'currency_name': currency_name,
|
||||||
|
'category_list': category_list,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue