diff --git a/AuthApp/js_urls.py b/AuthApp/js_urls.py index 00a21a8..f071d50 100644 --- a/AuthApp/js_urls.py +++ b/AuthApp/js_urls.py @@ -15,7 +15,7 @@ urlpatterns = [ path('my_routes/', my_routes_ajax, name='my_routes_ajax'), path('subscribe/', subscribe_ajax, name='subscribe_ajax'), - path('new_msg_to_user/', new_msg_to_user_ajax, name='new_msg_to_user' ), + path('chats/', chats_ajax, name='chats_ajax'), path('support_tickets/', support_tickets_ajax, name='support_tickets_ajax'), diff --git a/AuthApp/js_views.py b/AuthApp/js_views.py index 4d51687..d3c1fde 100644 --- a/AuthApp/js_views.py +++ b/AuthApp/js_views.py @@ -25,14 +25,14 @@ def subscribe_ajax(request): return JsonResponse({'html': html}, status=200) @login_required(login_url='/profile/login/') -def new_msg_to_user_ajax(request): +def chats_ajax(request): if request.method != 'POST': raise Http404 Dict = { } - html = render_to_string('blocks/profile/b_new_msg_to_user.html', Dict, request=request) + html = render_to_string('blocks/profile/b_chats.html', Dict, request=request) return JsonResponse({'html': html}, status=200) @login_required(login_url='/profile/login/') diff --git a/AuthApp/urls.py b/AuthApp/urls.py index 4a8dac7..f2aec95 100644 --- a/AuthApp/urls.py +++ b/AuthApp/urls.py @@ -9,6 +9,8 @@ urlpatterns = [ path('registration/', registration_View, name='registration_page'), path('', user_profile_View, name='user_profile'), + path('chat//', chat_w_user_View, name='chat_w_user'), + path('chat/', chat_w_user_View, name='chat_w_user_wo_user_id'), path('login/', login_View, name='login_profile'), diff --git a/AuthApp/views.py b/AuthApp/views.py index 4cc18a5..1762574 100644 --- a/AuthApp/views.py +++ b/AuthApp/views.py @@ -22,6 +22,34 @@ def registration_View(request): return HttpResponse(t.render(Dict, request)) + +@login_required(login_url='/profile/login/') +def chat_w_user_View(request, user_id=None): + from ChatServiceApp.funcs import get_chat_receivers_for_user, get_msgs_for_chat_w_users + + receivers = get_chat_receivers_for_user(request.user) + + cur_chat_msgs = None + + try: + cur_receiver = User.objects.get(id=user_id) + if not cur_receiver in receivers: + receivers.insert(0, cur_receiver) + cur_chat_msgs = get_msgs_for_chat_w_users(request.user, cur_receiver) + except User.DoesNotExist: + cur_receiver = None + + + Dict = { + 'page': 'chat', + 'cur_receiver': cur_receiver, + 'receivers': receivers, + 'messages':cur_chat_msgs + } + + t = loader.get_template('pages/profile/p_user_profile.html') + return HttpResponse(t.render(Dict, request)) + @login_required(login_url='/profile/login/') def user_profile_View(request): diff --git a/ChatServiceApp/funcs.py b/ChatServiceApp/funcs.py index 7e74b52..0097fdb 100644 --- a/ChatServiceApp/funcs.py +++ b/ChatServiceApp/funcs.py @@ -1,4 +1,27 @@ from .models import * +from django.db.models import Q + + +def get_msgs_for_chat_w_users(user1, user2): + + msgs = Message.objects.filter( + Q(sender=user1) | Q(receiver=user1), + Q(sender=user2) | Q(receiver=user2), + group=None + ) + return msgs + +def get_chat_receivers_for_user(user): + receivers = Message.objects.filter( + Q(sender=user) | Q(receiver=user), + group=None + ).order_by('-modifiedDT').values('sender', 'receiver') + + receivers_list = [] + receivers_list.extend([item['sender'] for item in receivers if item['sender'] != user]) + receivers_list.extend([item['receiver'] for item in receivers if item['receiver'] != user]) + + return receivers_list def get_messages_for_ticket(ticket): return ticket.rel_messages_for_group.filter(enable=True).order_by('-modifiedDT') diff --git a/ChatServiceApp/js_urls.py b/ChatServiceApp/js_urls.py index 5b6c852..774c4a0 100644 --- a/ChatServiceApp/js_urls.py +++ b/ChatServiceApp/js_urls.py @@ -11,4 +11,5 @@ urlpatterns = [ path('create_ticket/', create_ticket_ajax, name='create_ticket_ajax'), path('support_show_chat_by_ticket/', support_show_chat_by_ticket_ajax, name='support_show_chat_by_ticket_ajax'), path('send_msg/', send_msg_ajax, name='send_msg_ajax'), + path('show_chat_w_user/', show_chat_w_user_ajax, name='show_chat_w_user_ajax'), ] \ No newline at end of file diff --git a/ChatServiceApp/js_views.py b/ChatServiceApp/js_views.py index e823aca..45708a6 100644 --- a/ChatServiceApp/js_views.py +++ b/ChatServiceApp/js_views.py @@ -15,6 +15,34 @@ from .funcs import * import json +@login_required(login_url='/profile/login/') +def show_chat_w_user_ajax(request): + + if request.method != 'POST': + raise Http404 + + try: + + data = json.loads(request.body) + + from AuthApp.models import User + cur_receiver = User.objects.get(id=data['user_id']) + + Dict = { + 'cur_receiver': cur_receiver, + 'messages': get_msgs_for_chat_w_users(request.user, cur_receiver), + } + + tpl_name = 'blocks/profile/b_chats.html' + + html = render_to_string(tpl_name, Dict, request=request) + return JsonResponse({'html': html}, status=200) + + except Exception as e: + msg = f'show_chat_w_user_ajax Error = {str(e)}' + return JsonResponse({'error': msg}, status=400) + + @login_required(login_url='/profile/login/') def send_msg_ajax(request): from AuthApp.models import User diff --git a/ChatServiceApp/templatetags/tt_chat.py b/ChatServiceApp/templatetags/tt_chat.py index 4c93e8e..e65385a 100644 --- a/ChatServiceApp/templatetags/tt_chat.py +++ b/ChatServiceApp/templatetags/tt_chat.py @@ -17,10 +17,12 @@ def get_msg_side(cur_user, ticket, msg): return 'right' else: return 'left' - else: + elif ticket: if ticket.owner == cur_user: return 'right' else: return 'left' + else: + return 'right' # return 'left' \ No newline at end of file diff --git a/RoutesApp/admin.py b/RoutesApp/admin.py index 5789c13..715b9c6 100644 --- a/RoutesApp/admin.py +++ b/RoutesApp/admin.py @@ -2,7 +2,7 @@ from sets.admin import * from .models import * from django.contrib import admin -class Admin_Route(Admin_Trans_BaseModelViewPage): +class Admin_Route(Admin_Trans_BaseModel): list_display = [ 'id', 'type_transport', 'cargo_type', 'departure_DT', 'from_address_point', 'from_place', @@ -10,4 +10,6 @@ class Admin_Route(Admin_Trans_BaseModelViewPage): 'order', 'modifiedDT', 'createDT' ] + list_display_links = ['id'] + admin.site.register(Route,Admin_Route) diff --git a/RoutesApp/funcs.py b/RoutesApp/funcs.py index 86e1b4b..ba014fd 100644 --- a/RoutesApp/funcs.py +++ b/RoutesApp/funcs.py @@ -1,16 +1,21 @@ from .models import * -def get_routes_for_user(user): +def get_routes_Dict(user=None): from ReferenceDataApp.models import Airport, Country, City - if not user and user.is_authenticated: - errors_Dict = { - 'errors': { - 'all__': f'ошибка идентификации пользователя' - } - } - return errors_Dict + # if not user and user.is_authenticated: + # errors_Dict = { + # 'errors': { + # 'all__': f'ошибка идентификации пользователя' + # } + # } + # return errors_Dict + kwargs = {} + if user: + kwargs.update({ + 'owner': user + }) - routes = Route.objects.filter(owner=user) + routes = Route.objects.filter(**kwargs).order_by('-modifiedDT') res_Dict = {} diff --git a/RoutesApp/js_views.py b/RoutesApp/js_views.py index b9ba100..bead357 100644 --- a/RoutesApp/js_views.py +++ b/RoutesApp/js_views.py @@ -14,7 +14,7 @@ from datetime import datetime from django.template.loader import render_to_string from django.urls import reverse from .forms import * -from .funcs import get_routes_for_user +from .funcs import get_routes_Dict def edit_route_ajax(request): @@ -153,7 +153,7 @@ def get_routes_ajax(request): raise Http404 try: - routes_Dict = get_routes_for_user(request.user) + routes_Dict = get_routes_Dict(request.user) if 'errors' in routes_Dict: return JsonResponse(routes_Dict, status=400) @@ -209,7 +209,7 @@ def create_or_change_route_ajax(request, route_id=None): obj.owner = request.user obj.save() - routes_Dict = get_routes_for_user(request.user) + routes_Dict = get_routes_Dict(request.user) if 'errors' in routes_Dict: form.errors.update(routes_Dict['errors']) diff --git a/RoutesApp/urls.py b/RoutesApp/urls.py new file mode 100644 index 0000000..ab2668d --- /dev/null +++ b/RoutesApp/urls.py @@ -0,0 +1,10 @@ +# coding=utf-8 +from django.urls import path +from .views import * +from django.contrib.auth import views + +urlpatterns = [ + + path('route_search_results/', route_search_results_View, name='route_search_results_View'), + +] \ No newline at end of file diff --git a/RoutesApp/views.py b/RoutesApp/views.py index 91ea44a..df370b7 100644 --- a/RoutesApp/views.py +++ b/RoutesApp/views.py @@ -1,3 +1,25 @@ from django.shortcuts import render -# Create your views here. +from uuid import uuid1 +from .models import * +from django.contrib import auth +from django.http import HttpResponse, Http404 +from django.template import loader, RequestContext +from django.contrib.auth.decorators import login_required +from BaseModels.mailSender import techSendMail +from django.utils.translation import gettext as _ +from datetime import datetime +from .funcs import * + +def route_search_results_View(request): + + Dict = {} + + routes = get_routes_Dict() + if routes: + Dict = { + 'routes': routes['routes'] + } + + t = loader.get_template('pages/p_results_find_route.html') + return HttpResponse(t.render(Dict, request)) diff --git a/TWB/urls.py b/TWB/urls.py index b29fc41..5505b0b 100644 --- a/TWB/urls.py +++ b/TWB/urls.py @@ -20,7 +20,10 @@ urlpatterns += i18n_patterns( path('profile/', include('AuthApp.urls')), path('user_account/', include('AuthApp.js_urls')), + path('routes/', include('RoutesApp.js_urls')), + path('routes/', include('RoutesApp.urls')), + path('messages/', include('ChatServiceApp.js_urls')), path('reference_data/', include('ReferenceDataApp.js_urls')), diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index 279e760..eb17e78 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -6,6 +6,31 @@ width: 100% !important; } + + +.text-align-center{ + text-align: center; + width: 100%; + +} + + +.title_page{ + font-size: 44px; + color: #272424; + font-weight: 700; +} + +.cut-width{ + max-width: 1280px; + margin: auto; +} + +.clear_both{ + clear: both; +} + + /**/ .title-profile-cont{ @@ -329,13 +354,14 @@ } .container-messages{ - height: 74%; + height: calc(74% - 70px); width: 100%; - /*transform: rotate(180deg);*/ + /* transform: rotate(180deg); */ overflow-y: auto; - /*transform: scaleY(-1);*/ + /* transform: scaleY(-1); */ display: flex; flex-direction: column-reverse; + padding-top: 70px; } @@ -512,6 +538,7 @@ .insert_users{ /*min-height: 440px;*/ + margin-bottom: 20px; } /*messgae*/ @@ -581,7 +608,7 @@ .container_text_message{ width: 100%; - min-height: 60px; + /*min-height: 60px;*/ border-radius: 10px; } @@ -634,4 +661,298 @@ padding-top: 10px; border-top: 1px solid #E6E6E6; width: 100%; +} + +/*p_results_find_route*/ + +.container_form_search_carrier{ + height: 120px; + width: 100%; + background: #FFF; + box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20); + margin-top: 60px; + margin-bottom: 40px; + border-radius: 10px; +} + +.block-filters-find-route{ + min-height: 660px; + background: #FFFFFF; + box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20); + width: 30%; + float: left; +} + +.block-finded-routes{ + width: 68%; + float: right; + /*display: inline-block;*/ +} + +.carrier-card{ + width: 100%; + /*height: 830px;*/ + background: #FFFFFF; + box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20); + margin-bottom: 20px; + border-radius: 10px; + /*padding: 20px;*/ +} + +.left-part-carrier-card{ + width: 58%; + float: left; + padding: 2%; + border-right: 1px solid #E6E6E6; +} + +.first-line-card-carrier{ + margin-bottom: 20px; +} + +.carrier-title{ + font-size: 20px; + font-weight: 500; + color: #272424; + width: 50%; + float: left; + text-align: left; + display: block; +} + +.type_transportation_carrier{ + width: 50%; + float: right; + text-align: -webkit-right; + display: block; +} + +.from-to-country-container-carrier{ + width: calc(100% - 70px); + margin: auto; + background: #F8F8F8; + box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20); + padding-top: 20px; + padding-bottom: 20px; + padding-left: 35px; + padding-right: 35px; + margin-bottom: 20px; +} + +.from-to-country-text.left{ + color: #272424; + font-size: 16px; + font-weight: 500; + width: 46%; + /*padding-top: 20px;*/ + /*padding-bottom: 20px;*/ + /*padding-left: 80px;*/ + float: left; + text-align: right; +} + +.from-to-country-text.right{ + color: #272424; + font-size: 16px; + font-weight: 500; + width: 46%; + /*padding-top: 20px;*/ + /*padding-bottom: 20px;*/ + /*padding-right: 80px;*/ + float: right; + text-align: left; +} + + +.line_inf_about_moving{ + width: 100%; + margin-bottom: 20px; +} + +.container_inf_about_moving.second{ + margin-bottom: 0; +} + +.splitter-from-to-country{ + border: 1px solid #FF613A; + width: 20px; + display: inline-block; + /*width: 5%;*/ + margin-bottom: 4px; + margin-left: 9px; +} + +.container_inf_about_moving{ + display: block; + width: 100%; +} + + +.carrier_inf_moving.left{ + width: 41%; + float: left; + text-align: left; +} +.carrier_inf_moving.right{ + width: 41%; + float: right; + text-align: right; +} + +.splliter-left-right-part-carrier-card{ + border: 1px solid #E6E6E6; + height: 100%; + display: inline-block; + transform: rotate(180deg) ; + position: relative; + left: 70%; +} + +.inf_carrier{ + padding-top: 15px; + display: block; + margin-bottom: 15px; +} + +.phones_carrier{ + text-decoration: none; + color: #000000; + font-size: 16px; + padding-bottom: 10px; + display: block; +} + +.phones_carrier_span{ + position: relative; + top: 6px; + background: linear-gradient(99deg, #040404 56%, #9f9f9f 25%, #ffffff); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + transition: 200ms; + width: calc(90% - 10px); + overflow: hidden; + float: right; + padding-right: 10px; +} + +.inf_carrier_icon{ + width: 10%; +} + +.phones_carrier_span.active{ + background: unset; + -webkit-background-clip: unset; + -webkit-text-fill-color: unset; + overflow: unset; + overflow-wrap: break-word; +} + +.phones_carrier input{ + display: none; +} +.email_carrier{ + text-decoration: none; + color: #000000; + font-size: 16px; + padding-bottom: 10px; + display: block; +} + +.email_carrier_span{ + position: relative; + top: 5px; + background: linear-gradient(99deg, #040404 2%, #f5f5f5 16%, #ffffff); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + transition: 200ms; + width: calc(90% - 10px); + float: right; + overflow: hidden; + padding-right: 10px; +} + +.email_carrier_span.active{ + background: unset; + -webkit-background-clip: unset; + -webkit-text-fill-color: unset; + overflow: unset; + overflow-wrap: break-word; +} + +.email_carrier input{ + display: none; +} + +.open_inf_carrier{ + font-size: 16px; + font-weight: 500; + color: #272424; + border: 2px solid #FF613A; + padding: 8px 16px; + background: #FFFFFF; + transition: 200ms; + border-radius: 10px; + width: 100%; +} + +.open_inf_carrier:hover{ + background: #FF613A; + color: #FFFFFF; +} + + +.open_chat_carrier{ + display: none; +} + +.open_chat_carrier.active{ + display: block; + font-size: 16px; + font-weight: 500; + color: #272424; + border: 2px solid #00a420; + padding: 8px 16px; + background: #FFFFFF; + border-radius: 10px; + width: 100%; + margin-bottom: 10px; +} + +/*.open_chat_carrier:hover{*/ +/* color: #FFFFFF;*/ +/* background: #00A420;*/ +/*}*/ + +.inf_carrier_container{ + width: 33%; + float: right; + padding: 2%; +} + +.title_container_inf_carrier{ + font-weight: 500; + font-size: 20px; + color: #272424; + padding-bottom: 10px; +} + +.name_carrier{ + font-size: 16px; + color: #272424; + font-weight: 400; + position: relative; + top: 11px; + left: 4px; +} + +.from-to-city-text{ + font-size: 14px; + color: #27242499; + padding-top: 10px; +} + +.arrow_inf_about_moving{ + position: relative; + top: 19px; + left: 18px; } \ No newline at end of file diff --git a/static/css/styles.css b/static/css/styles.css index 0682362..e5a6378 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -106,15 +106,8 @@ html, body{ height: 100%; } -/*uni-classes (boris)*/ -.text-align-center{ - text-align: center; -} - -/*uno classes end (boris)*/ - /*Стилизация radio button */ diff --git a/static/img/svg/arrow.svg b/static/img/svg/arrow.svg new file mode 100644 index 0000000..f1df9b1 --- /dev/null +++ b/static/img/svg/arrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/img/svg/email.svg b/static/img/svg/email.svg new file mode 100644 index 0000000..23407a3 --- /dev/null +++ b/static/img/svg/email.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/static/js/find_route.js b/static/js/find_route.js new file mode 100644 index 0000000..288149f --- /dev/null +++ b/static/js/find_route.js @@ -0,0 +1,33 @@ +function show_inf_carrier (el) { + event.preventDefault() + let form = el.form + let ph_1 = form[0] + let ph_2 = form[1] + let em_2 = form[2] + let btn_open_chat = form[3] + + ph_1.parentElement.children[1].classList.toggle("active"); + try { + ph_2.parentElement.children[1].classList.toggle("active"); + } catch { + // p + } + + em_2.parentElement.children[1].classList.toggle("active"); + btn_open_chat.classList.toggle("active") + if (el.style.display === "none"){ + el.style.display = "" + } else { + el.style.display = "none" + } + +} + +function open_chat (user_id){ + event.preventDefault() + let host = window.location.origin + let user_id_ = user_id.toString() + let href = host + '/ru/profile/chat/' + user_id_ + // window.location.href = host + '/profile/chat/' + user_id + window.location.replace(href) +} \ No newline at end of file diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index 0219c78..98bf89e 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -170,7 +170,7 @@ function selectedUserMessenger (el,ticket_id){ }); } -function sendMessage(id_ticket,sender,receiver){ +function sendMessage(id_ticket=null,sender,receiver){ event.preventDefault() let text = document.querySelector(".enter-message-inp").value @@ -179,14 +179,24 @@ function sendMessage(id_ticket,sender,receiver){ // } else { - let data = { - 'ticket_id': id_ticket, - 'sender': sender, - 'receiver': receiver, - 'text': text + let data = {} + if (id_ticket === null){ + data = { + 'sender': sender, + 'receiver': receiver, + 'text': text + } + } else { + data = { + 'ticket_id': id_ticket, + 'sender': sender, + 'receiver': receiver, + 'text': text + } } + $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, url: '/ru/messages/send_msg/', @@ -247,3 +257,5 @@ function sendMessageEnter (e,id_ticket,sender,receiver){ // } } + + diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 1001d9e..899e7c6 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -1,7 +1,7 @@ function writeMessage(){ $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, - url: '/ru/user_account/new_msg_to_user/', + url: '/ru/user_account/chats/', type: "POST", // async: true, cache: false, @@ -254,7 +254,7 @@ function sendRoute(el, routeID = null){ }, error: function (data, exception){ - document.querySelector(".info_profile").innerHTML = data.responseText; + document.querySelector(".info_profile").innerHTML = data.responseJSON.html; @@ -396,8 +396,8 @@ function getRoute(){ 'route_id': id } - $.ajax({ - headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, + $.ajax({ + headers: {"X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val()}, url: '/ru/routes/edit_route/', type: "POST", // async: true, @@ -406,14 +406,14 @@ function getRoute(){ contentType: false, // enctype: 'json', data: JSON.stringify(route_obj), - success: function(data){ + success: function (data) { console.log('data received') // location.href = '/profile' document.querySelector(".info_profile").innerHTML = data.html; }, - error: function (data, exception){ + error: function (data, exception) { console.log(101) } diff --git a/templates/blocks/b_user_profile.html b/templates/blocks/b_user_profile.html index 8e39b96..732cab5 100644 --- a/templates/blocks/b_user_profile.html +++ b/templates/blocks/b_user_profile.html @@ -31,20 +31,10 @@
-

Добро пожаловать: {{ user.first_name }} {{ user.last_name }} ({{ user.username }})

-
-
-
Статус: {{ user.user_profile.get_account_type_display }}
-{#
#} -{#
#} -
-
-
Если хотите отправить посылку - зарегистрируйтесь, как отправитель
-
Если у Вас возникнут вопросы Вы можете связаться с нами: support@twb.com
-
У Вас три новых сообщения. Посмотреть
-
Хотите получать уведомление о появлении посылок? Заполните форму
+ {% if not page %} + {% include "blocks/profile/b_profile_first_page.html" %} + {% elif page == 'chat' %} + {% include "blocks/profile/b_chats.html" %} + {% endif %}
\ No newline at end of file diff --git a/templates/blocks/profile/b_chats.html b/templates/blocks/profile/b_chats.html new file mode 100644 index 0000000..1d8d75e --- /dev/null +++ b/templates/blocks/profile/b_chats.html @@ -0,0 +1,87 @@ +{% load static %} + +
+

Написать сообщение

+
+ +{#
#} +{#
#} +{#
#} +{#
#} +{# #} +{# Сергейко Сергей#} +{#
#} +{#
#} +{# #} +{# #} +{#
#} +{#
#} +{#
#} +{# {% include "widgets/w_message.html" %}#} +{#
#} +{# #} +{#
#} +{#
#} +{# Пользователи#} +{#
#} +{# {% include "widgets/w_tab_user.html" %}#} +{#
#} +{#
#} +{#
#} + + +
+
+
+ + {{ ticket.manager.last_name }} {{ ticket.manager.first_name }} +
+
+ + +
+
+ +
+ {% if not messages %} + {% with text=ticket.text modifiedDT=ticket.modifiedDT %} + {% include "widgets/w_message.html" %} + {% endwith %} + {% else %} + {% for msg in messages %} + {% with text=msg.text modifiedDT=msg.modifiedDT %} + {% include "widgets/w_message.html" %} + {% endwith %} + {% endfor %} + {% endif %} +
+ + +
+
+ Неразобранные тикеты +
+ {% if tickets_wo_manager %} + {% for item in tickets_wo_manager %} + {% include "widgets/w_tab_user.html" %} + {% endfor %} + {% endif %} + +
+
\ No newline at end of file diff --git a/templates/blocks/profile/b_create_ticket.html b/templates/blocks/profile/b_create_ticket.html index e040693..d432270 100644 --- a/templates/blocks/profile/b_create_ticket.html +++ b/templates/blocks/profile/b_create_ticket.html @@ -46,4 +46,6 @@ {# #} - \ 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 deleted file mode 100644 index d47dce3..0000000 --- a/templates/blocks/profile/b_new_msg_to_user.html +++ /dev/null @@ -1,38 +0,0 @@ -{% load static %} - -
-

Написать сообщение

-
- -
-
-
-
- - Сергейко Сергей -
-
- - -
-
-
- {% include "widgets/w_message.html" %} -
- -
-
- Пользователи -
- {% include "widgets/w_tab_user.html" %} -
-
-
\ No newline at end of file diff --git a/templates/blocks/profile/b_profile_first_page.html b/templates/blocks/profile/b_profile_first_page.html new file mode 100644 index 0000000..a751731 --- /dev/null +++ b/templates/blocks/profile/b_profile_first_page.html @@ -0,0 +1,15 @@ +

Добро пожаловать: {{ user.first_name }} {{ user.last_name }} ({{ user.username }})

+
+
+
Статус: {{ user.user_profile.get_account_type_display }}
+{#
#} +{#
#} +
+
+
Если хотите отправить посылку - зарегистрируйтесь, как отправитель
+
Если у Вас возникнут вопросы Вы можете связаться с нами: support@twb.com
+
У Вас три новых сообщения. Посмотреть
+
Хотите получать уведомление о появлении посылок? Заполните форму
\ No newline at end of file diff --git a/templates/pages/p_results_find_route.html b/templates/pages/p_results_find_route.html new file mode 100644 index 0000000..6f6e029 --- /dev/null +++ b/templates/pages/p_results_find_route.html @@ -0,0 +1,30 @@ +{% extends "tb_base.html" %} +{% load static %} + +{% block meta %} + +{% endblock %} + +{% block content %} +
+
+

Поиск перевозчика

+
+
+
+
+
+ +
+
+ {% for route in routes %} + {% include "widgets/w_carrier_card.html" %} + {% endfor %} + + +
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/templates/small_INCLUDES/carrier_card/inf_about_moving.html b/templates/small_INCLUDES/carrier_card/inf_about_moving.html new file mode 100644 index 0000000..7765f34 --- /dev/null +++ b/templates/small_INCLUDES/carrier_card/inf_about_moving.html @@ -0,0 +1,31 @@ +{% load static %} +
+
+
+
Отправка:
+
{% if route.arrival_DT %}{{ route.arrival_DT }}{% else %}Неизвестно{% endif %}
+ +
+ +
+
Прибытие:
+
{% if route.departure_DT %}{{ route.departure_DT }}{% else %}Неизвестно{% endif %}
+ +
+
+
+
+
+
Откуда заберёт:
+
{% if route.from_place == 'airport' %}{{ route.from_airport }}{% else %}{{ route.get_from_place_display }}{% endif %}
+ +
+ +
+
Куда доставит:
+
{% if route.to_place == 'airport' %}{{ route.to_airport }}{% else %}{{ route.get_to_place_display }}{% endif %}
+ +
+
+
+
\ No newline at end of file diff --git a/templates/tb_base.html b/templates/tb_base.html index 67e656d..1132407 100644 --- a/templates/tb_base.html +++ b/templates/tb_base.html @@ -8,17 +8,19 @@ + - + + {% block meta %} - {% endblock %}
+ {% include 'blocks/b_header.html' %} {% block content %} diff --git a/templates/widgets/w_carrier_card.html b/templates/widgets/w_carrier_card.html new file mode 100644 index 0000000..b5208e2 --- /dev/null +++ b/templates/widgets/w_carrier_card.html @@ -0,0 +1,56 @@ +{% load static %} +
+
+
+
+ Перевозчик: +
+
+ {{ route.get_type_transport_display }} +
+
+
+
+
+ {% if route.from_country %}{{ route.from_country }}{% else %}Неизвестно{% endif %} / {% if route.from_city %}{{ route.from_city }}{% else %}Неизвестно{% endif %} +
+
+
+ {% if route.to_country %}{{ route.to_country }}{% else %}Неизвестно{% endif %} / {% if route.to_city %}{{ route.to_city }}{% else %}Неизвестно{% endif %} +
+
+ {% include "small_INCLUDES/carrier_card/inf_about_moving.html" %} + +
+{#
#} +
+
Контакты отправителия:
+
+ + {{ route.owner.last_name }} {{ route.owner.first_name }} +
+
+ + + +
+ +
+
+ +
\ No newline at end of file