diff --git a/accounts_ext/models.py b/accounts_ext/models.py index 05245f4..9cf06d2 100644 --- a/accounts_ext/models.py +++ b/accounts_ext/models.py @@ -115,6 +115,10 @@ class Profile(AbstractStatusModel): def is_complete(self): return self.first_name and self.last_name and self.patronymic and self.birthday + @property + def full_name(self): + return "".join([self.first_name or "", " ", self.last_name or "", " ", self.patronymic or ""]) + class Meta: verbose_name = _('профиль') verbose_name_plural = _('профили') diff --git a/accounts_ext/utils.py b/accounts_ext/utils.py index 7637f27..8b13789 100644 --- a/accounts_ext/utils.py +++ b/accounts_ext/utils.py @@ -1,20 +1 @@ -def get_ballances(user): - res = {} - if user: - for wallet in user.wallet_set.all(): - info = '%.8f' % wallet.amount - if wallet.amount_blocked: - info += ' (%.8f)' % wallet.amount_blocked - res[wallet.currency.iso] = info - return res - - -def get_ballances_decimal(user): - res = {} - if user: - for wallet in user.wallet_set.all(): - info = wallet.amount - blocked = wallet.amount_blocked - res[wallet.currency.iso] = (info, blocked) - return res diff --git a/blog_ext/urls.py b/blog_ext/urls.py new file mode 100644 index 0000000..e0517d9 --- /dev/null +++ b/blog_ext/urls.py @@ -0,0 +1,14 @@ +from django.urls import re_path +from . import views + + +urlpatterns = [ + re_path(r'^login/$', views.LoginView.as_view(), name='login'), + re_path(r'^logout/$', views.LogoutView.as_view(), name='logout'), + re_path(r'^register/$', views.RegistrationView.as_view(), name='register'), + re_path(r'^register/done/$', views.RegistrationDoneView.as_view(), name='register_done'), + re_path(r'^password/reset/$', views.ResetPasswordView.as_view(), name='reset_password'), + re_path(r'^password/reset/done/$', views.ResetPasswordDoneView.as_view(), name='reset_password_done'), + re_path(r'^password/reset/change/(?P[0-9A-Za-z_\-]+)/(?P.+)/$', views.ResetPasswordConfirmView.as_view(), name='reset_password_change'), + re_path(r'^password/reset/complete/$', views.ResetPasswordCompleteView.as_view(), name='reset_password_complete') +] diff --git a/templates/bootstrap/forms/cart_checkout.html b/templates/bootstrap/forms/cart_checkout.html new file mode 100644 index 0000000..4cc2169 --- /dev/null +++ b/templates/bootstrap/forms/cart_checkout.html @@ -0,0 +1,10 @@ + + + + + $Title$ + + +$END$ + + diff --git a/templates/cart/discount_list.html b/templates/cart/discount_list.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/emails/html/admin_order_request.html b/templates/emails/html/admin_order_request.html new file mode 100644 index 0000000..6853a94 --- /dev/null +++ b/templates/emails/html/admin_order_request.html @@ -0,0 +1,42 @@ +{% extends 'email_base.html' %} +{% block title %} + Вам пришел заказ +{% endblock title %} +{% block email_body %} + + + + +
+

Пользователь {{ order.user.profile.full_name|default_if_none:order.user.username }} сделал вам заказ

+

Заказ № {{ order.order_code }}

+ + + + + + +
+ + + + + + + + + {% for buying in order.buyings_set %} + + + + + {% endfor %} + +
+ Товар + Колличество
{{ buying.offer.product.name }}{{ buying.amount }}
+
+

С уважением, Администрация сайта {{ site.name }}

+
+ +{% endblock email_body %} diff --git a/templates/emails/txt/admin_order_request.txt b/templates/emails/txt/admin_order_request.txt new file mode 100644 index 0000000..50447c6 --- /dev/null +++ b/templates/emails/txt/admin_order_request.txt @@ -0,0 +1,17 @@ +===================================================================== + Запрос на обратную связь от пользователя +===================================================================== + +---------------------------------------------------------------------- +Пользователь {{ name }} отправил вам запрос по продукту {{ subject }}. + +Чтобы связаяться для уточнения информации. + +Используйте следующий почтовый ящик {{ email }} для ответа. + +{% if phone %} + Либо используйте мобильный номер телефона {{ phone }} . +{% endif %} + +---------------------------------------------------------------------- + diff --git a/templates/landing/home.html b/templates/landing/home.html deleted file mode 100644 index 8b13789..0000000 --- a/templates/landing/home.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/templates/landing/landing.html b/templates/landing/landing.html deleted file mode 100644 index 0955209..0000000 --- a/templates/landing/landing.html +++ /dev/null @@ -1,187 +0,0 @@ -{% extends 'base.html' %} -{% load static %} - -{% block title %} -News -{% endblock %} - -{% block content %} -
-
-
-
Новости
-
-
-
-
-
-
-
-
- -
-

It is a long established fact that a reader will be distracted by the - readable - content of a page when looking at its layout. The point of using Lorem - Ipsum is - that - it has a more-or-less normal distribution of letters, as opposed to - using - 'Content - here, content here', making it look like readable English. Many desktop - publishing - packages and web page editors now use Lorem Ipsum as their default model - text, - and a - search for 'lorem ipsum' will uncover many web sites still in their - infancy. - Various - versions have evolved over the years, sometimes by accident, sometimes - on - purpose - (injected humour and the like).

-
-
-
-
-
-
-
-
-
-
-
-
- -
-

It is a long established fact that a reader will be distracted by the - readable - content of a page when looking at its layout. The point of using Lorem - Ipsum is - that - it has a more-or-less normal distribution of letters, as opposed to - using - 'Content - here, content here', making it look like readable English. Many desktop - publishing - packages and web page editors now use Lorem Ipsum as their default model - text, - and a - search for 'lorem ipsum' will uncover many web sites still in their - infancy. - Various - versions have evolved over the years, sometimes by accident, sometimes - on - purpose - (injected humour and the like).

-
-
-
-
-
-
-
-
-
-
-
-
- -
-

It is a long established fact that a reader will be distracted by the - readable - content of a page when looking at its layout. The point of using Lorem - Ipsum is - that - it has a more-or-less normal distribution of letters, as opposed to - using - 'Content - here, content here', making it look like readable English. Many desktop - publishing - packages and web page editors now use Lorem Ipsum as their default model - text, - and a - search for 'lorem ipsum' will uncover many web sites still in their - infancy. - Various - versions have evolved over the years, sometimes by accident, sometimes - on - purpose - (injected humour and the like).

-
-
-
-
-
-
-
-
-
-
-
-
- -
-

It is a long established fact that a reader will be distracted by the - readable - content of a page when looking at its layout. The point of using Lorem - Ipsum is - that - it has a more-or-less normal distribution of letters, as opposed to - using - 'Content - here, content here', making it look like readable English. Many desktop - publishing - packages and web page editors now use Lorem Ipsum as their default model - text, - and a - search for 'lorem ipsum' will uncover many web sites still in their - infancy. - Various - versions have evolved over the years, sometimes by accident, sometimes - on - purpose - (injected humour and the like).

-
-
-
-
-
-
-
-
-
-
-
-
- -
-

It is a long established fact that a reader will be distracted by the - readable - content of a page when looking at its layout. The point of using Lorem - Ipsum is - that - it has a more-or-less normal distribution of letters, as opposed to - using - 'Content - here, content here', making it look like readable English. Many desktop - publishing - packages and web page editors now use Lorem Ipsum as their default model - text, - and a - search for 'lorem ipsum' will uncover many web sites still in their - infancy. - Various - versions have evolved over the years, sometimes by accident, sometimes - on - purpose - (injected humour and the like).

-
-
-
-
-
-
-
-
-{% endblock %} \ No newline at end of file diff --git a/templates/landing/product_item.html b/templates/landing/product_item.html deleted file mode 100644 index ad508bd..0000000 --- a/templates/landing/product_item.html +++ /dev/null @@ -1,28 +0,0 @@ -
-
-
- - - -
- - {% if product_image.product.discount %} -
- {{ product_image.product.discount }}% -
- {% endif %} - -

{{ product_image.product.name }}

-

- {{ product_image.product.description|truncatechars_html:30 }} -

-
- {{ product_image.product.price }} RUB -
-
- -
-
-
diff --git a/templates/pinax/blog/post_list.html b/templates/pinax/blog/blog_post.html similarity index 100% rename from templates/pinax/blog/post_list.html rename to templates/pinax/blog/blog_post.html