From 1af783a10e30d18e86aab064e326a24e614d37bd Mon Sep 17 00:00:00 2001 From: Dmitriy Shesterkin Date: Thu, 29 Jun 2017 20:29:20 +0300 Subject: [PATCH] delete button for lic and acound page --- src/dokumentor/settings/local.py | 10 +++++++++ static/css/style.css | 7 ++++++ static/js/orders.js | 23 +++++++++++++++++++ templates/base.html | 2 +- templates/customer/profile/orders_list.html | 25 ++++++++++++++++----- 5 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 static/js/orders.js diff --git a/src/dokumentor/settings/local.py b/src/dokumentor/settings/local.py index 20bd0c6..3e418b9 100644 --- a/src/dokumentor/settings/local.py +++ b/src/dokumentor/settings/local.py @@ -27,3 +27,13 @@ DATABASES = { EMAIL_BACKEND = 'eml_email_backend.EmailBackend' EMAIL_FILE_PATH = os.path.join(ROOT_DIR, 'tmp_emails') + +YANDEX_MONEY_DEBUG = False +YANDEX_MONEY_SCID = 92585 +YANDEX_MONEY_SHOP_ID = 546996 +YANDEX_MONEY_SHOP_PASSWORD = 'sQuMtorHE02U' +YANDEX_MONEY_FAIL_URL = 'https://dokumentor.ru/my/payment/fail/' +YANDEX_MONEY_SUCCESS_URL = 'https://dokumentor.ru/my/payment/success/' +YANDEX_MONEY_PAYMENT_URL = 'https://demomoney.yandex.ru/eshop.xml' +# информировать о случаях, когда модуль вернул Яндекс.Кассе ошибку +YANDEX_MONEY_MAIL_ADMINS_ON_PAYMENT_ERROR = True diff --git a/static/css/style.css b/static/css/style.css index a5af05c..e9761a8 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1019,3 +1019,10 @@ input[type=number] { pointer-events: none; cursor: default; } + +.col__account-detail, +.col__lic-detail, +.delete_license { + display: inline-block; + vertical-align: middle; +} diff --git a/static/js/orders.js b/static/js/orders.js new file mode 100644 index 0000000..701b411 --- /dev/null +++ b/static/js/orders.js @@ -0,0 +1,23 @@ +$(document).ready(function() { + + $('.delete_license').click(function(e){ + e.preventDefault(); + var accountID = $(this).data('id'); + + $('#dialogs').html('Удалить счет на оплату?'); + $('#dialogs').dialog({ + buttons: { + "Да": function(){ + $.post('/my/delete_license/' + accountID + '/', function(data){ + $('.account_' + data['id']).remove() + }); + $(this).dialog("close"); + }, + "Нет": function(){ + $(this).dialog("close"); + } + } + }) + }) +}); + diff --git a/templates/base.html b/templates/base.html index 05a80a1..0c13016 100644 --- a/templates/base.html +++ b/templates/base.html @@ -103,7 +103,7 @@ Купить лицензию {% comment %} - Мои заказы + Мои заказы История расчетов {% endcomment %} Лицензии и расчёты diff --git a/templates/customer/profile/orders_list.html b/templates/customer/profile/orders_list.html index d673cb7..1b8e70e 100644 --- a/templates/customer/profile/orders_list.html +++ b/templates/customer/profile/orders_list.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load pytils_numeral %} +{% load pytils_numeral static %} {% block title %}Лицензии и расчёты{% endblock %} {% block content %} @@ -22,14 +22,29 @@ {% if object.type %} -

{{ object.account_status }} {% if object.paid_date %}{{ object.paid_date }}{% endif %}

-

{% if object.paid_date %}Выдана лицензия № {{ object.id }}{% else %}{{ object.account_sub_status }}{% endif %}

+
+

{{ object.account_status }} {% if object.paid_date %}{{ object.paid_date }}{% endif %}

+

{% if object.paid_date %}Выдана лицензия № {{ object.id }}{% else %}{{ object.account_sub_status }}{% endif %}

+
{% else %} -

{{ object.get_paid_status }}

-

Период действия: {% if object.date_from %}{{ object.date_from }} - {{ object.date_to }}{% else %}-{% endif %}

+
+

{{ object.get_paid_status }}

+

Период действия: {% if object.date_from %}{{ object.date_from }} - {{ object.date_to }}{% else %}-{% endif %}

+
{% endif %} + + {% if object.status == 0 %} + + [X] + + {% endif %} + {% endfor %} {% endblock content %} + +{% block js %} + +{% endblock %}