From e420dc17f2818e11289891088cfd127e0d0d4112 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Thu, 27 Jul 2023 13:56:15 +0300 Subject: [PATCH] 0.0.47 add checkbox --- static/css/styles.css | 12 ++- static/js/user_profile.js | 95 +++++++++++++++++++ templates/blocks/b_user_profile.html | 8 +- templates/blocks/profile/b_my_routes.html | 32 +------ .../blocks/profile/b_new_msg_to_support.html | 11 +-- .../blocks/profile/b_new_msg_to_user.html | 11 +-- templates/blocks/profile/b_new_route.html | 47 +++++---- templates/blocks/profile/b_profile.html | 11 +-- templates/blocks/profile/b_subscribe.html | 11 +-- templates/pages/profile/p_user_profile.html | 1 + templates/widgets/w_route_info.html | 34 +++++++ 11 files changed, 181 insertions(+), 92 deletions(-) create mode 100644 static/js/user_profile.js create mode 100644 templates/widgets/w_route_info.html diff --git a/static/css/styles.css b/static/css/styles.css index 4ab2723..1ac6f8a 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1067,4 +1067,14 @@ select#id_cargo_type{ div.from_to_place>div>select{ width: 392px; -} \ No newline at end of file +} + + +/*my routes*/ + +.my_route{ + display: block ruby; + margin: 15px 5px; +} + +/*my routes*/ diff --git a/static/js/user_profile.js b/static/js/user_profile.js new file mode 100644 index 0000000..cd7e60a --- /dev/null +++ b/static/js/user_profile.js @@ -0,0 +1,95 @@ +function writeMessage(){ + $.ajax({ + headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, + url: '/ru/user_account/new_msg_to_user/', + type: "POST", + // async: true, + cache: false, + processData: false, + contentType: false, + // enctype: 'json', + // data: formData, + success: function(data){ + // location.href = '/profile' + document.querySelector(".info_profile").innerHTML = data.html; + + + }, + error: function (data, exception){ + console.log(400) + + } + }); +} +function technicalSupport(){ + $.ajax({ + headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, + url: '/ru/user_account/new_msg_to_support/', + type: "POST", + // async: true, + cache: false, + processData: false, + contentType: false, + // enctype: 'json', + // data: formData, + success: function(data){ + console.log('data received') + // location.href = '/profile' + document.querySelector(".info_profile").innerHTML = data.html; + + + }, + error: function (data, exception){ + console.log(400) + + } + }); +} +function mySubscription(){ + $.ajax({ + headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, + url: '/ru/user_account/subscribe/', + type: "POST", + // async: true, + cache: false, + processData: false, + contentType: false, + // enctype: 'json', + // data: formData, + success: function(data){ + console.log('data received') + // location.href = '/profile' + document.querySelector(".info_profile").innerHTML = data.html; + + + }, + error: function (data, exception){ + console.log(400) + + } + }); +} +function myProfile(){ + $.ajax({ + headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, + url: '/ru/user_account/change_profile/', + type: "POST", + // async: true, + cache: false, + processData: false, + contentType: false, + // enctype: 'json', + // data: formData, + success: function(data){ + console.log('data received') + // location.href = '/profile' + document.querySelector(".info_profile").innerHTML = data.html; + + + }, + error: function (data, exception){ + console.log(400) + + } + }); +} \ No newline at end of file diff --git a/templates/blocks/b_user_profile.html b/templates/blocks/b_user_profile.html index 69d9e94..8e39b96 100644 --- a/templates/blocks/b_user_profile.html +++ b/templates/blocks/b_user_profile.html @@ -13,19 +13,19 @@ Мои объявления -
+
Написать сообщение
-
+
Тех. поддержка
-
+
Моя подписка
-
+ diff --git a/templates/blocks/profile/b_my_routes.html b/templates/blocks/profile/b_my_routes.html index 49cd795..7a08422 100644 --- a/templates/blocks/profile/b_my_routes.html +++ b/templates/blocks/profile/b_my_routes.html @@ -1,33 +1,3 @@
- {% for route in routes %} -
-
- {{ route.get_cargo_type_display }} - {{ route.weight }} - {{ route.get_type_transport_display }} -
- {{ route.from_address_point }} - {{ route.to_adress_point }} -
-
- Отправка: {{route.departure_DT }} - Прибытие: {{route.arrival_DT }} -
-
- Откуда заберёт:{{ route.from_place }} - Куда доставит:{{ route.to_place }} -
- - -
- -
- - - - -
-
- - {% endfor %} + {% include 'widgets/w_route_info.html' %}
\ No newline at end of file diff --git a/templates/blocks/profile/b_new_msg_to_support.html b/templates/blocks/profile/b_new_msg_to_support.html index 566549b..8447962 100644 --- a/templates/blocks/profile/b_new_msg_to_support.html +++ b/templates/blocks/profile/b_new_msg_to_support.html @@ -1,10 +1 @@ - - - - - Title - - - - - \ No newline at end of file +
Тех поддрежка
\ No newline at end of file diff --git a/templates/blocks/profile/b_new_msg_to_user.html b/templates/blocks/profile/b_new_msg_to_user.html index 566549b..d4bdd9c 100644 --- a/templates/blocks/profile/b_new_msg_to_user.html +++ b/templates/blocks/profile/b_new_msg_to_user.html @@ -1,10 +1 @@ - - - - - Title - - - - - \ No newline at end of file +
Написать сообщение
\ No newline at end of file diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 28f59f1..0e25838 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -148,25 +148,40 @@
-
- #} - - {% if form.errors and form.errors.cargo_type %} +{#
#} + +
+ {% for item in form.fields.cargo_type.choices %} + {{ item.1 }} + {% endfor %} + {% if form.errors and form.errors.cargo_type %} {{ form.errors.cargo_type }} {% endif %} -
+
+
diff --git a/templates/blocks/profile/b_profile.html b/templates/blocks/profile/b_profile.html index 566549b..0cf402f 100644 --- a/templates/blocks/profile/b_profile.html +++ b/templates/blocks/profile/b_profile.html @@ -1,10 +1 @@ - - - - - Title - - - - - \ No newline at end of file +
Мой профиль
\ No newline at end of file diff --git a/templates/blocks/profile/b_subscribe.html b/templates/blocks/profile/b_subscribe.html index 566549b..e7c20a7 100644 --- a/templates/blocks/profile/b_subscribe.html +++ b/templates/blocks/profile/b_subscribe.html @@ -1,10 +1 @@ - - - - - Title - - - - - \ No newline at end of file +
Моя подписка
\ No newline at end of file diff --git a/templates/pages/profile/p_user_profile.html b/templates/pages/profile/p_user_profile.html index bbf762e..c7dd895 100644 --- a/templates/pages/profile/p_user_profile.html +++ b/templates/pages/profile/p_user_profile.html @@ -9,6 +9,7 @@ + diff --git a/templates/widgets/w_route_info.html b/templates/widgets/w_route_info.html new file mode 100644 index 0000000..9810cae --- /dev/null +++ b/templates/widgets/w_route_info.html @@ -0,0 +1,34 @@ + {% for route in routes %} +
+
+ {{ route.get_cargo_type_display }} + {{ route.weight }} + {{ route.get_type_transport_display }} +
+ {{ route.from_country }}/{{ route.from_city }} + {{ route.to_country }}/{{ route.to_city }} +
+
+ Отправка: {{route.departure_DT }} + Прибытие: {{route.arrival_DT }} +
+
+ Откуда заберёт:{{ route.from_place }} + Куда доставит:{{ route.to_place }} +
+
+ +
+ + Контакты перевозчика: + {{ route.owner.last_name }} {{ route.owner.first_name }} + {{ route.phone }} + {{ route.extra_phone }} + {{ route.owner.email }} + + + +
+
+ + {% endfor %}