From 9237ad97936a9f6744c7391085569686992092ed Mon Sep 17 00:00:00 2001 From: vanzhiganov Date: Mon, 25 Dec 2017 14:53:54 +0300 Subject: [PATCH 1/2] up --- wotstats/templates/pages/rush/index.html | 82 ++++++++++++++---------- wotstats/views/rush.py | 39 ----------- 2 files changed, 47 insertions(+), 74 deletions(-) diff --git a/wotstats/templates/pages/rush/index.html b/wotstats/templates/pages/rush/index.html index 7c569da..79cd023 100644 --- a/wotstats/templates/pages/rush/index.html +++ b/wotstats/templates/pages/rush/index.html @@ -8,46 +8,58 @@

Недостаточно денег в кошельке.

-

Необходимо пополнить кошелёк для участия в турнире.

+

Необходимо пополнить кошелёк на 100 рублей для участия в турнире.

{% else %} - - - - - - - - - - - {% for r in rush_list %} - {% if r.status == "preparation" %} - - - - - - - - {% endif %} - {% endfor %} -
IDСтартФинишСтавкаСтатус
{{ r.id }}{{ r.at_start }}{{ r.at_finish }}{{ r.bet }} рублей{{ r.status }}
-
-

Участники

- {% set allow_apply = 'true' %} - {% for u in rush_list_accounts %} - {% if u.account_id|int == account_id|int %} - {% set allow_apply = 'false' %} - {{ u.account_id }} - {% endif %} - {% endfor %} -
+ {% set allow_apply = 'true' %} + {% for u in rush_list_accounts %} + {% if u.account_id|int == account_id|int %} + {% set allow_apply = 'false' %} + {% endif %} + {% endfor %} + {% if allow_apply == 'true' %} - Участвовать +
+
+ + + + + + + + + + + {% for r in rush_list %} + {% if r.status == "preparation" %} + + + + + + + + {% endif %} + {% endfor %} +
IDСтартФинишСтавкаСтатус
{{ r.id }}{{ r.at_start }}{{ r.at_finish }}{{ r.bet }} рублей{{ r.status }}
+ + Участвовать +
+
{% else %} -

Вы участвуете, вам необходимо совершить максимальное кол-во побед за время турнира

+
+
+

Вы участвуете, вам необходимо совершить максимальное кол-во побед за время турнира

+

Участники

+ {% for u in rush_list_accounts %} + {% if u.account_id|int == account_id|int %} + {{ u.account_id }} + {% endif %} + {% endfor %} +
+
{% endif %} {% endif %} diff --git a/wotstats/views/rush.py b/wotstats/views/rush.py index 5549d90..a293489 100644 --- a/wotstats/views/rush.py +++ b/wotstats/views/rush.py @@ -33,45 +33,6 @@ def index(): ub = UserWallet.query.filter(UserWallet.user == session['user']).first() - # # - # app_id = current_app.config['WG_APPLICATION_ID'] - # url = 'https://api.worldoftanks.ru/wot/account/info/' - # __ = requests.get('{}?application_id={}&account_id={}'.format(url, app_id, account_id)).json() - # # if not __.get('data', {}).get("{}".format(account_id)): - # # print('account_id: {} SKIPPED'.format(account_id)) - # # continue - # # copy results - # account_statistics = __.get('data', {}).get("{}".format(account_id)).get('statistics', {}) - # account_data = __['data']["{}".format(account_id)]['statistics']['all'] - # - # data = { - # 'battles': account_data['battles'], - # 'wins': account_data['wins'], - # 'losses': account_data['losses'], - # 'draws': account_data['draws'], - # } - - # account_data.pop('statistics', None) - - # db.session.add(WotAccounts(account_id=account_id, nickname=account_data.get('nickname'))) - # db.session.commit() - # db.session.flush() - - # ws = WotAccountsStats() - # ws.account_id = account_id - # ws.created_at = datetime.now() - # try: - # ws.last_battle_time = datetime.fromtimestamp(int(account_data.get('last_battle_time'))).strftime('%Y-%m-%d %H:%M:%S') - # except Exception as e: - # print('>> Error: {}'.format(e)) - # ws.data = account_data - # ws.statistics = account_statistics - # db.session.add(ws) - # db.session.commit() - # db.session.flush() - - - return render_template( 'pages/rush/index.html', rush_list=rush_list, From d6334bde4ea502d3f9fcd72771ae4f3690d6b553 Mon Sep 17 00:00:00 2001 From: vanzhiganov Date: Mon, 25 Dec 2017 14:57:49 +0300 Subject: [PATCH 2/2] up --- wotstats/templates/pages/rush/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/wotstats/templates/pages/rush/index.html b/wotstats/templates/pages/rush/index.html index 79cd023..ac7eb7e 100644 --- a/wotstats/templates/pages/rush/index.html +++ b/wotstats/templates/pages/rush/index.html @@ -52,6 +52,7 @@

Вы участвуете, вам необходимо совершить максимальное кол-во побед за время турнира

+

Турнир начнется в полночь по московскому времени и закончится через 24 часа. Приз будет начислен победителю автоматически, сразу после окончания текущего турнира.

Участники

{% for u in rush_list_accounts %} {% if u.account_id|int == account_id|int %}