From 5d615683869895276d25c964d555ee5de7e03064 Mon Sep 17 00:00:00 2001 From: paov Date: Wed, 19 Oct 2022 12:43:26 +0300 Subject: [PATCH] 21 --- choose/templates/choose.html | 2 +- choose/templates/vote.html | 11 ++++++++++- choose/views.py | 13 ++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/choose/templates/choose.html b/choose/templates/choose.html index 4f0f5b7..bc19007 100644 --- a/choose/templates/choose.html +++ b/choose/templates/choose.html @@ -108,7 +108,7 @@ function sum_price() { s = 0 for (let tea in choice) { - s += choice[tea] / 50 * parseInt(a[tea].price) + s += choice[tea] / a[tea].ms[1] * parseInt(a[tea].price) } const butt = document.getElementById('confirm_button'); const sum_h = document.getElementById('sum_h'); diff --git a/choose/templates/vote.html b/choose/templates/vote.html index e11f92f..86aa778 100644 --- a/choose/templates/vote.html +++ b/choose/templates/vote.html @@ -16,6 +16,7 @@ Выбрали Проголосовали Всего голосов + Цена {% for choice in choices %} @@ -44,6 +45,13 @@ {{ choice.votes }} + + {{ choice.sum }} +
+ С человека: +
+ {{ choice.sum_per_usr }} + {% if choice.class == 'choice' %}