From c15a4bc4241e7a139335591a7ffbd24ad76be117 Mon Sep 17 00:00:00 2001 From: Max Yakovenko Date: Fri, 20 Jul 2018 09:52:54 +0300 Subject: [PATCH] refactor email. fix activation and reset password email layout --- templates/admin/orders/detail.html | 81 +++++++++ templates/cart/detail.html | 100 +++++++++++ templates/{emails => }/email_base.html | 2 +- templates/emails/activation_email.html | 19 +- templates/emails/password_reset_email.html | 21 ++- templates/landing/home.html | 1 + templates/landing/landing.html | 187 +++++++++++++++++++ templates/landing/product_item.html | 28 +++ templates/orders/create.html | 46 +++++ templates/orders/created.html | 14 ++ templates/orders/pdf.html | 121 +++++++++++++ templates/products/categorieslist.html | 40 +++++ templates/products/list.html | 200 +++++++++++++++++++++ templates/products/product.html | 70 ++++++++ templates/products/productslist.html | 33 ++++ templates/products/search.html | 16 ++ templates/search/product_text.txt | 3 + templates/search/search.html | 103 +++++++++++ templates/userprofile/pick_up_points.html | 24 +++ templates/userprofile/profile.html | 42 +++++ templates/userprofile/update_profile.html | 14 ++ 21 files changed, 1147 insertions(+), 18 deletions(-) create mode 100644 templates/admin/orders/detail.html create mode 100644 templates/cart/detail.html rename templates/{emails => }/email_base.html (98%) create mode 100644 templates/landing/home.html create mode 100644 templates/landing/landing.html create mode 100644 templates/landing/product_item.html create mode 100644 templates/orders/create.html create mode 100644 templates/orders/created.html create mode 100644 templates/orders/pdf.html create mode 100644 templates/products/categorieslist.html create mode 100644 templates/products/list.html create mode 100644 templates/products/product.html create mode 100644 templates/products/productslist.html create mode 100644 templates/products/search.html create mode 100644 templates/search/product_text.txt create mode 100644 templates/search/search.html create mode 100644 templates/userprofile/pick_up_points.html create mode 100644 templates/userprofile/profile.html create mode 100644 templates/userprofile/update_profile.html diff --git a/templates/admin/orders/detail.html b/templates/admin/orders/detail.html new file mode 100644 index 0000000..e77c931 --- /dev/null +++ b/templates/admin/orders/detail.html @@ -0,0 +1,81 @@ +{% extends "admin/base_site.html" %} + +{% load static %} + +{% block title %} + Order {{ order.id }} {{ block.super }} +{% endblock %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} +

Order {{ order.id }}

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Create{{ order.created }}
Customer{{ order.customer_name }}
E-mail{{ order.customer_email }}
Address{{ order.customer_address }}
Total cost{{ order.total_price }} RUB.
Status{% if order.paid %}Paid{% else %}NOT Paid{% endif %}
+ +
+ +
+{% endblock %} diff --git a/templates/cart/detail.html b/templates/cart/detail.html new file mode 100644 index 0000000..55c5ab8 --- /dev/null +++ b/templates/cart/detail.html @@ -0,0 +1,100 @@ +{% extends 'base.html' %} +{% load static %} + +{% block title %} + Your Cart +{% endblock %} + +{% block content %} +

Ваша корзина

+ + + + + + + + + + + + + {% for item in cart %} + {% with offer=item.offer %} + + + + + + + + + {% endwith %} + {% endfor %} + {% if cart.discount %} + + + + + + + + + + + {% endif %} + + + + + + + + + + + + {% endif %} + + + +
ImageProductQuantityDeletePrice per itemFull price
+ + + + {{ offer.name }} +
+ {% csrf_token %} + {{ item.update_quantity_form.quantity }} + {{ item.update_quantity_form.product_slug }} + {{ item.update_quantity_form.price_per_itom }} + {{ item.update_quantity_form.update }} + +
+
Удалить{{ item.price }} rub.{{ item.total_price }} rub.
Total price without discount{{ cart.get_total_price }}
+ "{{ cart.discount.code }}" discount for ({{ cart.discount.discount }} %) + - {{ cart.get_discount|floatformat:"2" }} руб.
Всего{{ cart.get_total_price|floatformat:"2" }} руб. + {% if request.session.points %} +
- {{ cart.get_max }} бал.
{{ cart.get_total_deduct_points }} руб.
+ + + + + + + + +

Доступные баллы: {{ user.profile.user_points }}

+
{% csrf_token %} + +
+ +
{% csrf_token %} + +
+ +

+ Добавить товар + Оформить заказ +

+{% endblock %} \ No newline at end of file diff --git a/templates/emails/email_base.html b/templates/email_base.html similarity index 98% rename from templates/emails/email_base.html rename to templates/email_base.html index 9a81fe6..763eb51 100644 --- a/templates/emails/email_base.html +++ b/templates/email_base.html @@ -355,7 +355,7 @@
- This is preheader text. Some clients will show this text as a preview. + {% block pre_header %}{% endblock pre_header %} diff --git a/templates/emails/activation_email.html b/templates/emails/activation_email.html index 8011a9b..e398a5e 100644 --- a/templates/emails/activation_email.html +++ b/templates/emails/activation_email.html @@ -1,4 +1,4 @@ -{% extends 'emails/email_base.html' %} +{% extends 'email_base.html' %} {% block title %} Активация учетной записи {% endblock title %} @@ -7,9 +7,9 @@

Здравствуйте!

-

Спасибо за регистрацию на сайте {{ request.get_host }}

-

Для того чтобы войти в свой аккуант его нужно активировать.\n -Чтобы активировать ваш аккаунт, перейдите по ссылке:

+

Спасибо за регистрацию на сайте {{ site.name }}

+

Для того чтобы войти в свой аккуант его нужно активировать.
+ Чтобы активировать ваш аккаунт, перейдите по ссылке:

@@ -17,7 +17,11 @@
- +
Активация + + {{ activation_key }} + +
@@ -25,9 +29,8 @@
-

This is a really simple email template. Its sole purpose is to get the - recipient to click the button with no distractions.

-

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

+

Если вы не отправляли запрос на регистрацию, проигнорируйте данное письмо

+

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

diff --git a/templates/emails/password_reset_email.html b/templates/emails/password_reset_email.html index 1831644..8ab7012 100644 --- a/templates/emails/password_reset_email.html +++ b/templates/emails/password_reset_email.html @@ -1,4 +1,4 @@ -{% extends 'emails/email_base.html' %} +{% extends 'email_base.html' %} {% block title %} Сброс пароля {% endblock title %} @@ -6,9 +6,9 @@
-

Hi there,

-

Sometimes you just want to send a simple HTML email with a simple design - and clear call to action. This is it.

+

Уважаемый пользователь {{ email }}.

+

Вы отправили запрос на восстановления пароля на сайте {{ site_name }}. + Чтобы получить новый пароль пройдите по ссылке ниже:

@@ -16,8 +16,12 @@
- +
Call - To Action + + Сбросить пароль + +
@@ -25,9 +29,8 @@
-

This is a really simple email template. Its sole purpose is to get the - recipient to click the button with no distractions.

-

Good luck! Hope it works.

+

Если вы не отправляли запрос на регистрацию, проигнорируйте данное письмо

+

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

diff --git a/templates/landing/home.html b/templates/landing/home.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/templates/landing/home.html @@ -0,0 +1 @@ + diff --git a/templates/landing/landing.html b/templates/landing/landing.html new file mode 100644 index 0000000..0955209 --- /dev/null +++ b/templates/landing/landing.html @@ -0,0 +1,187 @@ +{% 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 new file mode 100644 index 0000000..ad508bd --- /dev/null +++ b/templates/landing/product_item.html @@ -0,0 +1,28 @@ +
+
+
+ + + +
+ + {% 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/orders/create.html b/templates/orders/create.html new file mode 100644 index 0000000..209314f --- /dev/null +++ b/templates/orders/create.html @@ -0,0 +1,46 @@ +{% extends "base.html" %} + +{% block title %} + Ordering +{% endblock %} + +{% block content %} +
+

Пожалуйста введите информацию о заказе.

+
+ {% csrf_token %} + {{ form.as_p }} + + + + + + + + + +
+
+ +
+

Ваш заказ

+
    + {% for item in cart %} +
  • + {{ item.offer.name }} | Количество: {{ item.quantity }} | Стоимость: {{ item.total_price }} руб. +
  • + {% endfor %} + {% if cart.discount %} +
  • + "{{ cart.discount.code }}" ({{ cart.discount.discount }}% less) + - {{ cart.get_discount|floatformat:"2"}} руб. +
  • + {% endif %} +
+ {% if request.session.points %} +

Всего: {{ cart.get_total_deduct_points|floatformat:"2"}} руб.

+ {% else %} +

Всего: {{ cart.get_total_price|floatformat:"2"}} руб.

+ {% endif %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/orders/created.html b/templates/orders/created.html new file mode 100644 index 0000000..ffe7021 --- /dev/null +++ b/templates/orders/created.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block title %} + Спасибо за заказ +{% endblock %} + +{% block content %} +

Благодарим Вас за заказ!

+

На указанную Вами почту было отправлено платежное поручение, заказ будет принят в работу после оплаты.

+

Номер Вашего заказа: {{ order.id }}

+

+ На главную страницу +

+{% endblock %} \ No newline at end of file diff --git a/templates/orders/pdf.html b/templates/orders/pdf.html new file mode 100644 index 0000000..041e71d --- /dev/null +++ b/templates/orders/pdf.html @@ -0,0 +1,121 @@ +{% load static %} + + + + + + Document + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{{ bank }}БИК{{ BIK }}
Банк получателяСч. №{{ bank_acc }}
{{ name }}ИНН{{ INN }}
КПП{{ KPP }}
ПолучательСч. №{{ acc }}
+

+ Счет на оплату № {{ order.id }} от {{ order.created }} +

+ + + + + + + + + +
Поставщик:{{ sup_info }}
Покупатель:{{ order.customer_name }}
+ + + + + + + + + + + + + {% for item in order.items.all %} + + + + + + + + + {% endfor %} + + + + + + + + + + + + + +
Товары(работы/услуги)Кол-воЕд.ЦенаСумма
{{ forloop.counter }}{{ item.product.name }}{{ item.number }}шт{{ item.price_per_itom }}{{ item.total_price }}
Итого:{{ order.total_price }}
Без налога (НДС)-
Всего к оплате:{{ order.total_price }}
+

Всего наименований {{ order.items.count }} на сумму {{ order.total_price }} руб.

+

{{ verb_price }} {{ verb_cur }} 00 копеек

+ + + \ No newline at end of file diff --git a/templates/products/categorieslist.html b/templates/products/categorieslist.html new file mode 100644 index 0000000..c5b9d3e --- /dev/null +++ b/templates/products/categorieslist.html @@ -0,0 +1,40 @@ +{% extends 'base.html' %} +{% load static %} + +{% block title %} + Categories Page +{% endblock %} + +{% block content %} +
+
+
+
+ +
+
+
+
+
+ {% for category in categories %} + + {% endfor %} + {% for product in products %} +
+ + + + {{ product.name }}
+

+ {{ product.price }} rub. +

+
+ {% endfor %} +
+
+{% endblock %} \ No newline at end of file diff --git a/templates/products/list.html b/templates/products/list.html new file mode 100644 index 0000000..2a4e016 --- /dev/null +++ b/templates/products/list.html @@ -0,0 +1,200 @@ +{% extends 'base.html' %} +{% load static %} + +{% block title %} + Producers Page +{% endblock %} + +{% block content %} + + + + + + + + + + + + + + + + + +
+
+
+ + + +
+
+
Не нашли нужную программу + или разработчика? + Заполните форму и с Вами + свяжется наш специалист. +
+ + + + + +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+ +
+ + + +
+
Выбор ПО по разработчику
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
Наши клиенты
+
+
    +
  • +
  • +
  • +
+
+
Наши сертефикаты
+
+ + +
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/templates/products/product.html b/templates/products/product.html new file mode 100644 index 0000000..c884c00 --- /dev/null +++ b/templates/products/product.html @@ -0,0 +1,70 @@ +{% extends 'base.html' %} + +{% load staticfiles %} + + +{% block title %} + {{ product.name }} +{% endblock %} + +{% block content %} + + +{% endblock content %} \ No newline at end of file diff --git a/templates/products/productslist.html b/templates/products/productslist.html new file mode 100644 index 0000000..a8a1a03 --- /dev/null +++ b/templates/products/productslist.html @@ -0,0 +1,33 @@ +{% extends 'base.html' %} +{% load static %} + +{% block title %} + Products Page +{% endblock %} + +{% block content %} +
+
+
+
+ +
+
+
+
+

Products

+
+ {% for product in products %} +
+ + + + {{ product.name }}
+

+ {{ product.price }} rub. +

+
+ {% endfor %} +
+
+{% endblock %} \ No newline at end of file diff --git a/templates/products/search.html b/templates/products/search.html new file mode 100644 index 0000000..3301f74 --- /dev/null +++ b/templates/products/search.html @@ -0,0 +1,16 @@ +{% extends 'base.html' %} +{% load static %} + +{% block content %} + + {% if products_images.count > 0 %} +
+ {% for product_image in products_images %} + {% include 'landing/product_item.html' %} + {% endfor %} +
+ {% else %} +
  • None to show!
  • + {% endif %} + +{% endblock %} \ No newline at end of file diff --git a/templates/search/product_text.txt b/templates/search/product_text.txt new file mode 100644 index 0000000..bde781d --- /dev/null +++ b/templates/search/product_text.txt @@ -0,0 +1,3 @@ +{{ object.name }} +{{ object.description }} +{{ object.producer }} \ No newline at end of file diff --git a/templates/search/search.html b/templates/search/search.html new file mode 100644 index 0000000..1cb9857 --- /dev/null +++ b/templates/search/search.html @@ -0,0 +1,103 @@ +{% extends 'base.html' %} +{% load static %} + +{% block content %} + + {% if page_obj.object_list %} +
    +

    Filters

    +
    + {% if facets.fields.category %} +
    Filter by Category
    + {% for category in facets.fields.category %} + {% if category.1 != 0 %} +
    + {{ category.0 }} ({{ category.1 }}) +
    + {% endif %} + {% endfor %} + {% endif %} +
    + +
    + +
    + +
    + {% if facets.fields.producer %} +
    Filter by Producer
    + {% for producer in facets.fields.producer %} + {% if producer.1 != 0 %} +
    + {{ producer.0 }} ({{ producer.1 }}) +
    + {% endif %} + {% endfor %} + {% endif %} +
    + +
    + +
    +
    + {% endif %} + +
    +
    +
    + Search result for: +
    + +
    + Showing {{ page_obj.start_index }} - {{ page_obj.end_index }} of total {{ page_obj.paginator.count }} + results on page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} +
    +
    +
    + + {% if page_obj.object_list %} + +
      + {% for product in page_obj.object_list %} +
      + + + + {{ product.name }}
      +

      {{ product.object.price }} rub.

      +
      + {% endfor %} +
    + +
    + {% if is_paginated %} +
      + + {% if page_obj.has_previous %} +
    • «
    • + {% else %} +
    • «
    • + {% endif %} + + {% for i in paginator.page_range %} + {% if page_obj.number == i %} +
    • {{ i }} (current)
    • + {% else %} +
    • {{ i }}
    • + {% endif %} + {% endfor %} + + {% if page_obj.has_next %} +
    • »
    • + {% else %} +
    • »
    • + {% endif %} +
    + {% endif %} +
    + {% else %} +

    Sorry, no result found for the search term {{query}}

    + {% endif %} + +{% endblock %} \ No newline at end of file diff --git a/templates/userprofile/pick_up_points.html b/templates/userprofile/pick_up_points.html new file mode 100644 index 0000000..5795e83 --- /dev/null +++ b/templates/userprofile/pick_up_points.html @@ -0,0 +1,24 @@ +{% extends 'base.html' %} +{% load static %} + +{% block content %} + +
    +
    +
    +
    +

    Для совершения операции необходим расчетный счет получателя!
    + Пожалуйста, укажите номер счета для перевода.

    +
    {% csrf_token %} +
    + + +
    + +
    +
    +
    +
    +
    + +{% endblock %} \ No newline at end of file diff --git a/templates/userprofile/profile.html b/templates/userprofile/profile.html new file mode 100644 index 0000000..130f8ed --- /dev/null +++ b/templates/userprofile/profile.html @@ -0,0 +1,42 @@ +{% extends 'base.html' %} +{% load static %} + +{% block content %} +

    Profile

    + + {% for field in form %} + {{ field.error }} + {% endfor %} + +
    +

    Username: {{ user.username }}

    +

    Email: {{ user.email }}

    +

    Phone: {{ profile.phone }}

    +

    Site: {{ profile.website }}

    +

    City: {{ profile.city }}

    +

    Parent: {{ profile.parent.username }}

    + + + + + + + +
    + +
    +
    + +{% endblock %} \ No newline at end of file diff --git a/templates/userprofile/update_profile.html b/templates/userprofile/update_profile.html new file mode 100644 index 0000000..5a3913a --- /dev/null +++ b/templates/userprofile/update_profile.html @@ -0,0 +1,14 @@ +{% extends 'base.html' %} + +{% block content %} +

    Profile

    + + {% for field in form %} + {{ field.error }} + {% endfor %} + +
    {% csrf_token %} + {{ form.as_ul }} + +
    +{% endblock %} \ No newline at end of file