dev #14

Merged
sysadminix merged 51 commits from dev into main 2024-10-02 13:52:51 +03:00
31 changed files with 1539 additions and 105 deletions

View File

@@ -26,7 +26,7 @@ class RegistrationForm(forms.Form):
email = forms.EmailField()
password = forms.CharField(widget=forms.PasswordInput())
confirm_password = forms.CharField(widget=forms.PasswordInput())
tel = forms.CharField()
tel = forms.CharField(required=False)
agreement = forms.BooleanField(initial=False, required=True)
def __init__(self, *args, **kwargs):

View File

@@ -23,6 +23,8 @@ urlpatterns = [
path('support_tickets/', support_tickets_ajax, name='support_tickets_ajax'),
path('password_recovery/', password_recovery_ajax, name='password_recovery_ajax'),
path('password_recovery_confirm/', password_recovery_confirm_ajax, name='password_recovery_confirm_ajax'),
path('change_profile/', change_profile_ajax, name='change_profile_ajax'),
path('change_profile_confirm/', change_profile_confirm_ajax, name='change_profile_confirm_ajax'),

View File

@@ -31,6 +31,124 @@ from GeneralApp.funcs import get_and_set_lang
# html = render_to_string('blocks/profile/b_subscribe.html', Dict, request=request)
# return JsonResponse({'html': html}, status=200)
def password_recovery_confirm_ajax(request):
if request.method != 'POST':
raise Http404
if not 'pass' in request.POST or not 'pass_confirm' in request.POST or not 'user_id' in request.POST:
raise Http404
lang = get_and_set_lang(request)
try:
if not request.POST['pass'] or request.POST['pass'] != request.POST['pass_confirm']:
return JsonResponse({
'status': 'error',
'error': _('Пароли не совпадают')
}, status=400)
user = User.objects.get(id=request.POST['user_id'])
user.set_password(request.POST['pass'])
user.user_profile.authMailCode = None
user.user_profile.save(update_fields=['authMailCode'])
user.is_active = True
user.save()
return JsonResponse({
'status': 'success',
'message': _('Пароль был успешно изменен')
})
except Exception as e:
return JsonResponse({
'status': 'error',
'error': str(e)
}, status=400)
def password_recovery_ajax(request):
if request.method != 'POST':
raise Http404
lang = get_and_set_lang(request)
try:
email = request.POST['email']
try:
user = User.objects.get(email=email)
except User.DoesNotExist:
return JsonResponse({
'status': 'error',
'error': _('Пользователь с указанным email не зарегистрирован на сайте')
}, status=400)
user.user_profile.authMailCode = uuid1().hex
user.user_profile.save(update_fields=['authMailCode'])
from GeneralApp.funcs_options import get_options_by_opt_types, get_mail_send_options
sets = get_options_by_opt_types(['domain', 'project_name'], only_vals=True)
subject = _('Изменение пароля учетной записи на сайте tripwb.com')
mail_txt = _('Вы получили это письмо потому что '
'был произведен запрос на изменение пароля '
'для данного email на сайте tripwb.com.<br>'
'<br>'
'Если Вы не выполняли запрос - просто проигнорируйте это письмо.<br><br>'
'Если же это были Вы и Вам требуется изменить пароль от учетной записи - '
'перейдите по ссылке, указанной ниже.<br><br>')
link = sets["domain"] + f'/profile/reset_password/{str(user.id)}/{user.user_profile.authMailCode}/'
link_str = f'<a href="{link}">ИЗМЕНИТЬ ПАРОЛЬ</a><br><br>'
sign_txt = _('Спасибо за то, что вы с нами!<br>'
'С уважением,<br>'
'Команда Trip With Bonus.<br>')
Dict = {
'logo': f'{sets["domain"]}/static/img/svg/LogoMobile.svg',
'project_name': sets['project_name'],
'message_title': subject,
'message_text': f'<p style="padding-left: 20px; line-height: 30px;">'
f'{mail_txt}'
f'{link_str}'
f'{sign_txt}'
f'</p>'
}
html = render_to_string('mail/m_request_offer.html', Dict, request)
from BaseModels.mailSender import admin_send_mail_by_SMTPlib
mail_sets = get_mail_send_options()
to = [email]
res = admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
to = ['web@syncsystems.net']
res = admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
return JsonResponse({
'status': 'sended',
'message': _('На email') + ' ' + email + ' '
+ _('отправлено письмо с инструкциями для восстановления пароля')
})
except Exception as e:
return JsonResponse({
'status': 'error',
'error': str(e)
}, status=400)
def mailing_subscribe_ajax(request):
if request.method != 'POST':
@@ -195,7 +313,14 @@ def send_message_ajax(request):
html = render_to_string('mail/m_request_offer.html', Dict, request)
from BaseModels.mailSender import admin_send_mail_by_SMTPlib
mail_sets = get_mail_send_options()
to = [mail_sets['sender_email'], 'web@syncsystems.net']
to = [mail_sets['sender_email']]
res = admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
to = ['web@syncsystems.net']
res = admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
@@ -213,7 +338,6 @@ def send_message_ajax(request):
res_Dict.update(get_add_to_ajax_response_Dict(request.user))
return JsonResponse(res_Dict)
except Exception as e:
return JsonResponse({
'status': 'error',
@@ -514,15 +638,23 @@ def send_check_email_after_registration(data_Dict, user):
html = render_to_string('mail/m_confirm_email.html', Dict)
from BaseModels.mailSender import admin_send_mail_by_SMTPlib
mail_sets = get_mail_send_options()
to = [user.email, 'web@syncsystems.net', 'sa@a3-global.com', 'sysadmin.hax@gmail.com']
to = [user.email]
res = admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
to = ['web@syncsystems.net', 'sa@a3-global.com', 'sysadmin.hax@gmail.com']
admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
return res
except Exception as e:
print(f'send_registration_mail Error = {str(e)}')
return None

View File

@@ -8,6 +8,9 @@ from django.contrib.auth import views
urlpatterns = [
path('registration/', registration_View, name='registration_page'),
path('reset_password/<int:user_id>/<str:token>/',
recovery_password_page_View, name='recovery_password_page'),
# path('', user_profile_View, name='user_profile'),
# path('page/chat/<int:user_id>/', chat_w_user_View, name='chat_w_user'),
# path('page/chat/', chat_w_user_View, name='chat_w_user_wo_user_id'),

View File

@@ -37,15 +37,23 @@ def send_registration_mail(user):
html = render_to_string('mail/m_registration.html', Dict)
from BaseModels.mailSender import admin_send_mail_by_SMTPlib
mail_sets = get_mail_send_options()
to = [user.email, 'web@syncsystems.net', 'sa@a3-global.com', 'sysadmin.hax@gmail.com']
to = [user.email]
res = admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
to = ['web@syncsystems.net', 'sa@a3-global.com', 'sysadmin.hax@gmail.com']
admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
return res
except Exception as e:
print(f'send_registration_mail Error = {str(e)}')
return None
@@ -270,12 +278,19 @@ def decode_get_param(data):
def recovery_password_user(request, uidb64=None, token=None):
from django.contrib.auth.views import PasswordResetConfirmView
def recovery_password_page_View(request, user_id, token):
try:
user = User.objects.get(id=user_id, user_profile__authMailCode=token)
except User.DoesNotExist:
raise Http404
return PasswordResetConfirmView(request=request, uidb64=uidb64, token=token
)
Dict = {
'user': user
}
t = loader.get_template('pages/profile/p_password_recovery.html')
response = get_inter_http_response(t, Dict, request)
return response

View File

@@ -16,12 +16,60 @@ import json
from datetime import datetime, timedelta
def test_code(request):
if (not request.user
or not request.user.is_active
or not request.user.is_authenticated
or not request.user.is_staff
):
raise Http404
from RoutesApp.funcs import get_city_by_type_transport_and_address_point
from RoutesApp.models import Route
from ReferenceDataApp.models import Airport, City
res = None
from_air = Airport.objects.get(iata_code='MSQ')
to_air = Airport.objects.get(iata_code='SVO')
routes = [
Route(
type_transport='road',
departure_DT=datetime.now() + timedelta(days=7),
arrival_DT=datetime.now() + timedelta(days=8),
from_address_point=to_air.city.id,
to_address_point=from_air.city.id,
from_city=to_air.city,
to_city=from_air.city,
weight=item,
phone='0987654321',
owner=request.user
) for item in range(1000)
]
# routes = [
# Route(
# type_transport='avia',
# departure_DT=datetime(year=2024, month=9, day=1),
# arrival_DT=datetime(year=2024, month=9, day=3),
# from_address_point = from_air.id,
# to_address_point = to_air.id,
# from_city = from_air.city,
# to_city = to_air.city,
# weight = item,
# phone = '1234567890',
# owner = request.user
# ) for item in range(1000)
# ]
Route.objects.bulk_create(routes)
# from RoutesApp.search_matches import search_matches
# routes = Route.objects.filter()[:10]
# msg = search_matches(routes)
# from ReferenceDataApp.funcs import parse_data
# parse_data()

View File

@@ -5,15 +5,25 @@ from django.contrib import admin
class Admin_Route(Admin_Trans_BaseModel):
readonly_fields = ['highlight_end_DT', 'rising_DT']
list_display = [
'id', 'owner_type', 'receive_msg_by_email', 'type_transport', 'cargo_type',
'id', 'owner_type',
'rising_DT',
'receive_msg_by_email', 'type_transport', 'cargo_type',
'departure_DT', 'from_city', 'from_place',
'arrival_DT', 'to_city', 'to_place', 'owner',
'order', 'modifiedDT', 'createDT'
]
list_editable = ['rising_DT']
list_display_links = ['id']
list_filter = ['owner_type', 'type_transport', 'cargo_type', 'from_place', 'arrival_DT', 'modifiedDT', 'createDT']
list_filter = [
'owner_type', 'type_transport',
'rising_DT',
'cargo_type',
'from_place', 'arrival_DT',
'modifiedDT', 'createDT'
]
search_fields = [
'owner__first_name', 'owner__last_name', 'from_city__name', 'to_city__name'
]

View File

@@ -2,8 +2,8 @@ from .models import *
from .forms import *
from django.utils.translation import gettext as _
from django.template.loader import render_to_string
from datetime import datetime
from django.db.models import F
from datetime import datetime, timedelta
from django.db.models import F, Q
elements_on_page = 25
@@ -258,6 +258,12 @@ def get_routes_Dict(user=None, data=None):
# rising_DT=None
# )
routes_rising_off = Route.objects.exclude(rising_DT=None).filter(
Q(rising_DT__lt=datetime.now() - timedelta(days=1)) | Q(departure_DT__lt=datetime.now())
)
if routes_rising_off:
routes_rising_off.update(rising_DT=None)
routes = Route.objects.filter(
**kwargs
).order_by(

View File

@@ -1,4 +1,5 @@
import json
from copy import deepcopy
from django.shortcuts import render
@@ -347,6 +348,7 @@ def create_or_change_route_ajax(request, route_id=None):
lang = get_and_set_lang(request)
Dict = {}
route_old_Dict = None
try:
@@ -361,6 +363,7 @@ def create_or_change_route_ajax(request, route_id=None):
if route:
form = RouteForm(data, instance=route)
Dict.update({'route': route})
route_old_Dict = deepcopy(route.__dict__)
else:
form = RouteForm(data)
@@ -381,6 +384,16 @@ def create_or_change_route_ajax(request, route_id=None):
if obj.to_address_point:
obj.to_city = get_city_by_type_transport_and_address_point(obj.type_transport, obj.to_address_point)
if route_old_Dict:
if route_old_Dict['highlight_color'] != obj.highlight_color:
obj.highlight_color = route_old_Dict['highlight_color']
if route_old_Dict['highlight_end_DT'] != obj.highlight_end_DT:
obj.highlight_end_DT = route_old_Dict['highlight_end_DT']
if route_old_Dict['rising_DT'] != obj.rising_DT:
obj.rising_DT = route_old_Dict['rising_DT']
obj.owner = request.user
obj.save()

View File

@@ -59,7 +59,7 @@ def send_mail_found_matches_routes(route, data_Dict):
mail_sets = get_mail_send_options()
to = [route.owner.email, 'web@syncsystems.net']
to = [route.owner.email]
subject = _('Мы нашли исполнителя по Вашему объявлению!')
res = admin_send_mail_by_SMTPlib(
mail_sets,
@@ -67,6 +67,13 @@ def send_mail_found_matches_routes(route, data_Dict):
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
to = ['web@syncsystems.net']
res = admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
return res

View File

@@ -30,7 +30,7 @@ def send_mail_for_user_subscribes_that_is_going_to_finish():
html = render_to_string('mail/m_user_subscribes_that_is_going_to_finish.html', Dict)
from BaseModels.mailSender import admin_send_mail_by_SMTPlib
mail_sets = get_mail_send_options()
to = [user_subscribe.user.email, 'web@syncsystems.net', 'sa@a3-global.com', 'sysadmin.hax@gmail.com']
to = [user_subscribe.user.email]
res = admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
@@ -40,7 +40,13 @@ def send_mail_for_user_subscribes_that_is_going_to_finish():
if res and type(res) == str:
print(res)
# log += f'\n{res}'
to = ['web@syncsystems.net', 'sa@a3-global.com', 'sysadmin.hax@gmail.com']
admin_send_mail_by_SMTPlib(
mail_sets,
subject=subject,
from_email=mail_sets['sender_email'], to=to,
html_content=html
)
except Exception as e:
msg = (f'send_mail_for_user_subscribes_that_is_going_to_finish '

View File

@@ -1,5 +1,5 @@
User-agent: *
Allow: /
Disallow: /
Disallow: */admin/*
Host: tripwb.com
Host: dev.tripwb.com

View File

@@ -1000,6 +1000,16 @@ section.register>form {
display: inline-block;
width: 90%;
}
.necessary_text {
color: rgba(39, 36, 36, 0.60);
/* Body text 3 */
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px;
display: inline-block;
width: 100%;
}
.button_register>button {
display: block;
@@ -1209,7 +1219,7 @@ section.login {
margin-bottom: 120px;
}
section.login>h1 {
section.login>h1, div.recovery_pas>h1 {
color: #272424;
text-align: center;
/* Heading 1 */
@@ -1221,7 +1231,7 @@ section.login>h1 {
margin-bottom: 40px;
}
section.login>form {
section.login>form, div.recovery_pas>form {
max-width: 420px;
margin: auto;
text-align: center;
@@ -1293,7 +1303,8 @@ section.login>form {
color: rgba(39, 36, 36, 0.60);
}
.call_to_reg {
cursor: pointer;
text-align: center;
color: rgba(39, 36, 36, 0.60);
font-style: normal;
font-weight: 500;
@@ -3355,6 +3366,20 @@ details[open] summary ~ *{
/*END news articles all*/
.login.hide{
display: none;
}
.recovery_pas{
display: none;
}
.recovery_pas.show{
display: block;
}
.recovery.hide{
display: none;
}

View File

@@ -3,14 +3,19 @@ function SendLoginForm(el){
event.preventDefault()
let form = el.form;
let formData = new FormData(form);
let msr = sessionStorage.getItem('mailingSubscribeRequired')
formData.set('mailingSubscribeRequired',msr)
let url = '/user_account/password_recovery/'
if(!el.classList.contains('recovery')){
url = '/user_account/login/'
let msr = sessionStorage.getItem('mailingSubscribeRequired')
formData.set('mailingSubscribeRequired',msr)
}
document.getElementsByClassName('recovery')[0].classList.add('hide')
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/user_account/login/',
url: url,
type: "POST",
// async: true,
cache: false,
@@ -21,20 +26,21 @@ function SendLoginForm(el){
success: function(data){
location.href = data.redirect_url//`/profile/page/dashboard/`
window.sessionStorage.removeItem('mailingSubscribeRequired')
window.sessionStorage.removeItem('email')
if(url === '/user_account/login/'){
location.href = data.redirect_url//`/profile/page/dashboard/`
window.sessionStorage.removeItem('mailingSubscribeRequired')
window.sessionStorage.removeItem('email')
} else if(url === '/user_account/password_recovery/'){
document.getElementById('password_recovery').innerHTML = data.message
}
},
error: function (data, exception){
document.querySelector(".login").innerHTML = data.responseJSON.html
document.getElementsByClassName('recovery')[0].classList.remove('hide')
}
});
}

View File

@@ -177,7 +177,7 @@ function load_routes (el,news=null,incrase,owner_type) {
}
let first_block_iteration = document.querySelector(`.page_paging_elements_${paging_iterator}`)
let insert_place = null
if (first_block_iteration.innerHTML){
if (first_block_iteration && first_block_iteration.innerHTML){
paging_iterator++
let new_page_paging_elements = document.createElement('div')
new_page_paging_elements.classList.add(`page_paging_elements_${paging_iterator}`)

View File

@@ -1,13 +1,19 @@
function SendRegistrationForm(el){
function SendRegistrationForm(el, user_id){
event.preventDefault()
let form = el.form;
let formData = new FormData(form);
let msr = sessionStorage.getItem('mailingSubscribeRequired')
formData.set('mailingSubscribeRequired',msr)
let url = '/user_account/password_recovery_confirm/'
formData.set('user_id', user_id)
if(!el.classList.contains('recovery')){
url = '/user_account/registration/';
let msr = sessionStorage.getItem('mailingSubscribeRequired')
formData.set('mailingSubscribeRequired',msr)
}
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/user_account/registration/',
url: url,
type: "POST",
// async: true,
cache: false,
@@ -16,12 +22,15 @@ function SendRegistrationForm(el){
// enctype: 'json',
data: formData,
success: function(data){
document.getElementById('confirm_password').innerHTML = data.message
document.querySelector('.info_text').classList.add('show')
// location.href = `/profile/page/dashboard/`
window.sessionStorage.removeItem('mailingSubscribeRequired')
window.sessionStorage.removeItem('email')
fbq('track', 'Contact');
fbq('track', 'Contact');
ttq.identify({
@@ -43,6 +52,7 @@ function SendRegistrationForm(el){
});
if(typeof ym === 'function'){
ym(97070898,'reachGoal','Registration')
return true;

View File

@@ -361,8 +361,13 @@ function selectItemAddrPoint(id, name, ctrl_name, city_DT){
let tap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4));
tap_cont.value = id;
if (local_city_time){
if (local_city_time && ctrl_name === "from_address_point_txt"){
init_departure_DT()
}
if (local_city_time && ctrl_name === "to_address_point_txt"){
init_arrival_DT()
}
@@ -600,8 +605,17 @@ function sendRoute(el, routeID = null){
inline:'start'
});
let currentUrl = window.location.pathname;
let newUrl = '';
if(currentUrl.includes('/create_route_for_customer')){
newUrl = currentUrl.replace('/create_route_for_customer', '/my_routes');
}else if(currentUrl.includes('/create_route_for_mover')){
newUrl = currentUrl.replace('/create_route_for_mover', '/my_routes');
}
window.history.replaceState(null, '', newUrl);
@@ -1390,6 +1404,13 @@ function showTabBtn(el) {
}
function showForm(){
let hide_form = document.getElementsByClassName('login')
let show_form = document.getElementsByClassName('recovery_pas')
hide_form[0].classList.add('hide')
show_form[0].classList.add('show')
}

View File

@@ -5,9 +5,10 @@
{% trans "Пароль" as p_password %}
<section class="login">
<h1>{% translate "Войдите в профиль" %}</h1>
<h1>{% translate "Войдите в профиль" %}</h1>
<form class="login_form" name="login_form" method="post">
{% csrf_token %}
<div>
{% if form.errors.all__ %}
@@ -49,6 +50,35 @@
</a>
{% endif %}
<div class="call_to_reg">{% translate "Нет аккаунта?" %} <a href="/ru/profile/registration/">{% translate "Зарегистрируйтесь" %}</a></div>
<div class="call_to_reg" onclick="showForm()">{% translate "Восстановить пароль" %}</div>
</div>
</form>
</section>
</section>
<div class="recovery_pas">
<h1>{% translate "Введите Ваш Email" %}</h1>
<form class="password_recovery" id="password_recovery" name="password_recovery" method="post">
{% csrf_token %}
<div class="inputs_l">
<input
name="email"
type="text"
placeholder={% translate "Email" %}
{% if form.data.username %} value="{{ form.data.username }}"{% endif %}
id="login_email_input"
>
{% if form.username and form.errors.username %}
<span>{{ form.errors.username }}</span>
{% endif %}
{# <div class="agree_text_l">{% translate %}</div>#}
</div>
<div class="button_register "><button class="recovery" onclick="SendLoginForm(this)">{% translate "Отправить ссылку для сброса пароля" %}</button></div>
</form>
</div>

View File

@@ -0,0 +1,107 @@
{% load i18n %}
{% trans "Пароль *" as p_password %}
{% trans "Подтвердить пароль *" as p_con_password %}
<section class="register" id="confirm_password">
<h1>{% translate "Изменение пароля" %}</h1>
<form
name="password_recovery"
method="POST"
>
{% csrf_token %}
<div class="inputs">
<div class="inp_firstname">
<input
name="pass"
onkeydown = "hideErrors(this)"
type="password"
placeholder="{{ p_password }}"
{% if form.data.password %} value="{{ form.data.password }}"{% endif %}>
{% if form.errors and form.errors.password %}
<span>{{ form.errors.password }}</span>
{% endif %}
</div>
<div><input
name="pass_confirm"
onkeydown = "hideErrors(this)"
type="password"
placeholder="{{ p_con_password }}"
{% if form.data.confirm_password %} value="{{ form.data.confirm_password }}"{% endif %}>
{% if form.errors and form.errors.confirm_password %}
<span>{{ form.errors.confirm_password }}</span>
{% endif %}
</div>
</div>
<div class="button_register">
<button type="submit" id="registration" class="recovery" onclick="SendRegistrationForm(this, {{ user.id }})"> {% translate "Сохранить пароль" %} </button>
</div>
</form>
</section>
{##}
{##}
{#<div class="registration">#}
{# <h2>Регистрация</h2>#}
{##}
{# <div class="form_radio_btn">#}
{##}
{# <input id="radio-1" type="radio" name="radio" value="1" checked>#}
{# <label for="radio-1">Перевозчик</label>#}
{##}
{# </div>#}
{# <div class="form_radio_btn">#}
{# <input id="radio-2" type="radio" name="radio" value="2">#}
{# <label for="radio-2">Отправитель</label>#}
{# </div>#}
{##}
{# <form action="">#}
{# {% csrf_token %}#}
{# <div class="reg_inputs">#}
{# <label><input name="firstname" type="text" placeholder="Имя"{% if form.data.firstname %} value="{{ form.data.firstname }}"{% endif %}></label>#}
{# {% if form.errors and form.errors.firstname %}#}
{# <span>{{ form.errors.firstname }}</span>#}
{# {% endif %}#}
{# <label><input name="email" type="text" placeholder="E-mail"{% if form.data.email %} value="{{ form.data.email }}"{% endif %}></label>#}
{# {% if form.errors and form.errors.email %}#}
{# <span>{{ form.errors.email }}</span>#}
{# {% endif %}#}
{# <label><input name="password" type="text" placeholder="Пароль"{% if form.data.password %} value="{{ form.data.password }}"{% endif %}></label>#}
{# {% if form.errors and form.errors.password %}#}
{# <span>{{ form.errors.password }}</span>#}
{# {% endif %}#}
{# <label><input name="lastname" type="text" placeholder="Фамилия"{% if form.data.lastname %} value="{{ form.data.lastname }}"{% endif %}></label>#}
{# {% if form.errors and form.errors.lastname %}#}
{# <span>{{ form.errors.lastname }}</span>#}
{# {% endif %}#}
{# <label><input name="tel" type="text" placeholder="Телефон"{% if form.data.tel %} value="{{ form.data.tel }}"{% endif %}></label>#}
{# {% if form.errors and form.errors.tel %}#}
{# <span>{{ form.errors.tel }}</span>#}
{# {% endif %}#}
{# <label><input name="confirm_password" type="text" placeholder="Подтвердить пароль"{% if form.data.confirm_password %} value="{{ form.data.confirm_password }}"{% endif %}></label>#}
{# {% if form.errors and form.errors.confirm_password %}#}
{# <span>{{ form.errors.confirm_password }}</span>#}
{# {% endif %}#}
{# </div>#}
{##}
{# <input type="checkbox"> <p>Регистрируясь, я соглашаюсь с Лицензионным соглашениеми и Политикой конфиденциальности</p>#}
{##}
{# <div class="reg_button">#}
{# <button id="registration" onclick="SendRegistrationForm(this)"> Зарегистрироваться </button>#}
{# </div>#}
{# </form>#}
{##}
{##}
{##}
{#</div>#}

View File

@@ -1,14 +1,15 @@
{% load i18n %}
{% trans "Имя" as p_name %}
{% trans "Фамилия" as p_lastname %}
{% trans "Имя *" as p_name %}
{% trans "Фамилия *" as p_lastname %}
{% trans "Телефон" as p_tel %}
{% trans "Пароль" as p_password %}
{% trans "Подтвердить пароль" as p_con_password %}
{% trans "Пароль *" as p_password %}
{% trans "Подтвердить пароль *" as p_con_password %}
<section class="register">
<h1>{% translate "Регистрация" %}</h1>
<form
name="registration_form"
method="POST"
@@ -16,7 +17,7 @@
onsubmit="ym(97070898,'reachGoal','Registration'); return true;"
>
{% csrf_token %}
<div class="necessary_text">{% trans "Обязательные поля помечены значком *" %}</div>
<div class="inputs">
<div class="inp_firstname">
@@ -51,7 +52,7 @@
name="email"
onkeydown = "hideErrors(this)"
type="text"
placeholder="E-mail"
placeholder="E-mail *"
id="registration_email_input"
{% if form.data.email %} value="{{ form.data.email }}"{% endif %}>
@@ -107,16 +108,16 @@
<label id="agreement_check" for="agreement" onclick="hideErrors(this)"></label>
</div>
<div class="agree_text">{% translate "Регистрируясь, я соглашаюсь с Лицензионным соглашениеми и Политикой конфиденциальности" %}</div>
<div class="agree_text">{% translate "Регистрируясь, я соглашаюсь с Лицензионным соглашениеми и Политикой конфиденциальности." %}</div>
{% if form.errors and form.errors.agreement %}
<span id="reg_agree_error">{{ form.errors.agreement }}</span>
{% endif %}
</div>
<div class="button_register">
<button type="submit" id="registration" onclick="SendRegistrationForm(this)"> {% translate "Зарегистрироваться" %} </button>
<div class="info_text_wrapper">
<div class="info_text">{% trans 'На Вашу почту отправлено письмо для подтверждения регистрации. Если не получили письмо, то проверьте папку СПАМ' %}</div>
</div>
<div class="info_text_wrapper">
<div class="info_text">{% trans 'На Вашу почту отправлено письмо для подтверждения регистрации. Если не получили письмо, то проверьте папку СПАМ' %}</div>
</div>
</div>
</form>

View File

@@ -1,42 +0,0 @@
{% if page.url == 'main' %}
{% endif %}
{% if page.url == 'about_service' and page.url == 'ru' %}
<meta property="og:type" content="website">
<meta property="og:title" content="Express parcel delivery | TWB">
<meta property="og:description" content="You can order fast delivery of parcels and letters to all CIS cities with us ✓ Competitive rates on the website ✓ Express parcel dispatch ➡️ Contact us">
<meta property="og:url" content="https://tripwb.com/en/page/about_service/">
<meta property="og:image" content="https://tripwb.com/static/img/png/finlogo.png">
<meta property="og:site_name" content="TWB">
<meta property="og:locale" content="en_EN">
<meta property="fb:app_id" content="tripwithbonus">
<meta name="twitter:title" content="Express parcel delivery | TWB">
<meta name="twitter:description" content="You can order fast delivery of parcels and letters to all CIS cities with us ✓ Competitive rates on the website ✓ Express parcel dispatch ➡️ Contact us">
<meta name="twitter:card" content="summary">
{% endif %}
{% if page.url == 'about_service' and page.url == 'en' %}
<meta property="og:type" content="website">
<meta property="og:title" content="Express parcel delivery | TWB">
<meta property="og:description" content="You can order fast delivery of parcels and letters to all CIS cities with us ✓ Competitive rates on the website ✓ Express parcel dispatch ➡️ Contact us">
<meta property="og:url" content="https://tripwb.com/en/page/about_service/">
<meta property="og:image" content="https://tripwb.com/static/img/png/finlogo.png">
<meta property="og:site_name" content="TWB">
<meta property="og:locale" content="en_EN">
<meta property="fb:app_id" content="tripwithbonus">
<meta name="twitter:title" content="Express parcel delivery | TWB">
<meta name="twitter:description" content="You can order fast delivery of parcels and letters to all CIS cities with us ✓ Competitive rates on the website ✓ Express parcel dispatch ➡️ Contact us">
<meta name="twitter:card" content="summary">
{% endif %}

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,8 @@
>
<div style="line-height:1.0em; width: 660px">
<div style="padding:5px; text-align: center;">
<img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">
<img src="https://tripwb.com/static/img/png/finlogo.png" style="height: 90px;">
{# <img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">#}
</div>
<p style="font-weight:700; font-size:25px; text-align:center;
padding:0; line-height:1em; text-transform: uppercase; color: #ff613a;

View File

@@ -4,7 +4,8 @@
padding:10px; background-color: #F8F8F8;">
<div style="line-height:1.0em; width: 660px">
<div style="padding:5px; text-align: center;">
<img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">
{# <img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">#}
<img src="https://tripwb.com/static/img/png/finlogo.png" style="height: 90px;">
</div>
<p style="font-weight:700; font-size:25px; text-align:center;
padding:0; line-height:1em; text-transform: uppercase; color: #ff613a;

View File

@@ -6,7 +6,8 @@
>
<div style="line-height:1.0em; width: 660px">
<div style="padding:5px; text-align: center;">
<img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">
{# <img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">#}
<img src="https://tripwb.com/static/img/png/finlogo.png" style="height: 90px;">
</div>
<p style="font-weight:700; font-size:25px; text-align:center;
padding:0; line-height:1em; text-transform: uppercase; color: #ff613a;

View File

@@ -4,7 +4,8 @@
>
<div style="line-height:1.0em; width: 660px">
<div style="padding:5px; text-align: center;">
<img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">
{# <img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">#}
<img src="https://tripwb.com/static/img/png/finlogo.png" style="height: 90px;">
</div>
<p style="font-weight:700; font-size:25px; text-align:center;
padding:0; line-height:1em; text-transform: uppercase; color: #ff613a;

View File

@@ -4,7 +4,8 @@
padding:10px; background-color: #F8F8F8;">
<div style="line-height:1.0em; width: 660px">
<div style="padding:5px; text-align: center;">
<img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">
{# <img src="{{ logo }}" alt="{{ project_name }}" style="margin:0;padding:0;">#}
<img src="https://tripwb.com/static/img/png/finlogo.png" style="height: 90px;">
</div>
<p style="font-weight:700; font-size:25px; text-align:center;

View File

@@ -15,7 +15,7 @@
<div class="title_static_wrapper">
{# <div id=title_static>{% blocktrans %}Отправляй <span class="color_title">посылку</span> в любую точку мира!{% endblocktrans %}</div>#}
<h1 id=title_static>{% blocktrans %}Сервис по доставке и перевозке посылок <span class="color_title">TripWB</span>{% endblocktrans %}</h1>
<h1 id=title_static>{% blocktrans %}Сервис попутных посылок <span class="color_title">TripWB</span>{% endblocktrans %}</h1>
</div>
<span id="sub_title_static">

View File

@@ -0,0 +1,10 @@
{% extends 'tb_base.html' %}
{% load static %}
{% block meta %}
<script src='{% static "js/registration.js" %}'></script>
{% endblock %}
{% block content %}
{% include 'forms/f_password_recovery.html' %}
{% endblock %}

View File

@@ -18,7 +18,7 @@
<meta name="google-site-verification" content="4V4upJSK2_4MBrr5ZXjcCLw3bBwXc4_gsnKudJAaWqI" />
<meta name="yandex-verification" content="b8a976575e41fbbc" />
{% include "inter/meta_OpenGraph.html" %}
{% include "inter/meta_OpenGraph_Schema.html" %}
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >

View File

@@ -1,15 +1,16 @@
{% load static %}
{% load i18n %}
{% if route.departure_DT %}
{% with current_datetime=route.from_city.get_current_datetime %}
{% with departure_datetime=route.departure_DT %}
{% if current_datetime|date:"Y-m-d H:i:s" > departure_datetime|date:"Y-m-d H:i:s" %}
<div class="carrier-card out_of_date" data-number-of-route="{{ route.id }}">
{% else %}
<div class="carrier-card {% if route.highlight_color %} highlight-color {% endif %}" data-number-of-route="{{ route.id }}">
{% endif %}
{% with highlight_end_DT=route.highlight_end_DT %}
{% if current_datetime|date:"Y-m-d H:i:s" > departure_datetime|date:"Y-m-d H:i:s" %}
<div class="carrier-card out_of_date" data-number-of-route="{{ route.id }}">
{% else %}
<div class="carrier-card {% if route.highlight_color and highlight_end_DT|date:"Y-m-d H:i:s" > current_datetime|date:"Y-m-d H:i:s" %} highlight-color {% endif %}" data-number-of-route="{{ route.id }}">
{% endif %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endif %}