def show_list(request, slug): context = get_context(request) context['menu'] = get_menu_by_slug(slug) # context['items'] = get_category_goods(context['category']) return render(request, 'catalogapp/list.html', context)
def show_index(request): context = get_context(request) context['most_popular'] = get_most_popular() context['is_sale'] = get_is_sale() context['is_new'] = get_is_new() context['is_hot'] = get_is_hot() return render(request, 'baseapp/index.html', context=context)
def show_item(request, slug): context = get_context(request) context['item'] = get_good_by_slug(slug) context['recommendations'] = get_recommendations() context['additives'] = get_good_additive(context['item']) return render(request, 'catalogapp/item.html', context)
def show_contacts(request): context = get_context(request) return render(request, 'baseapp/contacts.html', context=context)
def show_confirmed(request): context = get_context(request) context['orders'] = get_orders(is_confirmed=True) context['title'] = 'Подтвержденные' return render(request, 'orderapp/orders.html', context=context)
def show_canceled(request): context = get_context(request) context['orders'] = get_orders(is_canceled=True) context['title'] = 'Отмененые' return render(request, 'orderapp/orders.html', context=context)
def show_orders(request): context = get_context(request) context['orders'] = get_orders() context['title'] = 'Заказы в работе' return render(request, 'orderapp/orders.html', context=context)
def show_order(request, id): context = get_context(request) context['order'] = get_order_by_id(id=id) return render(request, 'orderapp/order.html', context=context)
def show_cart(request): context = get_context(request) return render(request, 'cartapp/cart.html', context)