Compare commits
378 Commits
36e9edb51b
...
feature/su
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15c9d589fe | ||
|
|
fa116c08c1 | ||
|
|
4f9129e718 | ||
|
|
df45f3a704 | ||
|
|
90ef093fca | ||
| 4331b26542 | |||
| dd8a8ddd53 | |||
| abb0d488eb | |||
| be97b848d0 | |||
| 6bc112d689 | |||
| dc534a0c51 | |||
| e71ed05e6c | |||
| 2048ed6baf | |||
| c146bd6155 | |||
| 98665abf4d | |||
| 9954140d3a | |||
| fafee63a64 | |||
| c623d69767 | |||
| 670eb28bc0 | |||
| 144ff286f6 | |||
| 05f94de0b4 | |||
| c4650ce603 | |||
| 3971a8ee23 | |||
| a3ba6bc783 | |||
| b87df02714 | |||
| 713695cf7d | |||
| a25f30eda7 | |||
| eddb3a1858 | |||
| 5a89200f1d | |||
| 2f47a9e3db | |||
| 155b6272ec | |||
| 1479584bfc | |||
| f86be5bd97 | |||
| c87a7095ad | |||
| ac4df7a5f7 | |||
| c48839ff8c | |||
| ea296e3f05 | |||
| 8124ed62fe | |||
| cc643d2641 | |||
| 6de42c5ba9 | |||
| 36b7f4dee7 | |||
| 2328f09023 | |||
| 60faeeace9 | |||
| abe53dd88b | |||
| c76a18c5ff | |||
| 3725ce1882 | |||
| 6a69ff02b1 | |||
| 6ba41af305 | |||
| 5815a08b55 | |||
| 7805161829 | |||
| 6fa31f3866 | |||
| 0763faf224 | |||
| a3d3e12467 | |||
| ab22a3ec88 | |||
| 9d0a059909 | |||
| 1011f112b2 | |||
| d07ab2c71f | |||
| 96bfef04a8 | |||
| 779dd7e93d | |||
| 0abcb34829 | |||
| 33c028207a | |||
| 64b3e40ed0 | |||
| 0023676b28 | |||
| b90039f21a | |||
| b5f24ebf2e | |||
| f99a010e4a | |||
| a4944360a6 | |||
| a2b5d81c98 | |||
| 13b7c2572d | |||
| 47b12882ba | |||
| c008aa585b | |||
| 406b5e8480 | |||
| 584a196784 | |||
| 618f7751d1 | |||
| faaea1129a | |||
| dd7afc28f7 | |||
| 9ecf5ce073 | |||
| 422373f00e | |||
| 60636daeb8 | |||
| 9d47f4c2bc | |||
| 4d6dbddd28 | |||
| 3f00ff39d2 | |||
| bff6a81586 | |||
| 9cb8036d3c | |||
| a43de1fa91 | |||
| 93717bee2d | |||
| 8db1d6fdce | |||
| b41f8c7eca | |||
| c19405d32a | |||
| 7b75c533a8 | |||
| 649dbab901 | |||
| 1a4498d19f | |||
| 2786ef454d | |||
| 961c0dd2a5 | |||
| 0a0835d3a6 | |||
| bc87d10d59 | |||
| 792693848b | |||
| de229c5f78 | |||
| 03f9a836e6 | |||
| 91751574cc | |||
| d5453dada6 | |||
| 22adb18a39 | |||
| 0a3c40dd5d | |||
| b29825d62b | |||
| c9bda8aab2 | |||
| 284a4b064a | |||
| 6f20f53d75 | |||
| 473a047af9 | |||
| 481f9a881f | |||
| 6ceedddbc1 | |||
| bd9e0fad48 | |||
| 6b118d00b6 | |||
| 01e221196f | |||
| ccf016999b | |||
| cb79e47796 | |||
| 4076bd6065 | |||
| e54c258007 | |||
| c3b7401255 | |||
| 9af72d30f4 | |||
| dbe948ae5f | |||
| 885d36a90c | |||
| 7acfbc0113 | |||
| 43c5faf988 | |||
| 437142fba0 | |||
| acf7b702ee | |||
| 74ca1be884 | |||
| 26b987d6ce | |||
| 3f7f1d88ed | |||
| 59225b1688 | |||
| 108aee2c43 | |||
| 9062ce32a1 | |||
| 7c74a0f3fe | |||
| 4fb3a12f47 | |||
| 59bc25f31c | |||
| 87fbe7852c | |||
| 793d283d97 | |||
| 651ae18345 | |||
| 67eb32968e | |||
| c6d41513c0 | |||
| 67ba698b60 | |||
| 15d1c00ac6 | |||
| 9e9a82ffc0 | |||
| a0eb5210ab | |||
| 3dacc0316e | |||
| e2c347c912 | |||
| 758f8b1f55 | |||
| b446a8f519 | |||
| c8ba0dd770 | |||
| f13a1329ca | |||
| 4b3604098f | |||
| defbf6746f | |||
| bf3f26ec4f | |||
| 76018333b0 | |||
| e6e345b9fe | |||
| eafccabb66 | |||
| f2e0628de1 | |||
| 2e1f3a10ab | |||
| bf18c96dbd | |||
| 23718a5f3f | |||
| c6a1d5bdcf | |||
| f75e94f706 | |||
| 11c9bb6c23 | |||
| b1ff9c47da | |||
| 35c09dc70b | |||
| f0efae5987 | |||
| 65120cd2d4 | |||
| 231d062814 | |||
| 615922a881 | |||
| 61b2b824d5 | |||
| 317445998a | |||
| 4ad3813499 | |||
| 9a88243323 | |||
| df0f32c71a | |||
| 4ddd402442 | |||
| a05c4b3898 | |||
| a3ab0973c9 | |||
| 0f801aa44b | |||
| 7bc386bc44 | |||
| e148c60d70 | |||
| 4667352ec4 | |||
| e7cf694d88 | |||
| b2abb3046b | |||
| 6c1011e59e | |||
| ad909b98bf | |||
| 9d2e35246a | |||
| 48dc573c0f | |||
| e559660912 | |||
| aa3bec304a | |||
| c7bc22813f | |||
| 46e73db10a | |||
| ad451c2ae0 | |||
| 0b5b557a35 | |||
| fb9228c432 | |||
| fbcbe93042 | |||
| ca44deb077 | |||
| 61403bfac2 | |||
| 190efa4b74 | |||
| ca06836b11 | |||
| b31241872f | |||
| f80e2844bf | |||
| 1dae86f0e7 | |||
| 0c146caeef | |||
| 410733211b | |||
| 14df8969c2 | |||
| 4388414ac2 | |||
| 791ac8d436 | |||
| a3d6f498b1 | |||
| b8fdd61948 | |||
| 4437372d7c | |||
| f8d29d80b7 | |||
| 36fd9599af | |||
| 65eccde487 | |||
| 037b4cc562 | |||
| 9c971a6fa4 | |||
| a3faa17754 | |||
| 085f905125 | |||
| dc16ced786 | |||
| d5cba26098 | |||
| 001dd2cb87 | |||
| 16e860a29f | |||
| 6a5331d8eb | |||
| aff0b0fe98 | |||
| fd3612c370 | |||
| d14a46d3d7 | |||
| d7ace77de8 | |||
| 885e4722af | |||
| 72ed6369d8 | |||
| b23e440efd | |||
| 75ddb002fd | |||
| 28a36335ce | |||
| fba225aa70 | |||
| af800ac84c | |||
| 87e90d7152 | |||
| c25942a6ca | |||
| 692419816f | |||
| 3a109340fd | |||
| 5925ecb975 | |||
| 325acd3580 | |||
| 3ac85784a9 | |||
| 5c4e715970 | |||
| 89b57feb4e | |||
| fc194d3f85 | |||
| 12af0ea238 | |||
| 6e758cf62e | |||
| f7783c070b | |||
| fb3cd30db4 | |||
| ff949a8205 | |||
| 624653f581 | |||
| f3e5f02f07 | |||
| d0792e9e84 | |||
| f752eb5d4a | |||
| f0861fde84 | |||
| 4e7aa09c21 | |||
| e68a0dc151 | |||
| fc37bea98a | |||
| 8a91e611ac | |||
| 7208db6981 | |||
| 447a78cd3a | |||
| 95dff519b8 | |||
| 62aeebae95 | |||
| c2e03728f8 | |||
| a64fbab270 | |||
| 00ea16f631 | |||
| e3aafcdfe9 | |||
| 421a3a2dab | |||
| 61e4f7e450 | |||
| 3b52cab162 | |||
| fe9be61772 | |||
| 0818f880cc | |||
| cca062efec | |||
| 2eb7ac85d3 | |||
| 3469a3923c | |||
| 20fb49b3e4 | |||
| afe8feebc2 | |||
| ae6a68d85b | |||
| d80c45acd5 | |||
| 3a9ac2c289 | |||
| 2d68836724 | |||
| 0deb85b5a3 | |||
| 7b38f6e3b3 | |||
| 43f050f070 | |||
| 098b7c4fb5 | |||
| eae56199e0 | |||
| 71e8f0f465 | |||
| 66d7183278 | |||
| 92b92f2d65 | |||
| d5ab7d82eb | |||
| 1ebd9f9c0b | |||
| 7fd2c60ddb | |||
| f068182557 | |||
| 02945b0691 | |||
| 21b959e6a3 | |||
| 747091c744 | |||
| 7b70052ff1 | |||
| 49fd26bc4c | |||
| 77f365ef45 | |||
| 6d34d46e38 | |||
| 970c2e0837 | |||
| b87549d567 | |||
| 78abdb2fef | |||
| f73ebb08c9 | |||
| 628e8eec09 | |||
| 66ddcaec5b | |||
| 3901c82aae | |||
| 9f682b66a5 | |||
| c74aff7b91 | |||
| 1be50b1277 | |||
| af00d1a54b | |||
| dd4ad82248 | |||
| 38c08cbced | |||
| ed2c74a280 | |||
| 90ab1bb6b4 | |||
| 3e2220e5f2 | |||
| 33e27620b1 | |||
| fbdef2a1ec | |||
| 1834639b50 | |||
| f9606a3c88 | |||
| c803d7abbb | |||
| efd75817bc | |||
| 36fff15e2b | |||
| 7573bfb344 | |||
| 0c33d638ba | |||
| 7d3da34e22 | |||
| 0e2723a367 | |||
| b102c44031 | |||
| 4b480c35e5 | |||
| 8e7bcd8fd8 | |||
| c60c545031 | |||
| 51d075f799 | |||
| db54ec1650 | |||
| 14b362442f | |||
| fcfbeece87 | |||
| aea501aedb | |||
| f1d175fe84 | |||
| 0f432c4fd9 | |||
| b53e19c439 | |||
| bebd20abf0 | |||
| 5dc2293212 | |||
| 37f480c01e | |||
| f16efa24b0 | |||
| e11d05eb02 | |||
| 32cd45106d | |||
| 7b95893b34 | |||
| b6769f6350 | |||
| 5650b2d6b9 | |||
| f0fe8edf80 | |||
| b30df5b6ed | |||
| 0ef26556a2 | |||
| ea92feab27 | |||
| 1720e156d2 | |||
| 9ed06e741e | |||
| d39a3a78d0 | |||
| 09dc2984f3 | |||
| 660e3f8a99 | |||
| cc9797eb71 | |||
| 6a8aa73e63 | |||
| 689495e410 | |||
| 415fad4f4e | |||
| 396db7a439 | |||
| 61bea5639b | |||
| c9d6812d11 | |||
| 18dd435678 | |||
| a7a4112312 | |||
| cf8cb9a6a4 | |||
| b31f1ddb0f | |||
| 382ddd48e4 | |||
| 0b57fa9238 | |||
| fe7721270b | |||
| 49b35abb0b | |||
| 41dbb6bad7 | |||
| fde640e997 | |||
| fd1f4ff9b1 | |||
| 3a4c1b12a6 | |||
| ce68dbee8a | |||
| 1976a4c1dc | |||
| 0dc3419651 | |||
| 7769608e03 | |||
| 9772d7670b |
1
.gitignore
vendored
@@ -414,4 +414,5 @@ fabric.properties
|
|||||||
|
|
||||||
# Android studio 3.1+ serialized cache file
|
# Android studio 3.1+ serialized cache file
|
||||||
.idea/caches/build_file_checksums.ser
|
.idea/caches/build_file_checksums.ser
|
||||||
|
celerybeat-schedule.db
|
||||||
|
|
||||||
|
|||||||
@@ -28,20 +28,23 @@ def get_flat_pages_links_Dict(site):
|
|||||||
|
|
||||||
def get_article_breadcrumbs(request, art):
|
def get_article_breadcrumbs(request, art):
|
||||||
# print('get_article_breadcrumbs')
|
# print('get_article_breadcrumbs')
|
||||||
articles_add_count = 1
|
articles_add_count = 3
|
||||||
# half_count = articlesCountInBlock / 2
|
# half_count = articlesCountInBlock / 2
|
||||||
|
|
||||||
arts_top = ArticleModel.objects.filter(enable=True, createDT__gt=art.createDT).order_by(
|
# arts_top = ArticleModel.objects.filter(enable=True, createDT__gt=art.createDT).order_by(
|
||||||
'createDT')[:articles_add_count]
|
# 'createDT')[:articles_add_count]
|
||||||
arts_down = ArticleModel.objects.filter(enable=True, createDT__lt=art.createDT).order_by(
|
# arts_down = ArticleModel.objects.filter(enable=True, createDT__lt=art.createDT).order_by(
|
||||||
'-createDT')[:articles_add_count]
|
# '-createDT')[:articles_add_count]
|
||||||
# if len(artListDown)<half_count:
|
# if len(artListDown)<half_count:
|
||||||
# art_List = ArticleModel.objects.filter(enable=True, article_DT__gte=art.article_DT).order_by(
|
# art_List = ArticleModel.objects.filter(enable=True, article_DT__gte=art.article_DT).order_by(
|
||||||
# 'article_DT')[:art.articlesCountInBlock-len(artListDown)]
|
# 'article_DT')[:art.articlesCountInBlock-len(artListDown)]
|
||||||
|
|
||||||
|
breadcrumbs_arts = ArticleModel.objects.exclude(id=art.id).order_by('?')[:3]
|
||||||
|
|
||||||
Dict = {
|
Dict = {
|
||||||
'arts_top': arts_top,
|
'breadcrumbs_arts': breadcrumbs_arts
|
||||||
'arts_down': arts_down
|
# 'arts_top': arts_top,
|
||||||
|
# 'arts_down': arts_down
|
||||||
}
|
}
|
||||||
return Dict
|
return Dict
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,11 @@ class Admin_ProfileInline(admin.StackedInline):
|
|||||||
(None, {
|
(None, {
|
||||||
'classes': ['wide'],
|
'classes': ['wide'],
|
||||||
'fields': (
|
'fields': (
|
||||||
('account_type',),
|
# ('account_type',),
|
||||||
('enable',),
|
('enable',),
|
||||||
('phone',),
|
('phone',),
|
||||||
('country', 'city'),
|
('country', 'city'),
|
||||||
|
('mailing_on', ),
|
||||||
('authMailCode',),
|
('authMailCode',),
|
||||||
('birthdate'),
|
('birthdate'),
|
||||||
'comment', 'creator'
|
'comment', 'creator'
|
||||||
@@ -71,6 +72,10 @@ class Admin_ProfileInline(admin.StackedInline):
|
|||||||
|
|
||||||
class Admin_User(UserAdmin):
|
class Admin_User(UserAdmin):
|
||||||
|
|
||||||
|
def mailing_on(self, obj):
|
||||||
|
return obj.user_profile.mailing_on
|
||||||
|
mailing_on.boolean = True
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(None, {
|
(None, {
|
||||||
'classes': ['wide'],
|
'classes': ['wide'],
|
||||||
@@ -91,61 +96,63 @@ class Admin_User(UserAdmin):
|
|||||||
|
|
||||||
save_on_top = True
|
save_on_top = True
|
||||||
|
|
||||||
list_display = ['id', 'last_name', 'first_name', 'email', 'is_staff',
|
list_display = ['id', 'last_name', 'first_name', 'mailing_on', 'email', 'is_staff',
|
||||||
'is_active']
|
'is_active']
|
||||||
list_editable = ['is_staff', 'is_active']
|
list_editable = ['is_staff', 'is_active']
|
||||||
list_display_links = ['first_name', 'last_name', 'email']
|
list_display_links = ['first_name', 'last_name', 'email']
|
||||||
search_fields = ['first_name', 'last_name', 'email']
|
search_fields = ['first_name', 'last_name', 'email']
|
||||||
|
|
||||||
|
list_filter = ['user_profile__mailing_on', 'is_staff', 'is_active']
|
||||||
|
|
||||||
inlines = (Admin_ProfileInline,)
|
inlines = (Admin_ProfileInline,)
|
||||||
# actions = ['del_all_temp_users', ]
|
# actions = ['del_all_temp_users', ]
|
||||||
|
|
||||||
ordering = ['is_staff', 'last_name', 'first_name']
|
ordering = ['is_staff', '-id', 'last_name', 'first_name']
|
||||||
|
|
||||||
# Re-register UserAdmin
|
# Re-register UserAdmin
|
||||||
admin.site.unregister(User)
|
admin.site.unregister(User)
|
||||||
admin.site.register(User, Admin_User)
|
admin.site.register(User, Admin_User)
|
||||||
|
|
||||||
|
|
||||||
class Admin_UserProfile(Admin_BaseIconModel):
|
# class Admin_UserProfile(Admin_BaseIconModel):
|
||||||
|
#
|
||||||
fieldsets = (
|
# fieldsets = (
|
||||||
(None, {
|
# (None, {
|
||||||
'classes': ['wide'],
|
# 'classes': ['wide'],
|
||||||
'fields': (
|
# 'fields': (
|
||||||
'user', 'enable',
|
# 'user', 'enable',
|
||||||
('account_type',),
|
# ('account_type',),
|
||||||
('phone',),
|
# ('phone',),
|
||||||
('country', 'city'),
|
# ('country', 'city'),
|
||||||
('authMailCode',),
|
# ('authMailCode',),
|
||||||
('birthdate'),
|
# ('birthdate'),
|
||||||
'creator'
|
# 'creator'
|
||||||
)
|
# )
|
||||||
}),
|
# }),
|
||||||
('1С', {
|
# ('1С', {
|
||||||
'classes': ['wide'],
|
# 'classes': ['wide'],
|
||||||
'fields': (
|
# 'fields': (
|
||||||
('name',),
|
# ('name',),
|
||||||
)
|
# )
|
||||||
}),
|
# }),
|
||||||
)
|
# )
|
||||||
|
#
|
||||||
save_on_top = True
|
# save_on_top = True
|
||||||
|
#
|
||||||
list_display = [
|
# list_display = [
|
||||||
'id', 'user', 'enable', 'birthdate', 'modifiedDT', 'createDT'
|
# 'id', 'user', 'enable', 'birthdate', 'modifiedDT', 'createDT'
|
||||||
]
|
# ]
|
||||||
list_editable = ['enable', 'birthdate']
|
# list_editable = ['enable', 'birthdate']
|
||||||
list_display_links = ['id', ] # 'user__last_name', 'user__first_name']
|
# list_display_links = ['id', ] # 'user__last_name', 'user__first_name']
|
||||||
search_fields = [
|
# search_fields = [
|
||||||
'id', 'user__last_name', 'user__first_name', 'user__email',
|
# 'id', 'user__last_name', 'user__first_name', 'user__email',
|
||||||
]
|
# ]
|
||||||
|
#
|
||||||
list_filter = ['enable', 'account_type']
|
# list_filter = ['enable', 'account_type']
|
||||||
|
#
|
||||||
# filter_horizontal = ['connected_mailings']
|
# # filter_horizontal = ['connected_mailings']
|
||||||
# raw_id_fields = ("favourites",)
|
# # raw_id_fields = ("favourites",)
|
||||||
verbose_name_plural = _(u'Профиль пользователя')
|
# verbose_name_plural = _(u'Профиль пользователя')
|
||||||
|
#
|
||||||
|
#
|
||||||
admin.site.register(UserProfile, Admin_UserProfile)
|
# admin.site.register(UserProfile, Admin_UserProfile)
|
||||||
|
|||||||
@@ -29,22 +29,61 @@ class RegistrationForm(forms.Form):
|
|||||||
tel = forms.CharField()
|
tel = forms.CharField()
|
||||||
agreement = forms.BooleanField(initial=False, required=True)
|
agreement = forms.BooleanField(initial=False, required=True)
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
required_password = True
|
||||||
|
required_agreement = True
|
||||||
|
required_email = True
|
||||||
|
create_new_account = True
|
||||||
|
if 'not_required_password' in kwargs.keys() and kwargs['not_required_password']:
|
||||||
|
required_password = False
|
||||||
|
del kwargs['not_required_password']
|
||||||
|
if 'not_required_agreement' in kwargs.keys() and kwargs['not_required_agreement']:
|
||||||
|
required_agreement = False
|
||||||
|
del kwargs['not_required_agreement']
|
||||||
|
if 'not_required_email' in kwargs.keys() and kwargs['not_required_email']:
|
||||||
|
required_email = False
|
||||||
|
del kwargs['not_required_email']
|
||||||
|
if 'create_new_account' in kwargs.keys() and not kwargs['create_new_account']:
|
||||||
|
create_new_account = False
|
||||||
|
del kwargs['create_new_account']
|
||||||
|
|
||||||
|
super(RegistrationForm, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
self.fields['password'].required = required_password
|
||||||
|
self.fields['confirm_password'].required = required_password
|
||||||
|
|
||||||
|
self.fields['agreement'].required = required_agreement
|
||||||
|
|
||||||
|
self.fields['email'].required = required_email
|
||||||
|
|
||||||
|
self.create_new_account = create_new_account
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
pass
|
cleaned_data = super().clean()
|
||||||
# cleaned_data = super().clean()
|
# i = 0
|
||||||
# for item in self.changed_data:
|
# names = list(cleaned_data.keys())
|
||||||
# if item in self.data:
|
# while i < len(names):
|
||||||
#
|
# if not cleaned_data[names[i]]:
|
||||||
#
|
# if self.fields[names[i]].required:
|
||||||
# cc_myself = cleaned_data.get("cc_myself")
|
# self.add_error(names[i], _('Обязательное поле'))
|
||||||
# subject = cleaned_data.get("subject")
|
# i += 1
|
||||||
#
|
|
||||||
# if cc_myself and subject:
|
if 'tel' in cleaned_data and 'tel' in cleaned_data:
|
||||||
# # Only do something if both fields are valid so far.
|
from BaseModels.validators.form_field_validators import get_phone_valid_error
|
||||||
# if "help" not in subject:
|
error = get_phone_valid_error(cleaned_data["tel"])
|
||||||
# raise ValidationError(
|
if error:
|
||||||
# "Did not send for 'help' in the subject despite " "CC'ing yourself."
|
self.add_error('tel', error)
|
||||||
# )
|
|
||||||
|
if cleaned_data and 'confirm_password' in cleaned_data and 'password' in cleaned_data:
|
||||||
|
if cleaned_data['confirm_password'] != cleaned_data['password']:
|
||||||
|
self.add_error("password", _('Пароль и подтверждение пароля не совпадают'))
|
||||||
|
self.add_error("confirm_password", _('Пароль и подтверждение пароля не совпадают'))
|
||||||
|
|
||||||
|
if self.create_new_account and cleaned_data and 'email' in cleaned_data:
|
||||||
|
users = User.objects.filter(email=cleaned_data['email'])
|
||||||
|
if users:
|
||||||
|
self.add_error('email', _("Пользователь с указанным email уже существует"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,25 @@
|
|||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
|
|
||||||
|
|
||||||
|
def get_user_timezone_Dict(user, request=None):
|
||||||
|
tz = None
|
||||||
|
if request:
|
||||||
|
tz = request.COOKIES.get("user_tz")
|
||||||
|
if not tz and user.is_authenticated:
|
||||||
|
tz = user.user_profile.get_timezone()
|
||||||
|
|
||||||
|
if not tz:
|
||||||
|
from django.conf import settings
|
||||||
|
tz = settings.TIME_ZONE
|
||||||
|
|
||||||
|
return {'user_tz': tz}
|
||||||
|
|
||||||
def get_dashboard_page_content_html(request):
|
def get_dashboard_page_content_html(request):
|
||||||
|
|
||||||
|
from ChatServiceApp.funcs import get_unanswered_msgs_count_for_user
|
||||||
|
|
||||||
Dict = {
|
Dict = {
|
||||||
|
'unanswered_msgs_count': get_unanswered_msgs_count_for_user(request.user)
|
||||||
}
|
}
|
||||||
|
|
||||||
html = render_to_string('blocks/profile/b_profile_first_page.html', Dict, request=request)
|
html = render_to_string('blocks/profile/b_profile_first_page.html', Dict, request=request)
|
||||||
@@ -15,10 +32,10 @@ def get_profile_page_content_html(request, page_name, data):
|
|||||||
return get_chat_page_content_html(request, data)
|
return get_chat_page_content_html(request, data)
|
||||||
elif page_name == 'create_route_for_customer':
|
elif page_name == 'create_route_for_customer':
|
||||||
from RoutesApp.funcs import get_profile_new_route_page_html
|
from RoutesApp.funcs import get_profile_new_route_page_html
|
||||||
return get_profile_new_route_page_html(request, {})
|
return get_profile_new_route_page_html(request, {'owner_type': 'customer'})
|
||||||
elif page_name == 'create_route_for_mover':
|
elif page_name == 'create_route_for_mover':
|
||||||
from RoutesApp.funcs import get_profile_new_route_page_html
|
from RoutesApp.funcs import get_profile_new_route_page_html
|
||||||
return get_profile_new_route_page_html(request, {})
|
return get_profile_new_route_page_html(request, {'owner_type': 'mover'})
|
||||||
elif page_name == 'my_routes':
|
elif page_name == 'my_routes':
|
||||||
from RoutesApp.funcs import get_profile_my_routes_page_content_html
|
from RoutesApp.funcs import get_profile_my_routes_page_content_html
|
||||||
return get_profile_my_routes_page_content_html(request)
|
return get_profile_my_routes_page_content_html(request)
|
||||||
@@ -73,5 +90,7 @@ def get_profile_support_page_content_html(request, data=None):
|
|||||||
}
|
}
|
||||||
tpl_name = 'blocks/profile/b_support_tickets.html'
|
tpl_name = 'blocks/profile/b_support_tickets.html'
|
||||||
|
|
||||||
|
Dict.update(get_user_timezone_Dict(request.user, request=request))
|
||||||
|
|
||||||
html = render_to_string(tpl_name, Dict, request=request)
|
html = render_to_string(tpl_name, Dict, request=request)
|
||||||
return html
|
return html
|
||||||
@@ -28,6 +28,8 @@ urlpatterns = [
|
|||||||
path('change_profile_confirm/', change_profile_confirm_ajax, name='change_profile_confirm_ajax'),
|
path('change_profile_confirm/', change_profile_confirm_ajax, name='change_profile_confirm_ajax'),
|
||||||
path('change_avatar_confirm/', change_avatar_confirm_ajax, name='change_avatar_confirm_ajax'),
|
path('change_avatar_confirm/', change_avatar_confirm_ajax, name='change_avatar_confirm_ajax'),
|
||||||
|
|
||||||
path('send_message/', send_message_ajax, name='send_message_ajax')
|
path('send_message/', send_message_ajax, name='send_message_ajax'),
|
||||||
|
|
||||||
|
path('mailing_subscribe/', mailing_subscribe_ajax, name='mailing_subscribe_ajax')
|
||||||
|
|
||||||
]
|
]
|
||||||
@@ -16,6 +16,8 @@ from django.core.exceptions import ValidationError
|
|||||||
import json
|
import json
|
||||||
from django.core.files import File
|
from django.core.files import File
|
||||||
import base64
|
import base64
|
||||||
|
from django.core.validators import validate_email
|
||||||
|
from django.urls import reverse
|
||||||
|
|
||||||
|
|
||||||
# @login_required(login_url='/profile/login/')
|
# @login_required(login_url='/profile/login/')
|
||||||
@@ -30,6 +32,49 @@ import base64
|
|||||||
# return JsonResponse({'html': html}, status=200)
|
# return JsonResponse({'html': html}, status=200)
|
||||||
|
|
||||||
|
|
||||||
|
def mailing_subscribe_ajax(request):
|
||||||
|
if request.method != 'POST':
|
||||||
|
raise Http404
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
email = request.POST['email']
|
||||||
|
user = None
|
||||||
|
if request.user and request.user.is_authenticated:
|
||||||
|
user = request.user
|
||||||
|
user.user_profile.mailing_on = True
|
||||||
|
user.user_profile.save(update_fields=['mailing_on'])
|
||||||
|
|
||||||
|
return JsonResponse({
|
||||||
|
'status': 'sended',
|
||||||
|
'del_form': True,
|
||||||
|
'html': _('Подписка на рассылку для адреса ') + user.email + _(' одобрена')
|
||||||
|
})
|
||||||
|
|
||||||
|
if not user:
|
||||||
|
try:
|
||||||
|
user = User.objects.get(email=email)
|
||||||
|
except User.DoesNotExist:
|
||||||
|
user = None
|
||||||
|
|
||||||
|
if user:
|
||||||
|
redirect_url = f"{reverse('login_profile')}?mailingSubscribeRequired=true"
|
||||||
|
else:
|
||||||
|
redirect_url = f"{reverse('registration_page')}?mailingSubscribeRequired=true"
|
||||||
|
|
||||||
|
return JsonResponse({
|
||||||
|
'status': 'sended',
|
||||||
|
'redirect_url': redirect_url,
|
||||||
|
'email': email
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
return JsonResponse({
|
||||||
|
'status': 'error',
|
||||||
|
'html': str(e)
|
||||||
|
}, status=400)
|
||||||
|
|
||||||
|
|
||||||
def send_message_ajax(request):
|
def send_message_ajax(request):
|
||||||
if request.method != 'POST':
|
if request.method != 'POST':
|
||||||
@@ -62,7 +107,7 @@ def send_message_ajax(request):
|
|||||||
if data['form_name'] == 'msg_from_about_service':
|
if data['form_name'] == 'msg_from_about_service':
|
||||||
subject = _('Получен запрос со страницы О сервисе')
|
subject = _('Получен запрос со страницы О сервисе')
|
||||||
request_type = _('запрос со страницы о сервисе')
|
request_type = _('запрос со страницы о сервисе')
|
||||||
if data['form_name'] == 'footer':
|
if data['form_name'] == 'msg_from_footer':
|
||||||
subject = _('Получен запрос на рассылку')
|
subject = _('Получен запрос на рассылку')
|
||||||
request_type = _('запрос на рассылку')
|
request_type = _('запрос на рассылку')
|
||||||
|
|
||||||
@@ -71,21 +116,61 @@ def send_message_ajax(request):
|
|||||||
phone_str = ''
|
phone_str = ''
|
||||||
email_str = ''
|
email_str = ''
|
||||||
msg_str = ''
|
msg_str = ''
|
||||||
if request_type:
|
form_type = 'one_field'
|
||||||
request_type_str = f'<b>{_("Тип запроса")}:</b> {request_type}<br>'
|
errors = {}
|
||||||
if 'name' in data:
|
|
||||||
name_str = f'<b>{_("Имя")}:</b> {data["name"]}<br>'
|
|
||||||
if 'phone' in data:
|
|
||||||
phone_str = f'<b>{_("Телефон")}:</b> {data["phone"]}<br>'
|
|
||||||
if 'email' in data:
|
|
||||||
email_str = f'<b>{_("email")}:</b> {data["email"]}<br>'
|
|
||||||
if 'text_msg' in data:
|
|
||||||
msg_str = (f'<b>{_("Сообщение")}:</b><br>'
|
|
||||||
f'<div style="margin-left: 40px; line-height: 20px;">{data["text_msg"]}</div><br>')
|
|
||||||
|
|
||||||
|
for name, val in data.items():
|
||||||
|
if not val:
|
||||||
|
errors.update({name: _('Обязательное поле')})
|
||||||
|
|
||||||
|
if name == 'form_name':
|
||||||
|
request_type_str = f'<b>{_("Тип запроса")}:</b> {request_type}<br>'
|
||||||
|
|
||||||
|
if name == 'name':
|
||||||
|
name_str = f'<b>{_("Имя")}:</b> {data["name"]}<br>'
|
||||||
|
if form_type == 'one_field':
|
||||||
|
form_type = 'two_fields'
|
||||||
|
|
||||||
|
if name =='phone':
|
||||||
|
from BaseModels.validators.form_field_validators import get_phone_valid_error
|
||||||
|
error = get_phone_valid_error(data["phone"])
|
||||||
|
if error:
|
||||||
|
errors.update({name: _(error)})
|
||||||
|
phone_str = f'<b>{_("Телефон")}:</b> {data["phone"]}<br>'
|
||||||
|
|
||||||
|
if name =='email':
|
||||||
|
try:
|
||||||
|
error = validate_email(data["email"])
|
||||||
|
except ValidationError as e:
|
||||||
|
error = e.message
|
||||||
|
if error:
|
||||||
|
errors.update({name: _(error)})
|
||||||
|
email_str = f'<b>{_("email")}:</b> {data["email"]}<br>'
|
||||||
|
|
||||||
|
if name =='text_msg':
|
||||||
|
msg_str = (f'<b>{_("Сообщение")}:</b><br>'
|
||||||
|
f'<div style="margin-left: 40px; line-height: 20px;">{data["text_msg"]}</div><br>')
|
||||||
|
form_type = 'full'
|
||||||
|
|
||||||
|
if errors:
|
||||||
|
Dict = {
|
||||||
|
'form': data.dict()
|
||||||
|
}
|
||||||
|
Dict['form'].update({
|
||||||
|
'errors': errors
|
||||||
|
})
|
||||||
|
|
||||||
|
tpl = 'forms/f_one_field_form.html'
|
||||||
|
if form_type == 'full':
|
||||||
|
tpl = 'forms/f_feedback_form.html'
|
||||||
|
elif form_type == 'two_fields':
|
||||||
|
tpl = 'forms/f_commercial_offer.html'
|
||||||
|
|
||||||
|
html = render_to_string(tpl, Dict, request)
|
||||||
|
return JsonResponse({'html': html}, status=400)
|
||||||
|
|
||||||
Dict = {
|
Dict = {
|
||||||
'logo': f'{request.scheme}://{sets["domain"]}/static/img/svg/LogoMobile.svg',
|
'logo': f'{sets["domain"]}/static/img/svg/LogoMobile.svg',
|
||||||
'project_name': sets['project_name'],
|
'project_name': sets['project_name'],
|
||||||
'message_title': subject,
|
'message_title': subject,
|
||||||
'message_text': f'<p><b>{_("ДАННЫЕ ЗАПРОСА")}</b></p>'
|
'message_text': f'<p><b>{_("ДАННЫЕ ЗАПРОСА")}</b></p>'
|
||||||
@@ -109,12 +194,17 @@ def send_message_ajax(request):
|
|||||||
html_content=html
|
html_content=html
|
||||||
)
|
)
|
||||||
|
|
||||||
return JsonResponse({'status': 'sended'})
|
html = render_to_string('widgets/w_msg_send_success.html', Dict, request)
|
||||||
|
|
||||||
|
return JsonResponse({
|
||||||
|
'status': 'sended',
|
||||||
|
'html': html
|
||||||
|
})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
'status': 'error',
|
'status': 'error',
|
||||||
'error': str(e)
|
'html': str(e)
|
||||||
})
|
}, status=400)
|
||||||
|
|
||||||
|
|
||||||
@login_required(login_url='/profile/login/')
|
@login_required(login_url='/profile/login/')
|
||||||
@@ -142,6 +232,7 @@ def chats_ajax(request):
|
|||||||
'receivers': receivers,
|
'receivers': receivers,
|
||||||
# 'messages': cur_chat_msgs
|
# 'messages': cur_chat_msgs
|
||||||
}
|
}
|
||||||
|
Dict.update(get_user_timezone_Dict(request.user, request=request))
|
||||||
|
|
||||||
html = render_to_string('blocks/profile/b_chats.html', Dict, request=request)
|
html = render_to_string('blocks/profile/b_chats.html', Dict, request=request)
|
||||||
return JsonResponse({'html': html}, status=200)
|
return JsonResponse({'html': html}, status=200)
|
||||||
@@ -159,6 +250,7 @@ def support_tickets_ajax(request):
|
|||||||
@login_required(login_url='/profile/login/')
|
@login_required(login_url='/profile/login/')
|
||||||
def change_avatar_confirm_ajax(request):
|
def change_avatar_confirm_ajax(request):
|
||||||
from django.core.files.base import ContentFile
|
from django.core.files.base import ContentFile
|
||||||
|
from django.core.exceptions import RequestDataTooBig
|
||||||
|
|
||||||
if request.method != 'POST':
|
if request.method != 'POST':
|
||||||
raise Http404
|
raise Http404
|
||||||
@@ -171,11 +263,15 @@ def change_avatar_confirm_ajax(request):
|
|||||||
file = ContentFile(content)
|
file = ContentFile(content)
|
||||||
request.user.user_profile.avatar.save(file_data['file_name'], file)
|
request.user.user_profile.avatar.save(file_data['file_name'], file)
|
||||||
request.user.user_profile.save(update_fields=['avatar'])
|
request.user.user_profile.save(update_fields=['avatar'])
|
||||||
|
except RequestDataTooBig:
|
||||||
|
msg = _('Слишком большой размер файла. Размер файла не должен быть больше 3МБ')
|
||||||
|
print(msg)
|
||||||
|
return JsonResponse({'error': msg}, status=400)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = f'change_avatar_confirm_ajax Error = {str(e)}'
|
msg = f'change_avatar_confirm_ajax Error = {str(e)}'
|
||||||
print(msg)
|
print(msg)
|
||||||
JsonResponse({'error': msg})
|
return JsonResponse({'error': msg}, status=400)
|
||||||
|
|
||||||
return JsonResponse({'url': request.user.user_profile.avatar.url})
|
return JsonResponse({'url': request.user.user_profile.avatar.url})
|
||||||
|
|
||||||
@@ -190,7 +286,19 @@ def change_profile_confirm_ajax(request):
|
|||||||
data = json.loads(request.body)
|
data = json.loads(request.body)
|
||||||
|
|
||||||
from .forms import RegistrationForm
|
from .forms import RegistrationForm
|
||||||
form = RegistrationForm(data)
|
kwargs = {
|
||||||
|
'not_required_password': True,
|
||||||
|
'not_required_agreement': True,
|
||||||
|
'not_required_email': True,
|
||||||
|
'create_new_account': False,
|
||||||
|
}
|
||||||
|
form = RegistrationForm(data, **kwargs)
|
||||||
|
if not form.is_valid():
|
||||||
|
form.initial = data
|
||||||
|
Dict = {'profileForm': form}
|
||||||
|
|
||||||
|
html = render_to_string('blocks/profile/b_profile.html', Dict, request=request)
|
||||||
|
return JsonResponse({'html': html}, status=400)
|
||||||
|
|
||||||
data_for_save = {}
|
data_for_save = {}
|
||||||
users = User.objects.filter(id=request.user.id)
|
users = User.objects.filter(id=request.user.id)
|
||||||
@@ -303,6 +411,9 @@ def login_ajax(request):
|
|||||||
user = authenticate(username=form.data['username'], password=form.data['password'])
|
user = authenticate(username=form.data['username'], password=form.data['password'])
|
||||||
if user is not None:
|
if user is not None:
|
||||||
auth.login(request, user)
|
auth.login(request, user)
|
||||||
|
if 'mailingSubscribeRequired' in data and data['mailingSubscribeRequired'] == 'true':
|
||||||
|
user.user_profile.mailing_on = True
|
||||||
|
user.user_profile.save(update_fields=['mailing_on'])
|
||||||
else:
|
else:
|
||||||
errors_Dict = {
|
errors_Dict = {
|
||||||
'errors': {
|
'errors': {
|
||||||
@@ -332,6 +443,42 @@ def login_ajax(request):
|
|||||||
return JsonResponse({'html': html}, status=400)
|
return JsonResponse({'html': html}, status=400)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def send_registration_mail(data_Dict, user):
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
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 = _('Добро пожаловать в Trip With Bonus!')
|
||||||
|
|
||||||
|
Dict = {
|
||||||
|
'logo': f'{sets["domain"]}/static/img/svg/LogoMobile.svg',
|
||||||
|
'project_name': sets['project_name'],
|
||||||
|
'message_title': subject,
|
||||||
|
}
|
||||||
|
Dict.update(data_Dict)
|
||||||
|
|
||||||
|
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']
|
||||||
|
res = 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def registration_ajax(request):
|
def registration_ajax(request):
|
||||||
if request.method != 'POST':
|
if request.method != 'POST':
|
||||||
raise Http404
|
raise Http404
|
||||||
@@ -347,17 +494,20 @@ def registration_ajax(request):
|
|||||||
html = render_to_string('forms/f_registration.html', Dict, request=request)
|
html = render_to_string('forms/f_registration.html', Dict, request=request)
|
||||||
return JsonResponse({'html': html}, status=400)
|
return JsonResponse({'html': html}, status=400)
|
||||||
|
|
||||||
users = User.objects.filter(email=form.data['email'])
|
# users = User.objects.filter(email=form.data['email'])
|
||||||
if users:
|
# if users:
|
||||||
form.errors['email'] = _("Пользователь с указанным email уже существует")
|
# form.errors['email'] = _("Пользователь с указанным email уже существует")
|
||||||
Dict = {'form': form}
|
# Dict = {'form': form}
|
||||||
html = render_to_string('forms/f_registration.html', Dict, request=request)
|
# html = render_to_string('forms/f_registration.html', Dict, request=request)
|
||||||
return JsonResponse({'html': html}, status=400)
|
# return JsonResponse({'html': html}, status=400)
|
||||||
|
|
||||||
user = User.objects.create_user(username=form.data['email'], email=form.data['email'], password=form.data['password'])
|
user = User.objects.create_user(username=form.data['email'], email=form.data['email'], password=form.data['password'])
|
||||||
# user = auth.authenticate(username=new_user_Dict['name'], password=new_user_Dict['pass'])
|
# user = auth.authenticate(username=new_user_Dict['name'], password=new_user_Dict['pass'])
|
||||||
if user:
|
if user:
|
||||||
auth.login(request, user)
|
auth.login(request, user, backend='django.contrib.auth.backends.ModelBackend')
|
||||||
|
|
||||||
|
if 'mailingSubscribeRequired' in data and data['mailingSubscribeRequired'] == 'true':
|
||||||
|
user.user_profile.mailing_on = True
|
||||||
|
|
||||||
user.last_name = form.data['lastname']
|
user.last_name = form.data['lastname']
|
||||||
user.first_name = form.data['firstname']
|
user.first_name = form.data['firstname']
|
||||||
@@ -365,6 +515,12 @@ def registration_ajax(request):
|
|||||||
user.user_profile.phone = form.data['tel']
|
user.user_profile.phone = form.data['tel']
|
||||||
user.user_profile.save()
|
user.user_profile.save()
|
||||||
|
|
||||||
|
mail_Dict = {
|
||||||
|
'user': user,
|
||||||
|
'pass': form.data['password']
|
||||||
|
}
|
||||||
|
res = send_registration_mail(mail_Dict, user)
|
||||||
|
|
||||||
res_Dict = {
|
res_Dict = {
|
||||||
'redirect_url': reverse('profile_page', args=['dashboard'])
|
'redirect_url': reverse('profile_page', args=['dashboard'])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,10 +31,12 @@ class ResponseInterceptionMiddleware:
|
|||||||
|
|
||||||
def __call__(self, request):
|
def __call__(self, request):
|
||||||
response = self.get_response(request)
|
response = self.get_response(request)
|
||||||
|
for_save_to_session = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if type(response) == JsonResponse:
|
if type(response) == JsonResponse:
|
||||||
for_save_to_session = request.user.user_profile.pop_node_by_name('for_save_to_session')
|
if request.user and not request.user.is_anonymous and request.user.user_profile:
|
||||||
|
for_save_to_session = request.user.user_profile.pop_node_by_name('for_save_to_session')
|
||||||
if for_save_to_session:
|
if for_save_to_session:
|
||||||
data = json.loads(response.content)
|
data = json.loads(response.content)
|
||||||
data.update(for_save_to_session)
|
data.update(for_save_to_session)
|
||||||
|
|||||||
18
AuthApp/migrations/0005_userprofile_mailing_on.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.2 on 2024-02-01 17:17
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('AuthApp', '0004_alter_userprofile_account_type'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='userprofile',
|
||||||
|
name='mailing_on',
|
||||||
|
field=models.BooleanField(default=False, verbose_name='Рассылка'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -51,6 +51,14 @@ class UserProfile(BaseModel):
|
|||||||
on_delete=models.SET_NULL
|
on_delete=models.SET_NULL
|
||||||
)
|
)
|
||||||
|
|
||||||
|
mailing_on = models.BooleanField(default=False, verbose_name=_('Рассылка'))
|
||||||
|
|
||||||
|
def get_timezone(self):
|
||||||
|
tz = None
|
||||||
|
if 'user_timezone' in self.json_data:
|
||||||
|
tz = self.json_data['user_timezone']
|
||||||
|
return tz
|
||||||
|
|
||||||
def save_user_alerts_to_session(self, request):
|
def save_user_alerts_to_session(self, request):
|
||||||
for_save_to_session = self.get_node_by_name('for_save_to_session')
|
for_save_to_session = self.get_node_by_name('for_save_to_session')
|
||||||
if for_save_to_session:
|
if for_save_to_session:
|
||||||
@@ -74,8 +82,23 @@ class UserProfile(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
def create_user_profile(sender, instance, created, **kwargs):
|
def create_user_profile(sender, instance, created, **kwargs):
|
||||||
|
user_profile = None
|
||||||
if created:
|
if created:
|
||||||
UserProfile.objects.create(user=instance)
|
user_profile = UserProfile.objects.create(user=instance)
|
||||||
|
|
||||||
|
# if user_profile and not user_profile.avatar:
|
||||||
|
# from allauth.socialaccount.models import SocialAccount
|
||||||
|
# # try:
|
||||||
|
# social_accounts = SocialAccount.objects.filter(user=instance)
|
||||||
|
# if social_accounts:
|
||||||
|
# for social_account in social_accounts:
|
||||||
|
# if 'picture' in social_account.account.extra_data and social_account.account.extra_data['picture']:
|
||||||
|
# with open(social_account.account.extra_data['picture'], 'rb') as fd:
|
||||||
|
# user_profile.avatar.save(f'avatar_{instance.id}.jpeg', fd.read(), True)
|
||||||
|
#
|
||||||
|
# # except Exception as e:
|
||||||
|
# # msg = f'post_save create_user_profile Error = {str(e)}'
|
||||||
|
# # print(msg)
|
||||||
|
|
||||||
|
|
||||||
post_save.connect(create_user_profile, sender=User, dispatch_uid='post_save_connect')
|
post_save.connect(create_user_profile, sender=User, dispatch_uid='post_save_connect')
|
||||||
@@ -85,6 +108,7 @@ def preSaveUser(sender, instance, **kwargs):
|
|||||||
if not instance.email:
|
if not instance.email:
|
||||||
instance.email = str(instance.username).lower()
|
instance.email = str(instance.username).lower()
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
instance.user_profile.modifiedDT = datetime.now()
|
instance.user_profile.modifiedDT = datetime.now()
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ urlpatterns = [
|
|||||||
path('login/', login_View, name='login_profile'),
|
path('login/', login_View, name='login_profile'),
|
||||||
path('logout/', logout_View, name='logout_profile'),
|
path('logout/', logout_View, name='logout_profile'),
|
||||||
|
|
||||||
|
path('account/signup/', login_View, name="custom_singup" ),
|
||||||
|
|
||||||
|
|
||||||
# ajax ----------------
|
# ajax ----------------
|
||||||
# url(r'^login$', user_login_View_ajax, name='user_login_View_ajax'),
|
# url(r'^login$', user_login_View_ajax, name='user_login_View_ajax'),
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ def registration_View(request):
|
|||||||
|
|
||||||
Dict = {}
|
Dict = {}
|
||||||
|
|
||||||
|
if request.GET and 'mailingSubscribeRequired' in request.GET and request.GET['mailingSubscribeRequired'] == 'true':
|
||||||
|
request.session['mailingSubscribeRequired'] = 'true'
|
||||||
|
|
||||||
|
# if request.p
|
||||||
|
|
||||||
t = loader.get_template('pages/profile/p_registration.html')
|
t = loader.get_template('pages/profile/p_registration.html')
|
||||||
return get_inter_http_respose(t, Dict, request)
|
return get_inter_http_respose(t, Dict, request)
|
||||||
# return HttpResponse(t.render(Dict, request))
|
# return HttpResponse(t.render(Dict, request))
|
||||||
@@ -44,6 +49,11 @@ def profile_page_View(request, page_name, id=None):
|
|||||||
'page_type': 'profile'
|
'page_type': 'profile'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if request.session and 'mailingSubscribeRequired' in request.session and request.session['mailingSubscribeRequired'] == 'true':
|
||||||
|
request.user.user_profile.mailing_on = True
|
||||||
|
request.user.user_profile.save(update_fields=['mailing_on'])
|
||||||
|
del request.session['mailingSubscribeRequired']
|
||||||
|
|
||||||
title = f"{_('Личный кабинет пользователя')} {request.user.first_name} {request.user.last_name}"
|
title = f"{_('Личный кабинет пользователя')} {request.user.first_name} {request.user.last_name}"
|
||||||
|
|
||||||
Dict.update({
|
Dict.update({
|
||||||
@@ -54,10 +64,10 @@ def profile_page_View(request, page_name, id=None):
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if request.GET and 'mobile' in request.GET and request.GET['mobile'] == 'true':
|
# if request.GET and 'mobile' in request.GET and request.GET['mobile'] == 'true':
|
||||||
Dict.update({
|
# Dict.update({
|
||||||
'mobile': True
|
# 'mobile': True
|
||||||
})
|
# })
|
||||||
|
|
||||||
t = loader.get_template('pages/profile/p_user_profile.html')
|
t = loader.get_template('pages/profile/p_user_profile.html')
|
||||||
return get_inter_http_respose(t, Dict, request)
|
return get_inter_http_respose(t, Dict, request)
|
||||||
@@ -117,7 +127,14 @@ def logout_View(request):
|
|||||||
|
|
||||||
def login_View(request):
|
def login_View(request):
|
||||||
|
|
||||||
Dict = {}
|
from allauth.socialaccount.models import SocialApp
|
||||||
|
auth_google_allow = SocialApp.objects.filter(provider='google')
|
||||||
|
Dict = {
|
||||||
|
'auth_google_allow': auth_google_allow
|
||||||
|
}
|
||||||
|
|
||||||
|
if request.GET and 'mailingSubscribeRequired' in request.GET and request.GET['mailingSubscribeRequired'] == 'true':
|
||||||
|
request.session['mailingSubscribeRequired'] = 'true'
|
||||||
|
|
||||||
t = loader.get_template('pages/profile/p_login.html')
|
t = loader.get_template('pages/profile/p_login.html')
|
||||||
return get_inter_http_respose(t, Dict, request)
|
return get_inter_http_respose(t, Dict, request)
|
||||||
|
|||||||
70
BaseModels/PIL/pillow_backend.py
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
import os
|
||||||
|
from io import BytesIO
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.utils.functional import cached_property
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
from ckeditor_uploader import utils
|
||||||
|
|
||||||
|
|
||||||
|
THUMBNAIL_SIZE = getattr(settings, "CKEDITOR_THUMBNAIL_SIZE", (75, 75))
|
||||||
|
|
||||||
|
|
||||||
|
class PillowBackend:
|
||||||
|
def __init__(self, storage_engine, file_object):
|
||||||
|
self.file_object = file_object
|
||||||
|
self.storage_engine = storage_engine
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def is_image(self):
|
||||||
|
try:
|
||||||
|
Image.open(
|
||||||
|
BytesIO(self.file_object.read())
|
||||||
|
).verify() # verify closes the file
|
||||||
|
return True
|
||||||
|
except OSError:
|
||||||
|
return False
|
||||||
|
finally:
|
||||||
|
self.file_object.seek(0)
|
||||||
|
|
||||||
|
def _compress_image(self, image):
|
||||||
|
quality = getattr(settings, "CKEDITOR_IMAGE_QUALITY", 75)
|
||||||
|
image = image.resize(image.size, Image.ANTIALIAS).convert("RGB")
|
||||||
|
image_tmp = BytesIO()
|
||||||
|
image.save(image_tmp, format="JPEG", quality=quality, optimize=True)
|
||||||
|
return image_tmp
|
||||||
|
|
||||||
|
def save_as(self, filepath):
|
||||||
|
if not self.is_image:
|
||||||
|
saved_path = self.storage_engine.save(filepath, self.file_object)
|
||||||
|
return saved_path
|
||||||
|
|
||||||
|
image = Image.open(self.file_object)
|
||||||
|
|
||||||
|
should_compress = getattr(settings, "CKEDITOR_FORCE_JPEG_COMPRESSION", False)
|
||||||
|
is_animated = hasattr(image, "is_animated") and image.is_animated
|
||||||
|
if should_compress and not is_animated:
|
||||||
|
file_object = self._compress_image(image)
|
||||||
|
filepath = f"{os.path.splitext(filepath)[0]}.jpg"
|
||||||
|
saved_path = self.storage_engine.save(filepath, file_object)
|
||||||
|
else:
|
||||||
|
file_object = self.file_object
|
||||||
|
saved_path = self.storage_engine.save(filepath, self.file_object)
|
||||||
|
|
||||||
|
if not is_animated:
|
||||||
|
self.create_thumbnail(file_object, saved_path)
|
||||||
|
return saved_path
|
||||||
|
|
||||||
|
def create_thumbnail(self, file_object, file_path):
|
||||||
|
thumbnail_filename = utils.get_thumb_filename(file_path)
|
||||||
|
thumbnail_io = BytesIO()
|
||||||
|
# File object after saving e.g. to S3 can be closed.
|
||||||
|
try:
|
||||||
|
image = Image.open(file_object).convert("RGBA")
|
||||||
|
except ValueError:
|
||||||
|
file_object = self.storage_engine.open(file_path)
|
||||||
|
image = Image.open(file_object).convert("RGBA")
|
||||||
|
image.thumbnail(THUMBNAIL_SIZE, Image.ANTIALIAS)
|
||||||
|
image.save(thumbnail_io, format="PNG", optimize=True)
|
||||||
|
return self.storage_engine.save(thumbnail_filename, thumbnail_io)
|
||||||
@@ -112,6 +112,20 @@ class BaseModelViewPage(BaseModel):
|
|||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
|
def get_title(self):
|
||||||
|
if self.seo_title:
|
||||||
|
return self.seo_title
|
||||||
|
elif self.title:
|
||||||
|
return self.title
|
||||||
|
else:
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
if self.seo_description:
|
||||||
|
return self.seo_description
|
||||||
|
else:
|
||||||
|
return self.description
|
||||||
|
|
||||||
def get_FAQ_items(self):
|
def get_FAQ_items(self):
|
||||||
return self.FAQ_items.filter(enable=True).order_by('order')
|
return self.FAQ_items.filter(enable=True).order_by('order')
|
||||||
|
|
||||||
|
|||||||
@@ -96,27 +96,27 @@ def sortByLength(inputStr):
|
|||||||
return len(inputStr)
|
return len(inputStr)
|
||||||
|
|
||||||
|
|
||||||
def add_domain(request, url, add_lang=False):
|
# def add_domain(request, url, add_lang=False):
|
||||||
domain = get_domain_by_request(request)
|
# domain = get_domain_by_request(request)
|
||||||
if add_lang:
|
# if add_lang:
|
||||||
cur_lang = get_cur_lang_by_request(request)
|
# cur_lang = get_cur_lang_by_request(request)
|
||||||
return '{0}/{1}/{2}'.format(domain, cur_lang, url)
|
# return '{0}/{1}/{2}'.format(domain, cur_lang, url)
|
||||||
else:
|
# else:
|
||||||
return '{0}{1}'.format(domain, url)
|
# return '{0}{1}'.format(domain, url)
|
||||||
|
|
||||||
|
|
||||||
def get_domain_by_request(request):
|
# def get_domain_by_request(request):
|
||||||
from project_sets import domain
|
# from project_sets import domain
|
||||||
if request.query_params and 'domain' in request.query_params:
|
# if request.query_params and 'domain' in request.query_params:
|
||||||
return request.query_params['domain']
|
# return request.query_params['domain']
|
||||||
return domain
|
# return domain
|
||||||
|
#
|
||||||
|
#
|
||||||
def get_cur_lang_by_request(request):
|
# def get_cur_lang_by_request(request):
|
||||||
from project_sets import lang
|
# from project_sets import lang
|
||||||
if request.query_params and 'cur_lang' in request.query_params:
|
# if request.query_params and 'cur_lang' in request.query_params:
|
||||||
return request.query_params['cur_lang']
|
# return request.query_params['cur_lang']
|
||||||
return lang
|
# return lang
|
||||||
|
|
||||||
|
|
||||||
def get_img_type_by_request(request):
|
def get_img_type_by_request(request):
|
||||||
@@ -416,6 +416,8 @@ def kill_pretexts(txt):
|
|||||||
return ' '.join(words)
|
return ' '.join(words)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def stay_only_text_and_numbers(txt):
|
def stay_only_text_and_numbers(txt):
|
||||||
bad_symbols = '"~`{}[]|!@#$%^&*()_+№;:?= '
|
bad_symbols = '"~`{}[]|!@#$%^&*()_+№;:?= '
|
||||||
nums = '0123456789'
|
nums = '0123456789'
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ def techSendMail_for_specified_email_list(sets, html_content, email_list, title=
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = 'techSendMail_for_specified_email_list error={0}'.format(str(e))
|
msg = 'techSendMail_for_specified_email_list error={0}'.format(str(e))
|
||||||
techSendMail(msg)
|
techSendMail(sets, msg)
|
||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
return 'Fail'
|
return 'Fail'
|
||||||
@@ -266,19 +266,22 @@ def techSendMail(sets, html_content, title=None, add_emails=None):
|
|||||||
# return msg
|
# return msg
|
||||||
|
|
||||||
print('techSendMail')
|
print('techSendMail')
|
||||||
|
project_name = ''
|
||||||
|
if 'project_name' in sets:
|
||||||
|
project_name = sets['project_name']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# subject = u'truEnergy Data техническое оповещение'
|
# subject = u'truEnergy Data техническое оповещение'
|
||||||
from_email = 'support@truenergy.by'
|
from_email = sets['sender_email']
|
||||||
to = ['web@syncsystems.net']
|
to = ['web@syncsystems.net']
|
||||||
if add_emails:
|
if add_emails:
|
||||||
to.extend(add_emails)
|
to.extend(add_emails)
|
||||||
text_content = 'Technical message from truEnergy.'
|
text_content = f'Technical message from {project_name}'
|
||||||
|
|
||||||
if title:
|
if title:
|
||||||
subject = title
|
subject = title
|
||||||
else:
|
else:
|
||||||
subject = u'truEnergy Data техническое оповещение'
|
subject = f'{project_name} - техническое оповещение'
|
||||||
|
|
||||||
res = admin_send_mail_by_SMTPlib(sets, subject, from_email, to, html_content)
|
res = admin_send_mail_by_SMTPlib(sets, subject, from_email, to, html_content)
|
||||||
|
|
||||||
|
|||||||
24
BaseModels/validators/form_field_validators.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
from django.utils.translation import gettext as _
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
|
def get_phone_valid_error(val):
|
||||||
|
allow_chars = '01234567890()+ -'
|
||||||
|
|
||||||
|
error_msg = mark_safe(_('Некорректные символы в номере, введите номер в международном формате с кодом страны'))
|
||||||
|
|
||||||
|
if not val:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if len(val) < 10:
|
||||||
|
return error_msg
|
||||||
|
|
||||||
|
if '+' in val and val[0] != '+':
|
||||||
|
return error_msg
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
while i < len(val):
|
||||||
|
if val[i] not in allow_chars:
|
||||||
|
return error_msg
|
||||||
|
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
return None
|
||||||
@@ -1,6 +1,11 @@
|
|||||||
from sets.admin import *
|
from sets.admin import *
|
||||||
from .models import *
|
from .models import *
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from django import forms
|
||||||
|
from django.forms import widgets
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Admin_MsgGroup(Admin_BaseModel):
|
class Admin_MsgGroup(Admin_BaseModel):
|
||||||
list_display = [
|
list_display = [
|
||||||
@@ -11,8 +16,33 @@ class Admin_MsgGroup(Admin_BaseModel):
|
|||||||
admin.site.register(MsgGroup,Admin_MsgGroup)
|
admin.site.register(MsgGroup,Admin_MsgGroup)
|
||||||
|
|
||||||
class Admin_Message(Admin_BaseModel):
|
class Admin_Message(Admin_BaseModel):
|
||||||
|
|
||||||
|
def cut_group_text(self, obj):
|
||||||
|
if obj.group:
|
||||||
|
return obj.group.name[:10]
|
||||||
|
return '-'
|
||||||
|
cut_group_text.allow_tags = True
|
||||||
|
cut_group_text.short_description = 'ticket'
|
||||||
|
|
||||||
|
|
||||||
|
def cut_text(self, obj):
|
||||||
|
if obj.text:
|
||||||
|
if len(obj.text) > 20:
|
||||||
|
return f'{obj.text[:20]}...'
|
||||||
|
else:
|
||||||
|
return obj.text
|
||||||
|
return '-'
|
||||||
|
cut_text.allow_tags = True
|
||||||
|
cut_text.short_description = 'сообщение'
|
||||||
|
|
||||||
|
search_fields = ['group__name', 'text', 'name', 'id']
|
||||||
|
|
||||||
|
list_filter = ['status']
|
||||||
|
|
||||||
list_display = [
|
list_display = [
|
||||||
'id', 'msg_type', 'group', 'status', 'sender', 'receiver', 'text',
|
'id',
|
||||||
|
# 'msg_type',
|
||||||
|
'cut_group_text', 'status', 'sender', 'receiver', 'cut_text',
|
||||||
'name',
|
'name',
|
||||||
'order', 'modifiedDT', 'createDT'
|
'order', 'modifiedDT', 'createDT'
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import copy
|
||||||
|
|
||||||
from .models import *
|
from .models import *
|
||||||
from django.db.models import Q, Value as V, Count, OuterRef, Subquery
|
from django.db.models import Q, Value as V, Count, OuterRef, Subquery
|
||||||
from django.http import HttpResponse, Http404, JsonResponse
|
from django.http import HttpResponse, Http404, JsonResponse
|
||||||
@@ -11,6 +13,13 @@ from django.urls import reverse
|
|||||||
import json
|
import json
|
||||||
from datetime import datetime, time
|
from datetime import datetime, time
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from AuthApp.funcs import get_user_timezone_Dict
|
||||||
|
|
||||||
|
|
||||||
|
def get_unanswered_msgs_count_for_user(user):
|
||||||
|
msgs = Message.objects.filter(receiver=user, status='sended', group=None)
|
||||||
|
return msgs.count()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_update_chat_Dict(data):
|
def get_update_chat_Dict(data):
|
||||||
@@ -45,11 +54,22 @@ def get_update_chat_Dict(data):
|
|||||||
receiver = User.objects.get(id=data['receiver'])
|
receiver = User.objects.get(id=data['receiver'])
|
||||||
|
|
||||||
if data['sender'] == data['cur_user']:
|
if data['sender'] == data['cur_user']:
|
||||||
context_Dict.update({'user': sender})
|
user = copy.copy(sender)
|
||||||
|
cur_receiver = copy.copy(receiver)
|
||||||
else:
|
else:
|
||||||
context_Dict.update({'user': receiver})
|
user = copy.copy(receiver)
|
||||||
|
cur_receiver = copy.copy(sender)
|
||||||
|
# context_Dict.update({'user': receiver})
|
||||||
|
|
||||||
context_Dict.update({'cur_receiver': receiver})
|
# context_Dict.update({'cur_receiver': receiver})
|
||||||
|
context_Dict.update({
|
||||||
|
'cur_receiver': cur_receiver,
|
||||||
|
'user': user,
|
||||||
|
})
|
||||||
|
context_Dict.update(get_user_timezone_Dict(user))
|
||||||
|
|
||||||
|
if sender == receiver:
|
||||||
|
print('!')
|
||||||
|
|
||||||
required_beep = data['required_beep']
|
required_beep = data['required_beep']
|
||||||
|
|
||||||
@@ -92,7 +112,7 @@ def get_update_chat_Dict(data):
|
|||||||
|
|
||||||
context_Dict.update({
|
context_Dict.update({
|
||||||
'messages': msgs,
|
'messages': msgs,
|
||||||
'MEDIA_URL': settings.MEDIA_URL
|
'MEDIA_URL': settings.MEDIA_URL,
|
||||||
})
|
})
|
||||||
html = render_to_string(tpl_name, context_Dict)
|
html = render_to_string(tpl_name, context_Dict)
|
||||||
if required_full_support_chat_html:
|
if required_full_support_chat_html:
|
||||||
@@ -268,6 +288,7 @@ def send_msg(data):
|
|||||||
|
|
||||||
def get_chat_page_content_html(request, receiver_id=None):
|
def get_chat_page_content_html(request, receiver_id=None):
|
||||||
from AuthApp.models import User
|
from AuthApp.models import User
|
||||||
|
from AuthApp.funcs import get_user_timezone_Dict
|
||||||
|
|
||||||
msgs = []
|
msgs = []
|
||||||
try:
|
try:
|
||||||
@@ -287,6 +308,7 @@ def get_chat_page_content_html(request, receiver_id=None):
|
|||||||
'receivers': receivers,
|
'receivers': receivers,
|
||||||
'page': 'chat',
|
'page': 'chat',
|
||||||
}
|
}
|
||||||
|
Dict.update(get_user_timezone_Dict(request.user, request=request))
|
||||||
tpl_name = 'blocks/profile/b_chats.html'
|
tpl_name = 'blocks/profile/b_chats.html'
|
||||||
|
|
||||||
html = render_to_string(tpl_name, Dict, request=request)
|
html = render_to_string(tpl_name, Dict, request=request)
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ def show_chat_w_user_ajax(request):
|
|||||||
|
|
||||||
data = json.loads(request.body)
|
data = json.loads(request.body)
|
||||||
Dict = get_chat_page_content_Dict(request, data['user_id'])
|
Dict = get_chat_page_content_Dict(request, data['user_id'])
|
||||||
|
Dict.update(get_user_timezone_Dict(request.user, request=request))
|
||||||
|
|
||||||
tpl_name = 'blocks/profile/b_chats.html'
|
tpl_name = 'blocks/profile/b_chats.html'
|
||||||
|
|
||||||
@@ -99,7 +100,7 @@ def update_chat_ajax2(request):
|
|||||||
receiver = User.objects.get(id=data['receiver'])
|
receiver = User.objects.get(id=data['receiver'])
|
||||||
|
|
||||||
context_Dict.update({'cur_receiver': receiver})
|
context_Dict.update({'cur_receiver': receiver})
|
||||||
|
context_Dict.update(get_user_timezone_Dict(request.user, request=request))
|
||||||
|
|
||||||
if not ticket:
|
if not ticket:
|
||||||
|
|
||||||
@@ -123,6 +124,7 @@ def update_chat_ajax2(request):
|
|||||||
|
|
||||||
# формируем правую панель
|
# формируем правую панель
|
||||||
context_Dict.update({'receivers': receivers})
|
context_Dict.update({'receivers': receivers})
|
||||||
|
|
||||||
users_list_html = render_to_string(
|
users_list_html = render_to_string(
|
||||||
'blocks/profile/b_list_of_users_messenger.html', context_Dict, request=request)
|
'blocks/profile/b_list_of_users_messenger.html', context_Dict, request=request)
|
||||||
res_Dict.update({
|
res_Dict.update({
|
||||||
@@ -190,6 +192,7 @@ def update_chat_ajax(request):
|
|||||||
receiver = User.objects.get(id=data['receiver'])
|
receiver = User.objects.get(id=data['receiver'])
|
||||||
|
|
||||||
context_Dict.update({'cur_receiver': receiver})
|
context_Dict.update({'cur_receiver': receiver})
|
||||||
|
context_Dict.update(get_user_timezone_Dict(request.user, request=request))
|
||||||
|
|
||||||
if ticket:
|
if ticket:
|
||||||
|
|
||||||
@@ -201,6 +204,8 @@ def update_chat_ajax(request):
|
|||||||
context_Dict.update({'messages': msgs})
|
context_Dict.update({'messages': msgs})
|
||||||
context_Dict = get_ticketsDict_for_staff(request.user)
|
context_Dict = get_ticketsDict_for_staff(request.user)
|
||||||
|
|
||||||
|
context_Dict.update(get_user_timezone_Dict(request.user))
|
||||||
|
|
||||||
tickets_list_html = render_to_string(
|
tickets_list_html = render_to_string(
|
||||||
'blocks/profile/b_list_of_tickets_support_chat.html', context_Dict, request=request)
|
'blocks/profile/b_list_of_tickets_support_chat.html', context_Dict, request=request)
|
||||||
res_Dict.update({
|
res_Dict.update({
|
||||||
@@ -220,6 +225,8 @@ def update_chat_ajax(request):
|
|||||||
required_beep = True
|
required_beep = True
|
||||||
|
|
||||||
context_Dict.update({'receivers': receivers})
|
context_Dict.update({'receivers': receivers})
|
||||||
|
context_Dict.update(get_user_timezone_Dict(request.user))
|
||||||
|
|
||||||
users_list_html = render_to_string(
|
users_list_html = render_to_string(
|
||||||
'blocks/profile/b_list_of_users_messenger.html', context_Dict, request=request)
|
'blocks/profile/b_list_of_users_messenger.html', context_Dict, request=request)
|
||||||
res_Dict.update({
|
res_Dict.update({
|
||||||
@@ -404,12 +411,14 @@ def support_show_chat_by_ticket_ajax(request):
|
|||||||
'cur_receiver': cur_receiver,
|
'cur_receiver': cur_receiver,
|
||||||
'new_msg_allow': new_msg_allow,
|
'new_msg_allow': new_msg_allow,
|
||||||
'staff': request.user.is_staff,
|
'staff': request.user.is_staff,
|
||||||
'mobile': data['mobile']
|
# 'mobile': data['mobile']
|
||||||
}
|
}
|
||||||
Dict.update(get_ticketsDict_for_staff(request.user))
|
Dict.update(get_ticketsDict_for_staff(request.user))
|
||||||
|
|
||||||
tpl_name = 'blocks/profile/b_support_chat.html'
|
Dict.update(get_user_timezone_Dict(request.user))
|
||||||
|
|
||||||
|
tpl_name = 'blocks/profile/b_support_chat.html'
|
||||||
|
Dict.update(get_user_timezone_Dict(request.user, request=request))
|
||||||
html = render_to_string(tpl_name, Dict, request=request)
|
html = render_to_string(tpl_name, Dict, request=request)
|
||||||
return JsonResponse({'html': html}, status=200)
|
return JsonResponse({'html': html}, status=200)
|
||||||
|
|
||||||
@@ -429,6 +438,9 @@ def support_create_ticket_form_ajax(request):
|
|||||||
Dict = {
|
Dict = {
|
||||||
'form': TicketForm()
|
'form': TicketForm()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Dict.update(get_user_timezone_Dict(request.user))
|
||||||
|
|
||||||
tpl_name = 'blocks/profile/b_create_ticket.html'
|
tpl_name = 'blocks/profile/b_create_ticket.html'
|
||||||
|
|
||||||
html = render_to_string(tpl_name, Dict, request=request)
|
html = render_to_string(tpl_name, Dict, request=request)
|
||||||
@@ -450,6 +462,8 @@ def create_ticket_ajax(request):
|
|||||||
if not form.is_valid():
|
if not form.is_valid():
|
||||||
form.initial = form.cleaned_data
|
form.initial = form.cleaned_data
|
||||||
Dict = {'form': form}
|
Dict = {'form': form}
|
||||||
|
Dict.update(get_user_timezone_Dict(request.user))
|
||||||
|
|
||||||
html = render_to_string('blocks/profile/b_create_ticket.html', Dict, request=request)
|
html = render_to_string('blocks/profile/b_create_ticket.html', Dict, request=request)
|
||||||
return JsonResponse({'html': html}, status=400)
|
return JsonResponse({'html': html}, status=400)
|
||||||
|
|
||||||
@@ -490,6 +504,8 @@ def create_ticket_ajax(request):
|
|||||||
'messages': msgs_for_ticket
|
'messages': msgs_for_ticket
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Dict.update(get_user_timezone_Dict(request.user))
|
||||||
|
|
||||||
html = render_to_string('blocks/profile/b_support_chat.html', Dict, request=request)
|
html = render_to_string('blocks/profile/b_support_chat.html', Dict, request=request)
|
||||||
|
|
||||||
res_Dict = {
|
res_Dict = {
|
||||||
@@ -500,9 +516,11 @@ def create_ticket_ajax(request):
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
||||||
|
msg = f'{_("ошибка в запросе")} = {str(e)}'
|
||||||
|
|
||||||
errors_Dict = {
|
errors_Dict = {
|
||||||
'errors': {
|
'errors': {
|
||||||
'all__': f'{_("ошибка в запросе")} = {str(e)}'
|
'all__': msg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Dict = {'form': errors_Dict}
|
Dict = {'form': errors_Dict}
|
||||||
|
|||||||
@@ -38,6 +38,18 @@ class MsgGroup(BaseModel):
|
|||||||
manager = models.ForeignKey(User, verbose_name=_('Менеджер'), related_name='rel_msgGroups_for_manager',
|
manager = models.ForeignKey(User, verbose_name=_('Менеджер'), related_name='rel_msgGroups_for_manager',
|
||||||
on_delete=models.SET_NULL, null=True)
|
on_delete=models.SET_NULL, null=True)
|
||||||
|
|
||||||
|
def get_last_msg_txt(self):
|
||||||
|
msg = self.rel_messages_for_group.all().order_by('-createDT').first()
|
||||||
|
if not msg:
|
||||||
|
return self.text
|
||||||
|
|
||||||
|
if msg.text:
|
||||||
|
return msg.text
|
||||||
|
elif msg.files:
|
||||||
|
return msg.files[0]['file_name']
|
||||||
|
|
||||||
|
return self.name
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('Тикет')
|
verbose_name = _('Тикет')
|
||||||
verbose_name_plural = _('Тикеты')
|
verbose_name_plural = _('Тикеты')
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ def get_filesize(size):
|
|||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def get_msg_side(cur_user, ticket, msg):
|
def get_msg_side(cur_user, ticket, msg):
|
||||||
if msg:
|
if msg:
|
||||||
|
# if msg.sender == cur_user:
|
||||||
|
# return 'left'
|
||||||
|
# else:
|
||||||
|
# return 'right'
|
||||||
if msg.sender == cur_user:
|
if msg.sender == cur_user:
|
||||||
return 'right'
|
return 'right'
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -52,33 +52,33 @@ class Admin_StaticPage(Admin_Trans_BaseModelViewPage):
|
|||||||
|
|
||||||
admin.site.register(StaticPage,Admin_StaticPage)
|
admin.site.register(StaticPage,Admin_StaticPage)
|
||||||
|
|
||||||
class Admin_Block(Admin_Trans_BaseModel):
|
# class Admin_Block(Admin_Trans_BaseModel):
|
||||||
pass
|
# pass
|
||||||
|
#
|
||||||
# def get_fieldsets(self, request, obj=None):
|
# # def get_fieldsets(self, request, obj=None):
|
||||||
# fieldsets = super(type(self), self).get_fieldsets(request, obj)
|
# # fieldsets = super(type(self), self).get_fieldsets(request, obj)
|
||||||
# if not request.user.is_superuser and obj.name and obj.name in ('About US', 'machines', 'works'):
|
# # if not request.user.is_superuser and obj.name and obj.name in ('About US', 'machines', 'works'):
|
||||||
# fieldsets[0][1]['fields'].pop(0)
|
# # fieldsets[0][1]['fields'].pop(0)
|
||||||
# fieldsets.insert(
|
# # fieldsets.insert(
|
||||||
# 1, (_('Контент'), {
|
# # 1, (_('Контент'), {
|
||||||
# 'classes': ['wide'],
|
# # 'classes': ['wide'],
|
||||||
# 'fields': (
|
# # 'fields': (
|
||||||
# 'title', 'description', 'text',
|
# # 'title', 'description', 'text',
|
||||||
# 'picture',
|
# # 'picture',
|
||||||
# )
|
# # )
|
||||||
#
|
# #
|
||||||
# })
|
# # })
|
||||||
# )
|
# # )
|
||||||
# return fieldsets
|
# # return fieldsets
|
||||||
#
|
# #
|
||||||
# def has_delete_permission(self, request, obj=None):
|
# # def has_delete_permission(self, request, obj=None):
|
||||||
# if request.user.is_superuser:
|
# # if request.user.is_superuser:
|
||||||
# return True
|
# # return True
|
||||||
#
|
# #
|
||||||
# if obj.name in ('About US', 'machines', 'works'):
|
# # if obj.name in ('About US', 'machines', 'works'):
|
||||||
# return False
|
# # return False
|
||||||
|
#
|
||||||
admin.site.register(Block,Admin_Block)
|
# admin.site.register(Block,Admin_Block)
|
||||||
|
|
||||||
class Admin_Option(Admin_Trans_BaseModel):
|
class Admin_Option(Admin_Trans_BaseModel):
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ class Admin_Option(Admin_Trans_BaseModel):
|
|||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
|
|
||||||
list_display = ['image_thumb', 'opt_type', 'name', 'prefix', 'value']
|
list_display = ['image_thumb', 'opt_type', 'name', 'value', 'prefix']
|
||||||
list_editable = ['value', 'prefix']
|
list_editable = ['value', 'prefix']
|
||||||
list_filter = ['opt_type']
|
list_filter = ['opt_type']
|
||||||
|
|
||||||
|
|||||||
51
GeneralApp/allauth_funcs.py
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
|
||||||
|
from allauth.account.utils import user_field
|
||||||
|
from django.conf import settings
|
||||||
|
from allauth.account.adapter import DefaultAccountAdapter
|
||||||
|
import requests
|
||||||
|
from django.core.files import File
|
||||||
|
from django.core.files.temp import NamedTemporaryFile
|
||||||
|
|
||||||
|
class MyAccountAdapter(DefaultAccountAdapter):
|
||||||
|
|
||||||
|
def get_login_redirect_url(self, request):
|
||||||
|
path = super(MyAccountAdapter, self).get_login_redirect_url(request)
|
||||||
|
|
||||||
|
try:
|
||||||
|
user = request.user
|
||||||
|
user_profile = user.user_profile
|
||||||
|
if user_profile and not user_profile.avatar:
|
||||||
|
social_accounts = user.socialaccount_set.all()
|
||||||
|
if social_accounts:
|
||||||
|
for social_account in social_accounts:
|
||||||
|
if 'picture' in social_account.extra_data and social_account.extra_data['picture']:
|
||||||
|
r = requests.get(social_account.extra_data['picture'])
|
||||||
|
|
||||||
|
img_temp = NamedTemporaryFile()
|
||||||
|
img_temp.write(r.content)
|
||||||
|
img_temp.flush()
|
||||||
|
user_profile.avatar.save(f'avatar_{user.id}.jpeg', File(img_temp), True)
|
||||||
|
break
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
msg = f'post_save create_user_profile Error = {str(e)}'
|
||||||
|
print(msg)
|
||||||
|
|
||||||
|
return path
|
||||||
|
|
||||||
|
# class CustomSocialAccountAdapter(DefaultSocialAccountAdapter):
|
||||||
|
# def populate_user(self, request, sociallogin, data):
|
||||||
|
# from AuthApp.models import UserProfile
|
||||||
|
#
|
||||||
|
# user = super().populate_user(request, sociallogin, data)
|
||||||
|
# try:
|
||||||
|
# picture = sociallogin.account.extra_data['picture']
|
||||||
|
# user_profile = UserProfile.objects.get_or_create(user=user)
|
||||||
|
# with open(picture, 'rb') as fd:
|
||||||
|
# user_profile.avatar.save(f'user_{user.id}_avatar.jpeg', fd.read(), True)
|
||||||
|
# # user_field(user, "profile_photo", picture)
|
||||||
|
# except Exception as e:
|
||||||
|
# msg = f'CustomSocialAccountAdapter populate_user Error = {str(e)}'
|
||||||
|
# print(msg)
|
||||||
|
#
|
||||||
|
# return user
|
||||||
@@ -1,14 +1,45 @@
|
|||||||
from django.http import HttpResponse, Http404, FileResponse
|
from django.http import HttpResponse, Http404, FileResponse
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
def get_inter_Dict(user):
|
def get_inter_Dict(user):
|
||||||
|
|
||||||
from SubscribesApp.funcs import get_cur_user_subscribe
|
from SubscribesApp.funcs import get_cur_user_subscribe
|
||||||
user_subscribe = get_cur_user_subscribe(user)
|
user_subscribe = get_cur_user_subscribe(user)
|
||||||
|
|
||||||
return {'user_subscribe': user_subscribe}
|
|
||||||
|
Dict = {
|
||||||
|
'user_subscribe': user_subscribe,
|
||||||
|
'prod': True
|
||||||
|
}
|
||||||
|
|
||||||
|
if settings.WS_ADDRESS == 'localhost:8000':
|
||||||
|
Dict.update({'prod': False})
|
||||||
|
|
||||||
|
|
||||||
|
from PushMessages.views import get_key_Dict
|
||||||
|
Dict.update(get_key_Dict())
|
||||||
|
|
||||||
|
return Dict
|
||||||
|
|
||||||
def get_inter_http_respose(template_obj, context_Dict, request):
|
def get_inter_http_respose(template_obj, context_Dict, request):
|
||||||
|
|
||||||
context_Dict.update(get_inter_Dict(request.user))
|
context_Dict.update(get_inter_Dict(request.user))
|
||||||
|
|
||||||
|
from PushMessages.views import send_push
|
||||||
|
if request and 'page' in context_Dict:
|
||||||
|
text = None
|
||||||
|
title = None
|
||||||
|
|
||||||
|
if context_Dict['page'] == dict:
|
||||||
|
if 'title' in context_Dict['page']:
|
||||||
|
title = context_Dict['page']['title']
|
||||||
|
if 'description' in context_Dict['page']:
|
||||||
|
text = context_Dict['page']['description']
|
||||||
|
else:
|
||||||
|
title = getattr(context_Dict['page'], 'title', None)
|
||||||
|
text = getattr(context_Dict['page'], 'description', None)
|
||||||
|
|
||||||
|
# if text and title and not request.user.is_anonymous:
|
||||||
|
# send_push(user=request.user, title=title, text=text)
|
||||||
|
|
||||||
return HttpResponse(template_obj.render(context_Dict, request))
|
return HttpResponse(template_obj.render(context_Dict, request))
|
||||||
@@ -10,8 +10,25 @@ def get_options_by_opt_types(opt_types, only_vals=False):
|
|||||||
|
|
||||||
opts = Option.objects.filter(**kwargs)
|
opts = Option.objects.filter(**kwargs)
|
||||||
if opts and only_vals:
|
if opts and only_vals:
|
||||||
opts = opts.values('opt_type', 'value')
|
res = {}
|
||||||
opts = {item['opt_type']: item['value'] for item in opts}
|
opts = opts.values('opt_type', 'value', 'prefix')
|
||||||
|
for item in opts:
|
||||||
|
if item['opt_type'] == 'domain':
|
||||||
|
|
||||||
|
try:
|
||||||
|
from django.contrib.sites.models import Site
|
||||||
|
current_site = Site.objects.get_current()
|
||||||
|
res.update({item['opt_type']: current_site.domain})
|
||||||
|
continue
|
||||||
|
except Exception as e:
|
||||||
|
print(str(e))
|
||||||
|
|
||||||
|
if item['prefix']:
|
||||||
|
res.update({item['opt_type']: f"{item['prefix']}{item['value']}"})
|
||||||
|
else:
|
||||||
|
res.update({item['opt_type']: f"{item['value']}"})
|
||||||
|
return res
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
|
|
||||||
def get_first_option_value_by_opt_type(opt_type):
|
def get_first_option_value_by_opt_type(opt_type):
|
||||||
@@ -22,6 +39,6 @@ def get_first_option_value_by_opt_type(opt_type):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def get_mail_send_options():
|
def get_mail_send_options():
|
||||||
opt_types = ['mail_server_url', 'mail_server_smtp_port', 'sender_mail_login', 'sender_mail_password', 'sender_email']
|
opt_types = ['mail_server_url', 'mail_server_smtp_port', 'sender_mail_login', 'sender_mail_password', 'sender_email', 'project_name']
|
||||||
|
|
||||||
return get_options_by_opt_types(opt_types, only_vals=True)
|
return get_options_by_opt_types(opt_types, only_vals=True)
|
||||||
|
|||||||
@@ -3,47 +3,47 @@ from django.utils.translation import gettext as _
|
|||||||
|
|
||||||
|
|
||||||
required_options_Dict = {
|
required_options_Dict = {
|
||||||
'Адрес почтового сервера': {
|
'mail_server_url': {
|
||||||
'name_ru': 'Адрес почтового сервера',
|
'name_ru': 'Адрес почтового сервера',
|
||||||
'opt_type': 'mail_server_url',
|
'opt_type': 'mail_server_url',
|
||||||
'value': '213.142.147.40',
|
'value': '213.142.147.40',
|
||||||
},
|
},
|
||||||
'SMTP порт почтового сервера': {
|
'mail_server_smtp_port': {
|
||||||
'name_ru': 'SMTP порт почтового сервера',
|
'name_ru': 'SMTP порт почтового сервера',
|
||||||
'opt_type': 'mail_server_smtp_port',
|
'opt_type': 'mail_server_smtp_port',
|
||||||
'value': 587,
|
'value': 587,
|
||||||
},
|
},
|
||||||
'login для отправки писем с сайта': {
|
'sender_mail_login': {
|
||||||
'name_ru': 'email для отправки писем с сайта',
|
'name_ru': 'email для отправки писем с сайта',
|
||||||
'opt_type': 'sender_mail_login',
|
'opt_type': 'sender_mail_login',
|
||||||
'value': 'admin@tripwb.com',
|
'value': 'admin@tripwb.com',
|
||||||
},
|
},
|
||||||
'email для отправки': {
|
'sender_email': {
|
||||||
'name_ru': 'email для отправки',
|
'name_ru': 'email для отправки',
|
||||||
'opt_type': 'sender_email',
|
'opt_type': 'sender_email',
|
||||||
'value': 'admin@tripwb.com',
|
'value': 'admin@tripwb.com',
|
||||||
},
|
},
|
||||||
'Пароль для отправки писем с сайта': {
|
'sender_mail_password': {
|
||||||
'name_ru': 'пароль для отправки писем с сайта',
|
'name_ru': 'пароль для отправки писем с сайта',
|
||||||
'opt_type': 'sender_mail_password',
|
'opt_type': 'sender_mail_password',
|
||||||
'value': 't5Fdcah^gdajY',
|
'value': 't5Fdcah^gdajY',
|
||||||
},
|
},
|
||||||
'Название проекта': {
|
'project_name': {
|
||||||
'name_ru': 'Название проекта',
|
'name_ru': 'Название проекта',
|
||||||
'opt_type': 'project_name',
|
'opt_type': 'project_name',
|
||||||
'value': 'TWB',
|
'value': 'TWB',
|
||||||
},
|
},
|
||||||
'Адрес сайта': {
|
'domain': {
|
||||||
'name_ru': 'Адрес сайта',
|
'name_ru': 'Адрес сайта',
|
||||||
'opt_type': 'domain',
|
'opt_type': 'domain',
|
||||||
'value': 'tripwb.com',
|
'value': 'tripwb.com',
|
||||||
},
|
},
|
||||||
'email техподдержки': {
|
'support_email': {
|
||||||
'name_ru': 'email техподдержки',
|
'name_ru': 'email техподдержки',
|
||||||
'opt_type': 'support_email',
|
'opt_type': 'support_email',
|
||||||
'value': 'admin@tripwb.com',
|
'value': 'admin@tripwb.com',
|
||||||
},
|
},
|
||||||
'корпоративный email': {
|
'corp_email': {
|
||||||
'name_ru': 'корпоративный email',
|
'name_ru': 'корпоративный email',
|
||||||
'opt_type': 'corp_email',
|
'opt_type': 'corp_email',
|
||||||
'value': 'admin@tripwb.com',
|
'value': 'admin@tripwb.com',
|
||||||
@@ -53,11 +53,11 @@ required_options_Dict = {
|
|||||||
|
|
||||||
def init_options():
|
def init_options():
|
||||||
options = Option.objects.all()
|
options = Option.objects.all()
|
||||||
option_names = options.values_list('name', flat=True)
|
option_types_list = options.values_list('opt_type', flat=True)
|
||||||
|
|
||||||
opts_for_create = []
|
opts_for_create = []
|
||||||
for name, data_Dict in required_options_Dict.items():
|
for opt_type, data_Dict in required_options_Dict.items():
|
||||||
if not name in option_names:
|
if not opt_type in option_types_list:
|
||||||
opt = Option(**data_Dict)
|
opt = Option(**data_Dict)
|
||||||
opts_for_create.append(opt)
|
opts_for_create.append(opt)
|
||||||
|
|
||||||
|
|||||||
@@ -6,33 +6,72 @@ from django.contrib.auth.decorators import login_required
|
|||||||
from .models import *
|
from .models import *
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from .funcs import get_inter_http_respose
|
from .funcs import get_inter_http_respose
|
||||||
|
from django.http.response import JsonResponse, HttpResponse
|
||||||
|
from django.views.decorators.http import require_GET, require_POST
|
||||||
|
from django.shortcuts import get_object_or_404
|
||||||
|
from django.contrib.auth.models import User
|
||||||
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
|
from webpush import send_user_notification
|
||||||
|
import json
|
||||||
|
|
||||||
def test_code(request):
|
def test_code(request):
|
||||||
from RoutesApp.funcs import get_city_by_type_transport_and_address_point
|
from RoutesApp.funcs import get_city_by_type_transport_and_address_point
|
||||||
from RoutesApp.models import Route
|
from RoutesApp.models import Route
|
||||||
from ReferenceDataApp.models import Airport, City
|
from ReferenceDataApp.models import Airport, City
|
||||||
|
|
||||||
routes = Route.objects.all()
|
# import allauth
|
||||||
|
# from allauth.socialaccount.models import SocialApp
|
||||||
|
# apps = SocialApp.objects.all()
|
||||||
|
# apps.delete()
|
||||||
|
|
||||||
for route in routes:
|
from RoutesApp.search_matches import search_matches
|
||||||
print(route.id)
|
search_matches()
|
||||||
required_save = False
|
|
||||||
if not route.from_city:
|
|
||||||
route.from_city = get_city_by_type_transport_and_address_point(route.type_transport, route.from_address_point)
|
|
||||||
required_save = True
|
|
||||||
|
|
||||||
if not route.to_city:
|
# try:
|
||||||
route.to_city = get_city_by_type_transport_and_address_point(route.type_transport,
|
# # body = request.body
|
||||||
route.to_address_point)
|
# # data = json.loads(body)
|
||||||
required_save = True
|
# # if 'head' not in data or 'body' not in data or 'id' not in data:
|
||||||
|
# # return JsonResponse(status=400, data={"message": "Invalid data format"})
|
||||||
|
# # user_id = data['id']
|
||||||
|
# user = request.user
|
||||||
|
# payload = {'head': '123', 'body': 'qwerty'}
|
||||||
|
# send_user_notification(user=user, payload=payload, ttl=1000)
|
||||||
|
# return JsonResponse(status=200, data={"message": "Web push successful"})
|
||||||
|
# except TypeError:
|
||||||
|
# return JsonResponse(status=500, data={"message": "An error occurred"})
|
||||||
|
|
||||||
if required_save:
|
# routes = Route.objects.all()
|
||||||
route.save()
|
#
|
||||||
|
# for route in routes:
|
||||||
|
# print(route.id)
|
||||||
|
# required_save = False
|
||||||
|
# if not route.from_city:
|
||||||
|
# route.from_city = get_city_by_type_transport_and_address_point(route.type_transport, route.from_address_point)
|
||||||
|
# required_save = True
|
||||||
|
#
|
||||||
|
# if not route.to_city:
|
||||||
|
# route.to_city = get_city_by_type_transport_and_address_point(route.type_transport,
|
||||||
|
# route.to_address_point)
|
||||||
|
# required_save = True
|
||||||
|
#
|
||||||
|
# if required_save:
|
||||||
|
# route.save()
|
||||||
|
|
||||||
return HttpResponse('finished')
|
return HttpResponse('finished')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def Page404(request, exeption=None):
|
||||||
|
|
||||||
|
Dict = {}
|
||||||
|
|
||||||
|
t = loader.get_template('404.html')
|
||||||
|
try:
|
||||||
|
res = get_inter_http_respose(t, Dict, request)
|
||||||
|
return HttpResponse(res, status=404)
|
||||||
|
except Exception as e:
|
||||||
|
return HttpResponse(str(e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +87,7 @@ def MainPage(request):
|
|||||||
page = StaticPage.objects.get(url='main')
|
page = StaticPage.objects.get(url='main')
|
||||||
|
|
||||||
from ArticlesApp.models import ArticleModel
|
from ArticlesApp.models import ArticleModel
|
||||||
arts = ArticleModel.objects.filter(enable=True).order_by('-createDT')[:4]
|
arts = ArticleModel.objects.filter(enable=True).order_by('-createDT')[:3]
|
||||||
|
|
||||||
Dict = {
|
Dict = {
|
||||||
'page': page,
|
'page': page,
|
||||||
@@ -58,6 +97,8 @@ def MainPage(request):
|
|||||||
'owner_type': 'mover'
|
'owner_type': 'mover'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
breadcrumbs_Dict = {
|
breadcrumbs_Dict = {
|
||||||
}
|
}
|
||||||
Dict.update({'breadcrumbs': breadcrumbs_Dict})
|
Dict.update({'breadcrumbs': breadcrumbs_Dict})
|
||||||
|
|||||||
0
PushMessages/__init__.py
Normal file
3
PushMessages/admin.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
6
PushMessages/apps.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class PushmessagesConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'PushMessages'
|
||||||
0
PushMessages/migrations/__init__.py
Normal file
3
PushMessages/models.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
||||||
3
PushMessages/tests.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
16
PushMessages/urls.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# coding=utf-8
|
||||||
|
from django.urls import path, include
|
||||||
|
# from AuthApp.js_views import *
|
||||||
|
# from AuthApp.import_funcs import *
|
||||||
|
from .views import *
|
||||||
|
from django.contrib.auth import views
|
||||||
|
from RoutesApp.js_views import new_route_view_ajax
|
||||||
|
from django.views.generic import TemplateView
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
|
||||||
|
path('send_push', send_push),
|
||||||
|
path('webpush/', include('webpush.urls')),
|
||||||
|
path('sw.js', TemplateView.as_view(template_name='sw.js', content_type='application/x-javascript')),
|
||||||
|
|
||||||
|
]
|
||||||
49
PushMessages/views.py
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
from django.http.response import JsonResponse, HttpResponse
|
||||||
|
from django.views.decorators.http import require_GET, require_POST
|
||||||
|
from django.contrib.auth.models import User
|
||||||
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
|
from webpush import send_user_notification
|
||||||
|
import json
|
||||||
|
from django.shortcuts import render, get_object_or_404
|
||||||
|
from django.conf import settings
|
||||||
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
|
|
||||||
|
def get_key_Dict():
|
||||||
|
webpush_settings = getattr(settings, 'WEBPUSH_SETTINGS', {})
|
||||||
|
vapid_key = webpush_settings.get('VAPID_PUBLIC_KEY')
|
||||||
|
Dict = {
|
||||||
|
'vapid_key': vapid_key
|
||||||
|
}
|
||||||
|
return Dict
|
||||||
|
|
||||||
|
def send_push(user, title, text, url=None, button_name=None, img=None):
|
||||||
|
try:
|
||||||
|
# body = request.body
|
||||||
|
# data = json.loads(body)
|
||||||
|
#
|
||||||
|
# if 'head' not in data or 'body' not in data or 'id' not in data:
|
||||||
|
# return JsonResponse(status=400, data={"message": "Invalid data format"})
|
||||||
|
#
|
||||||
|
# user_id = data['id']
|
||||||
|
# user = get_object_or_404(User, pk=user_id)
|
||||||
|
Dict = {
|
||||||
|
'head': title,
|
||||||
|
'body': text,
|
||||||
|
}
|
||||||
|
if url:
|
||||||
|
Dict['url'] = url
|
||||||
|
if button_name:
|
||||||
|
Dict['button_name'] = button_name
|
||||||
|
else:
|
||||||
|
Dict['button_name'] = _('Перейти'),
|
||||||
|
|
||||||
|
if img:
|
||||||
|
Dict['img'] = img
|
||||||
|
|
||||||
|
# payload = {'head': data['head'], 'body': data['body']}
|
||||||
|
send_user_notification(user=user, payload=Dict, ttl=1000)
|
||||||
|
|
||||||
|
return JsonResponse(status=200, data={"message": "Web push successful"})
|
||||||
|
except TypeError:
|
||||||
|
return JsonResponse(status=500, data={"message": "An error occurred"})
|
||||||
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
celery -A TWB.celery:app worker -l info
|
||||||
|
|
||||||
|
celery -A TWB.celery:app beat -l info
|
||||||
@@ -55,7 +55,7 @@ def get_address_point_ajax(request):
|
|||||||
else:
|
else:
|
||||||
item['city_name'] = item['name']
|
item['city_name'] = item['name']
|
||||||
item['country_name'] = item['country__name']
|
item['country_name'] = item['country__name']
|
||||||
item['fullname'] = f'{item["country_name"]} / {item["city_name"]}'
|
item['fullname'] = f'{item["city_name"]} / {item["country_name"]}'
|
||||||
html = f"{html}{render_to_string('widgets/w_ac_input_address_point.html', item)}"
|
html = f"{html}{render_to_string('widgets/w_ac_input_address_point.html', item)}"
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from django.contrib import admin
|
|||||||
|
|
||||||
class Admin_Route(Admin_Trans_BaseModel):
|
class Admin_Route(Admin_Trans_BaseModel):
|
||||||
list_display = [
|
list_display = [
|
||||||
'id', 'owner_type', 'type_transport', 'cargo_type',
|
'id', 'owner_type', 'receive_msg_by_email', 'type_transport', 'cargo_type',
|
||||||
'departure_DT', 'from_city', 'from_place',
|
'departure_DT', 'from_city', 'from_place',
|
||||||
'arrival_DT', 'to_city', 'to_place', 'owner',
|
'arrival_DT', 'to_city', 'to_place', 'owner',
|
||||||
'order', 'modifiedDT', 'createDT'
|
'order', 'modifiedDT', 'createDT'
|
||||||
@@ -14,5 +14,6 @@ class Admin_Route(Admin_Trans_BaseModel):
|
|||||||
|
|
||||||
list_filter = ['owner_type', 'type_transport', 'cargo_type', 'from_place', 'arrival_DT', 'modifiedDT', 'createDT']
|
list_filter = ['owner_type', 'type_transport', 'cargo_type', 'from_place', 'arrival_DT', 'modifiedDT', 'createDT']
|
||||||
search_fields = ['owner__first_name', 'owner__last_name']
|
search_fields = ['owner__first_name', 'owner__last_name']
|
||||||
|
raw_id_fields = ['from_city', 'to_city']
|
||||||
|
|
||||||
admin.site.register(Route,Admin_Route)
|
admin.site.register(Route,Admin_Route)
|
||||||
|
|||||||
@@ -6,6 +6,47 @@ from django.core.exceptions import ValidationError
|
|||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
|
|
||||||
|
def routeForm_assign_choices_by_type_transport(form, type_transport):
|
||||||
|
if type_transport == 'avia':
|
||||||
|
transfer_location_choices = (
|
||||||
|
('airport', _('В аэропорту')),
|
||||||
|
('city', _('По городу')),
|
||||||
|
('other', _('По договоренности'))
|
||||||
|
)
|
||||||
|
|
||||||
|
cargo_type_choices = (
|
||||||
|
('cargo', _('Груз')),
|
||||||
|
('parcel', _('Бандероль')),
|
||||||
|
('package', _('Посылка')),
|
||||||
|
('letter', _('Письмо\Документ'))
|
||||||
|
)
|
||||||
|
|
||||||
|
else:
|
||||||
|
transfer_location_choices = (
|
||||||
|
('city', _('По городу')),
|
||||||
|
('other', _('По договоренности'))
|
||||||
|
)
|
||||||
|
|
||||||
|
cargo_type_choices = (
|
||||||
|
('passenger', _('Пассажир')),
|
||||||
|
('cargo', _('Груз')),
|
||||||
|
('parcel', _('Бандероль')),
|
||||||
|
('package', _('Посылка')),
|
||||||
|
('letter', _('Письмо\Документ'))
|
||||||
|
)
|
||||||
|
|
||||||
|
form.fields['from_place'].choices = transfer_location_choices
|
||||||
|
form.fields['to_place'].choices = transfer_location_choices
|
||||||
|
form.fields['cargo_type'].choices = cargo_type_choices
|
||||||
|
|
||||||
|
form.base_fields['from_place'].choices = transfer_location_choices
|
||||||
|
form.base_fields['to_place'].choices = transfer_location_choices
|
||||||
|
form.base_fields['cargo_type'].choices = cargo_type_choices
|
||||||
|
|
||||||
|
return form
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RouteForm(forms.ModelForm):
|
class RouteForm(forms.ModelForm):
|
||||||
from_address_point_txt = forms.CharField(required=True)
|
from_address_point_txt = forms.CharField(required=True)
|
||||||
to_address_point_txt = forms.CharField(required=True)
|
to_address_point_txt = forms.CharField(required=True)
|
||||||
@@ -24,6 +65,22 @@ class RouteForm(forms.ModelForm):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
|
if 'phone' in cleaned_data and 'phone' in cleaned_data:
|
||||||
|
from BaseModels.validators.form_field_validators import get_phone_valid_error
|
||||||
|
error = get_phone_valid_error(cleaned_data["phone"])
|
||||||
|
if error:
|
||||||
|
self.add_error('phone', error)
|
||||||
|
|
||||||
|
if 'extra_phone' in cleaned_data and 'extra_phone' in cleaned_data:
|
||||||
|
from BaseModels.validators.form_field_validators import get_phone_valid_error
|
||||||
|
error = get_phone_valid_error(cleaned_data["extra_phone"])
|
||||||
|
if error:
|
||||||
|
self.add_error('extra_phone', error)
|
||||||
|
|
||||||
|
if 'departure_DT' in cleaned_data and 'arrival_DT' in cleaned_data and cleaned_data['arrival_DT'] < cleaned_data['departure_DT']:
|
||||||
|
self.add_error('arrival_DT', _('Указана неверная дата прибытия'))
|
||||||
|
|
||||||
|
|
||||||
if 'from_place' in self.data and self.data['from_place'] not in [item[0] for item in self.fields['from_place'].choices]:
|
if 'from_place' in self.data and self.data['from_place'] not in [item[0] for item in self.fields['from_place'].choices]:
|
||||||
cleaned_data['from_place'] = self.fields['from_place'].choices[0][0]
|
cleaned_data['from_place'] = self.fields['from_place'].choices[0][0]
|
||||||
if 'from_place' in self.errors and self.errors['from_place'].data[0].code == 'invalid_choice':
|
if 'from_place' in self.errors and self.errors['from_place'].data[0].code == 'invalid_choice':
|
||||||
|
|||||||
@@ -7,12 +7,19 @@ from datetime import datetime
|
|||||||
elements_on_page = 25
|
elements_on_page = 25
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_profile_new_route_page_html(request, data):
|
def get_profile_new_route_page_html(request, data):
|
||||||
|
|
||||||
form = RouteForm()
|
form = RouteForm()
|
||||||
Dict = {
|
Dict = {
|
||||||
'form': form
|
'form': form
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
errors_off = True
|
errors_off = True
|
||||||
@@ -27,59 +34,71 @@ def get_profile_new_route_page_html(request, data):
|
|||||||
if 'to_address_point_txt' in data:
|
if 'to_address_point_txt' in data:
|
||||||
del data['to_address_point_txt']
|
del data['to_address_point_txt']
|
||||||
|
|
||||||
|
|
||||||
|
# if data['type_transport'] == 'avia':
|
||||||
|
# transfer_location_choices = (
|
||||||
|
# ('airport', _('В аэропорту')),
|
||||||
|
# ('city', _('По городу')),
|
||||||
|
# ('other', _('По договоренности'))
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# cargo_type_choices = (
|
||||||
|
# ('cargo', _('Груз')),
|
||||||
|
# ('parcel', _('Бандероль')),
|
||||||
|
# ('package', _('Посылка')),
|
||||||
|
# ('letter', _('Письмо\Документ'))
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# else:
|
||||||
|
# transfer_location_choices = (
|
||||||
|
# ('city', _('По городу')),
|
||||||
|
# ('other', _('По договоренности'))
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# cargo_type_choices = (
|
||||||
|
# ('passenger', _('Пассажир')),
|
||||||
|
# ('cargo', _('Груз')),
|
||||||
|
# ('parcel', _('Бандероль')),
|
||||||
|
# ('package', _('Посылка')),
|
||||||
|
# ('letter', _('Письмо\Документ'))
|
||||||
|
# )
|
||||||
|
|
||||||
|
form = RouteForm(data)
|
||||||
|
if not form.is_valid():
|
||||||
|
pass
|
||||||
|
form = RouteForm(initial=form.cleaned_data)
|
||||||
|
|
||||||
if 'type_transport' in data:
|
if 'type_transport' in data:
|
||||||
if data['type_transport'] == 'avia':
|
form = routeForm_assign_choices_by_type_transport(form, data['type_transport'])
|
||||||
transfer_location_choices = (
|
|
||||||
('airport', _('В аэропорту')),
|
|
||||||
('city', _('По городу')),
|
|
||||||
('other', _('По договоренности'))
|
|
||||||
)
|
|
||||||
|
|
||||||
cargo_type_choices = (
|
# form.fields['from_place'].choices = transfer_location_choices
|
||||||
('passenger', _('Пассажир')),
|
# form.fields['to_place'].choices = transfer_location_choices
|
||||||
('cargo', _('Груз')),
|
# form.fields['cargo_type'].choices = cargo_type_choices
|
||||||
('parcel', _('Бандероль')),
|
#
|
||||||
('package', _('Посылка')),
|
# form.base_fields['from_place'].choices = transfer_location_choices
|
||||||
('letter', _('Письмо\Документ'))
|
# form.base_fields['to_place'].choices = transfer_location_choices
|
||||||
)
|
# form.base_fields['cargo_type'].choices = cargo_type_choices
|
||||||
|
|
||||||
|
|
||||||
else:
|
|
||||||
transfer_location_choices = (
|
|
||||||
('city', _('По городу')),
|
|
||||||
('other', _('По договоренности'))
|
|
||||||
)
|
|
||||||
|
|
||||||
cargo_type_choices = (
|
|
||||||
('cargo', _('Груз')),
|
|
||||||
('parcel', _('Бандероль')),
|
|
||||||
('package', _('Посылка')),
|
|
||||||
('letter', _('Письмо\Документ'))
|
|
||||||
)
|
|
||||||
|
|
||||||
form = RouteForm(data)
|
|
||||||
if not form.is_valid():
|
|
||||||
pass
|
|
||||||
form = RouteForm(initial=form.cleaned_data)
|
|
||||||
|
|
||||||
form.fields['from_place'].choices = transfer_location_choices
|
|
||||||
form.fields['to_place'].choices = transfer_location_choices
|
|
||||||
form.fields['cargo_type'].choices = cargo_type_choices
|
|
||||||
|
|
||||||
form.base_fields['from_place'].choices = transfer_location_choices
|
|
||||||
form.base_fields['to_place'].choices = transfer_location_choices
|
|
||||||
form.base_fields['cargo_type'].choices = cargo_type_choices
|
|
||||||
|
|
||||||
# form = CreateRouteForm(initial=data)
|
# form = CreateRouteForm(initial=data)
|
||||||
|
|
||||||
# if not form.is_valid():
|
# if not form.is_valid():
|
||||||
# pass
|
# pass
|
||||||
|
|
||||||
|
if 'owner_type' in data:
|
||||||
|
form.initial['owner_type'] = data['owner_type']
|
||||||
|
|
||||||
|
if request.user and request.user.is_authenticated and request.user.user_profile and request.user.user_profile.phone:
|
||||||
|
form.initial.update({'phone': request.user.user_profile.phone})
|
||||||
|
|
||||||
Dict = {
|
Dict = {
|
||||||
'form': form,
|
'form': form,
|
||||||
'errors_off': errors_off
|
'errors_off': errors_off
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if 'owner_type' in data:
|
||||||
|
Dict.update({'owner_type': data['owner_type']})
|
||||||
|
|
||||||
# print(form)
|
# print(form)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# form.errors.append({'__all__': f'Ошибка: {str(e)}'})
|
# form.errors.append({'__all__': f'Ошибка: {str(e)}'})
|
||||||
@@ -141,18 +160,31 @@ def get_routes_Dict(user=None, data=None):
|
|||||||
res_Dict = {}
|
res_Dict = {}
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
|
|
||||||
|
type_transport = None
|
||||||
|
if 'type_transport' in data and data['type_transport']:
|
||||||
|
items_list = data['type_transport'].split(',')
|
||||||
|
kwargs.update({f'type_transport__in': items_list})
|
||||||
|
|
||||||
|
if len(items_list) == 1:
|
||||||
|
type_transport = items_list[0]
|
||||||
|
|
||||||
|
|
||||||
for key, val in data.items():
|
for key, val in data.items():
|
||||||
if val:
|
if val:
|
||||||
if key == 'weight':
|
if key == 'weight':
|
||||||
weight_list = val.split(';')
|
weight_list = val.split(';')
|
||||||
if weight_list[0]:
|
if len(weight_list) > 1:
|
||||||
kwargs.update({f'{key}__gte': int(weight_list[0])})
|
if weight_list[0]:
|
||||||
if weight_list[1]:
|
kwargs.update({f'{key}__gte': int(weight_list[0])})
|
||||||
kwargs.update({f'{key}__lte': int(weight_list[1])})
|
if weight_list[1]:
|
||||||
|
kwargs.update({f'{key}__lte': int(weight_list[1])})
|
||||||
|
else:
|
||||||
|
kwargs.update({f'{key}__lte': int(weight_list[0])})
|
||||||
|
|
||||||
if key == 'type_transport':
|
# if key == 'type_transport':
|
||||||
items_list = val.split(',')
|
# items_list = val.split(',')
|
||||||
kwargs.update({f'{key}__in': items_list})
|
# kwargs.update({f'{key}__in': items_list})
|
||||||
|
|
||||||
|
|
||||||
if key in (
|
if key in (
|
||||||
@@ -172,19 +204,18 @@ def get_routes_Dict(user=None, data=None):
|
|||||||
kwargs.update({key: val})
|
kwargs.update({key: val})
|
||||||
|
|
||||||
if key == 'from_address_point':
|
if key == 'from_address_point':
|
||||||
kwargs.update({f'from_city__id': val})
|
city = get_city_by_type_transport_and_address_point(type_transport, val)
|
||||||
|
kwargs.update({f'from_city': city})
|
||||||
|
|
||||||
res_Dict.update({
|
res_Dict.update({
|
||||||
'from_address_point_txt': get_country_n_city_str_by_type_transport_and_address_point(
|
'from_address_point_txt': city.get_country_n_city_str()
|
||||||
'road', val
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if key == 'to_address_point':
|
if key == 'to_address_point':
|
||||||
kwargs.update({f'to_city__id': val})
|
city = get_city_by_type_transport_and_address_point(type_transport, val)
|
||||||
|
kwargs.update({f'to_city': city})
|
||||||
res_Dict.update({
|
res_Dict.update({
|
||||||
'to_address_point_txt': get_country_n_city_str_by_type_transport_and_address_point(
|
'to_address_point_txt': city.get_country_n_city_str()
|
||||||
'road', val
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if key == 'from_el':
|
if key == 'from_el':
|
||||||
@@ -192,7 +223,7 @@ def get_routes_Dict(user=None, data=None):
|
|||||||
if key == 'to_el':
|
if key == 'to_el':
|
||||||
to_el = int(val)
|
to_el = int(val)
|
||||||
|
|
||||||
routes = Route.objects.filter(**kwargs).order_by('departure_DT', 'arrival_DT', '-modifiedDT')
|
routes = Route.objects.filter(**kwargs).order_by('-departure_DT', '-arrival_DT', '-modifiedDT')
|
||||||
routes_count = routes.count()
|
routes_count = routes.count()
|
||||||
|
|
||||||
if from_el and to_el:
|
if from_el and to_el:
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ def edit_route_ajax(request):
|
|||||||
route = Route.objects.get(id=data['route_id'])
|
route = Route.objects.get(id=data['route_id'])
|
||||||
|
|
||||||
form = RouteForm(instance=route)
|
form = RouteForm(instance=route)
|
||||||
|
form = routeForm_assign_choices_by_type_transport(form, route.type_transport)
|
||||||
|
|
||||||
route_address_points_Dict = route.get_address_points()
|
route_address_points_Dict = route.get_address_points()
|
||||||
form.initial.update({
|
form.initial.update({
|
||||||
'from_address_point_txt': route_address_points_Dict['from_address_point_txt'],
|
'from_address_point_txt': route_address_points_Dict['from_address_point_txt'],
|
||||||
@@ -230,7 +232,7 @@ def create_or_change_route_ajax(request, route_id=None):
|
|||||||
return JsonResponse({'html': html}, status=400)
|
return JsonResponse({'html': html}, status=400)
|
||||||
|
|
||||||
obj = form.save(commit=False)
|
obj = form.save(commit=False)
|
||||||
if 'owner_type' in data:
|
if 'owner_type' in data and data['owner_type']:
|
||||||
obj.owner_type = data['owner_type']
|
obj.owner_type = data['owner_type']
|
||||||
|
|
||||||
if obj.from_address_point:
|
if obj.from_address_point:
|
||||||
|
|||||||
0
RoutesApp/management/__init__.py
Normal file
0
RoutesApp/management/commands/__init__.py
Normal file
36
RoutesApp/management/commands/every_1hour_start.py
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
from django.core.management.base import BaseCommand
|
||||||
|
from datetime import datetime
|
||||||
|
from BaseModels.mailSender import techSendMail
|
||||||
|
from GeneralApp.funcs_options import get_options_by_opt_types, get_mail_send_options
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
|
||||||
|
def handle(self, *args, **options):
|
||||||
|
mail_sets = get_mail_send_options()
|
||||||
|
|
||||||
|
log = ''
|
||||||
|
log_begin_DT = datetime.now()
|
||||||
|
msg = str(log_begin_DT)
|
||||||
|
print('-------------')
|
||||||
|
print(msg)
|
||||||
|
|
||||||
|
try:
|
||||||
|
from ...search_matches import search_matches
|
||||||
|
msg = search_matches()
|
||||||
|
if msg:
|
||||||
|
print(msg)
|
||||||
|
except Exception as e:
|
||||||
|
msg = f'every_1hour_start search_matches fail = {str(e)}'
|
||||||
|
print(msg)
|
||||||
|
techSendMail(mail_sets, msg, title='every_1hour_start search_matches')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if msg:
|
||||||
|
techSendMail(mail_sets, str(msg), title='every_1hour_start get_competitors_prices')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print(f'- processing time = {str(datetime.now() - log_begin_DT)} -')
|
||||||
|
|
||||||
|
|
||||||
13
RoutesApp/management/commands/fix_code.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
from django.core.management.base import BaseCommand
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
|
||||||
|
def handle(self, *args, **options):
|
||||||
|
|
||||||
|
# from B2BApp.funcs import assign_contracts_for_orders_by_tmp_data
|
||||||
|
# log = assign_contracts_for_orders_by_tmp_data()
|
||||||
|
from GeneralApp.views import test_code
|
||||||
|
test_code(None)
|
||||||
|
|
||||||
|
self.stdout.write(u'fix_code end')
|
||||||
@@ -111,8 +111,8 @@ class Route(BaseModel):
|
|||||||
to_address_point_Dict = to_address_point_objs.values(
|
to_address_point_Dict = to_address_point_objs.values(
|
||||||
'id', 'name', 'country__name')[0]
|
'id', 'name', 'country__name')[0]
|
||||||
|
|
||||||
from_address_point_txt = f'{from_address_point_Dict["country__name"]} / {from_address_point_Dict["name"]}'
|
from_address_point_txt = f'{from_address_point_Dict["name"]} / {from_address_point_Dict["country__name"]}'
|
||||||
to_address_point_txt = f'{to_address_point_Dict["country__name"]} / {to_address_point_Dict["name"]}'
|
to_address_point_txt = f'{to_address_point_Dict["name"]} / {to_address_point_Dict["country__name"]}'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'from_address_point_obj': from_address_point_objs[0],
|
'from_address_point_obj': from_address_point_objs[0],
|
||||||
|
|||||||
145
RoutesApp/search_matches.py
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
from .models import *
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from django.utils.translation import gettext as _
|
||||||
|
from django.template.loader import render_to_string
|
||||||
|
from GeneralApp.funcs_options import get_options_by_opt_types, get_mail_send_options
|
||||||
|
from BaseModels.mailSender import admin_send_mail_by_SMTPlib, techSendMail
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def get_Dict_for_send_msgs(kwargs, search_owner_type):
|
||||||
|
print('get_Dict_for_send_msgs')
|
||||||
|
|
||||||
|
Dict = {
|
||||||
|
'search_owner_type': search_owner_type
|
||||||
|
}
|
||||||
|
sets = get_options_by_opt_types(['domain', 'project_name'], only_vals=True)
|
||||||
|
Dict.update(sets)
|
||||||
|
|
||||||
|
|
||||||
|
Dict.update({'logo': f'{sets["domain"]}/static/img/svg/LogoMobile.svg', })
|
||||||
|
|
||||||
|
find_routes_page_url = f'{sets["domain"]}/routes/route_search_results/?'
|
||||||
|
kwargs_list = [f'{key}={value}' for key, value in kwargs.items()]
|
||||||
|
kwargs_list.append(f'owner_type={search_owner_type}')
|
||||||
|
find_routes_page_url += f'{"&".join(kwargs_list)}'
|
||||||
|
|
||||||
|
Dict.update({'find_routes_page_url': find_routes_page_url})
|
||||||
|
|
||||||
|
return Dict
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def send_push_message_for_found_matches_routes(route, data_Dict):
|
||||||
|
print(f'send_push_message_for_found_matches_routes to route id = {route.id}')
|
||||||
|
|
||||||
|
if not route.owner.is_authenticated:
|
||||||
|
return None
|
||||||
|
|
||||||
|
from PushMessages.views import send_push
|
||||||
|
title = 'Мы нашли исполнителя по Вашему объявлению!'
|
||||||
|
text = 'Для просмотра результата нажмите на кнопку ниже'
|
||||||
|
send_push(route.owner, title, text, url=data_Dict['find_routes_page_url'], button_name=_('Перейти к найденному'))
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def send_mail_found_matches_routes(route, data_Dict):
|
||||||
|
print(f'send_mail_found_matches_routes to route id = {route.id}')
|
||||||
|
|
||||||
|
Dict = {
|
||||||
|
'route': route,
|
||||||
|
}
|
||||||
|
Dict.update(data_Dict)
|
||||||
|
|
||||||
|
html = render_to_string('mail/m_found_matched_routes.html', Dict)
|
||||||
|
|
||||||
|
|
||||||
|
mail_sets = get_mail_send_options()
|
||||||
|
to = [route.owner.email, 'web@syncsystems.net']
|
||||||
|
subject = _('Мы нашли исполнителя по Вашему объявлению!')
|
||||||
|
res = admin_send_mail_by_SMTPlib(
|
||||||
|
mail_sets,
|
||||||
|
subject=subject,
|
||||||
|
from_email=mail_sets['sender_email'], to=to,
|
||||||
|
html_content=html
|
||||||
|
)
|
||||||
|
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def search_matches(for_routes=None):
|
||||||
|
print('search_matches')
|
||||||
|
|
||||||
|
log = ''
|
||||||
|
|
||||||
|
try:
|
||||||
|
if not for_routes:
|
||||||
|
for_routes = Route.objects.filter(
|
||||||
|
createDT__gte=datetime.now() - timedelta(hours=1),
|
||||||
|
receive_msg_by_email=True
|
||||||
|
)
|
||||||
|
|
||||||
|
check_fields = [
|
||||||
|
'type_transport', 'departure_DT', 'arrival_DT', 'from_address_point', 'to_address_point',
|
||||||
|
'from_place', 'to_place', 'cargo_type', 'weight'
|
||||||
|
]
|
||||||
|
|
||||||
|
if for_routes:
|
||||||
|
msg = f'last hour create routes count = {for_routes.count()}'
|
||||||
|
else:
|
||||||
|
msg = f'last hour not create routes'
|
||||||
|
print(msg)
|
||||||
|
|
||||||
|
for route in for_routes:
|
||||||
|
kwargs = {}
|
||||||
|
params = {}
|
||||||
|
|
||||||
|
for field_name in check_fields:
|
||||||
|
field_val = getattr(route, field_name, None)
|
||||||
|
if field_val:
|
||||||
|
if type(field_val) == datetime:
|
||||||
|
params.update({f"{field_name}": f'{field_val.strftime("%d.%m.%Y")} - {field_val.strftime("%d.%m.%Y")}'})
|
||||||
|
kwargs.update({f"{field_name}__date": field_val.date()})
|
||||||
|
elif field_name == 'weight':
|
||||||
|
# print(field_name)
|
||||||
|
params.update({f"{field_name}": field_val})
|
||||||
|
if route.owner_type == 'mover':
|
||||||
|
kwargs.update({f"{field_name}__lte": field_val})
|
||||||
|
else:
|
||||||
|
kwargs.update({f"{field_name}__gte": field_val})
|
||||||
|
else:
|
||||||
|
kwargs.update({field_name: field_val})
|
||||||
|
params.update({field_name: field_val})
|
||||||
|
|
||||||
|
found_routes = Route.objects.exclude(
|
||||||
|
id=route.id,
|
||||||
|
).exclude(
|
||||||
|
owner=route.owner
|
||||||
|
).exclude(
|
||||||
|
owner_type=route.owner_type
|
||||||
|
).filter(
|
||||||
|
**kwargs
|
||||||
|
# ).count(
|
||||||
|
)
|
||||||
|
|
||||||
|
if found_routes:
|
||||||
|
msg = f'found routes for send messages = {found_routes.count()}'
|
||||||
|
|
||||||
|
data_Dict = get_Dict_for_send_msgs(params, found_routes[0].owner_type)
|
||||||
|
msg = send_push_message_for_found_matches_routes(route, data_Dict)
|
||||||
|
if msg:
|
||||||
|
log += msg
|
||||||
|
msg = send_mail_found_matches_routes(route, data_Dict)
|
||||||
|
if msg:
|
||||||
|
log += msg
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
msg = f'<br>\n! search_matches Error = {str(e)}'
|
||||||
|
print(msg)
|
||||||
|
log += msg
|
||||||
|
|
||||||
|
mail_sets = get_mail_send_options()
|
||||||
|
techSendMail(mail_sets, log, title='search_matches fail')
|
||||||
|
|
||||||
|
return log
|
||||||
@@ -6,7 +6,7 @@ class Admin_Subscribe(Admin_Trans_BaseModel):
|
|||||||
fieldsets = (
|
fieldsets = (
|
||||||
(None, {
|
(None, {
|
||||||
'classes': ['wide'],
|
'classes': ['wide'],
|
||||||
'fields': ('name',
|
'fields': ('name', 'enable',
|
||||||
('price'),
|
('price'),
|
||||||
'options',
|
'options',
|
||||||
'period_name', 'period',
|
'period_name', 'period',
|
||||||
@@ -18,12 +18,13 @@ class Admin_Subscribe(Admin_Trans_BaseModel):
|
|||||||
|
|
||||||
list_display = [
|
list_display = [
|
||||||
'id',
|
'id',
|
||||||
'name', 'price',
|
'name', 'enable', 'price',
|
||||||
'period_name', 'period',
|
'period_name', 'period',
|
||||||
'order', 'modifiedDT', 'createDT'
|
'order', 'modifiedDT', 'createDT'
|
||||||
]
|
]
|
||||||
|
|
||||||
list_display_links = ['id']
|
list_display_links = ['id']
|
||||||
|
list_editable = ['enable']
|
||||||
|
|
||||||
list_filter = ['modifiedDT', 'createDT']
|
list_filter = ['modifiedDT', 'createDT']
|
||||||
search_fields = ['name', 'period_name']
|
search_fields = ['name', 'period_name']
|
||||||
@@ -37,16 +38,18 @@ class Admin_SubscribeOption(Admin_Trans_BaseModel):
|
|||||||
(None, {
|
(None, {
|
||||||
'classes': ['wide'],
|
'classes': ['wide'],
|
||||||
'fields': ('name',
|
'fields': ('name',
|
||||||
'order'
|
'order',
|
||||||
|
'enable'
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
list_display = [
|
list_display = [
|
||||||
'id',
|
'id', 'enable',
|
||||||
'name',
|
'name',
|
||||||
'order', 'modifiedDT', 'createDT'
|
'order', 'modifiedDT', 'createDT'
|
||||||
]
|
]
|
||||||
|
list_editable = ['enable']
|
||||||
|
|
||||||
list_display_links = ['id']
|
list_display_links = ['id']
|
||||||
|
|
||||||
|
|||||||
7
SubscribesApp/serializers.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from rest_framework import serializers
|
||||||
|
|
||||||
|
|
||||||
|
class SubscribersSerializer(serializers.Serializer):
|
||||||
|
email = serializers.EmailField(error_messages={'invalid': 'Invalid email'})
|
||||||
|
email_notification = serializers.BooleanField()
|
||||||
|
auto_subscribe = serializers.BooleanField()
|
||||||
9
SubscribesApp/urls.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from django.urls import path
|
||||||
|
|
||||||
|
from SubscribesApp.views import SubscribersView
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
|
||||||
|
path('auto-subscribe/', SubscribersView.as_view(), name='auto_subscribe'),
|
||||||
|
|
||||||
|
]
|
||||||
@@ -1,3 +1,43 @@
|
|||||||
from django.shortcuts import render
|
from django.contrib.auth.models import User
|
||||||
|
from django.http import JsonResponse
|
||||||
|
from rest_framework import status
|
||||||
|
from rest_framework.permissions import IsAuthenticated
|
||||||
|
from rest_framework.views import APIView
|
||||||
|
|
||||||
# Create your views here.
|
from SubscribesApp.models import SubscribeForUser
|
||||||
|
from SubscribesApp.serializers import SubscribersSerializer
|
||||||
|
|
||||||
|
|
||||||
|
class SubscribersView(APIView):
|
||||||
|
# permission_classes = [IsAuthenticated]
|
||||||
|
|
||||||
|
def post(self, request):
|
||||||
|
serializer = SubscribersSerializer(data=request.data)
|
||||||
|
|
||||||
|
if serializer.is_valid():
|
||||||
|
validated_data = serializer.validated_data
|
||||||
|
email = validated_data['email']
|
||||||
|
email_notification = validated_data['email_notification']
|
||||||
|
auto_subscribe = validated_data['auto_subscribe']
|
||||||
|
|
||||||
|
user = User.objects.filter(email=email)
|
||||||
|
|
||||||
|
if user:
|
||||||
|
|
||||||
|
subscribe_for_user = SubscribeForUser.objects.filter(user_id=user[0].id)
|
||||||
|
|
||||||
|
if email_notification:
|
||||||
|
subscribe_for_user.update(receive_finish_subscribe_msg=True)
|
||||||
|
else:
|
||||||
|
subscribe_for_user.update(receive_finish_subscribe_msg=False)
|
||||||
|
|
||||||
|
if auto_subscribe:
|
||||||
|
subscribe_for_user.update(auto_continue=True)
|
||||||
|
else:
|
||||||
|
subscribe_for_user.update(auto_continue=False)
|
||||||
|
|
||||||
|
return JsonResponse({"message": "Subscriptions updated successfully"}, status=status.HTTP_200_OK)
|
||||||
|
else:
|
||||||
|
return JsonResponse({"message": "User not found"}, status=status.HTTP_404_NOT_FOUND)
|
||||||
|
else:
|
||||||
|
return JsonResponse(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||||
13
TWB/asgi.py
@@ -22,11 +22,14 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'TWB.settings')
|
|||||||
|
|
||||||
application = ProtocolTypeRouter({
|
application = ProtocolTypeRouter({
|
||||||
'http': get_asgi_application(),
|
'http': get_asgi_application(),
|
||||||
"websocket": QueryAuthMiddleware(
|
"websocket":
|
||||||
URLRouter(
|
# AllowedHostsOriginValidator(
|
||||||
websocket_urlpatterns
|
QueryAuthMiddleware(
|
||||||
)
|
URLRouter(
|
||||||
),
|
websocket_urlpatterns
|
||||||
|
)
|
||||||
|
# )
|
||||||
|
),
|
||||||
# 'websocket': AuthMiddlewareStack(
|
# 'websocket': AuthMiddlewareStack(
|
||||||
# URLRouter(
|
# URLRouter(
|
||||||
# websocket_urlpatterns
|
# websocket_urlpatterns
|
||||||
|
|||||||
27
TWB/celery.py
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from celery import Celery
|
||||||
|
from celery.schedules import crontab
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "TWB.settings")
|
||||||
|
|
||||||
|
app = Celery('bo', include=['TWB.tasks'])
|
||||||
|
app.config_from_object('django.conf:settings', namespace='CELERY')
|
||||||
|
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
|
||||||
|
|
||||||
|
app.conf.beat_schedule = {
|
||||||
|
'update-currency-rates': {
|
||||||
|
'task': 'TWB.tasks.check_auto_subscribe',
|
||||||
|
'schedule': crontab(minute=0, hour='*/1'),
|
||||||
|
},
|
||||||
|
'subscription_expiration_check': {
|
||||||
|
'task': 'TWB.tasks.subscription_expiration_check',
|
||||||
|
'schedule': crontab(hour=0, minute=0),
|
||||||
|
# 'schedule': crontab(minute='*', hour='*'),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
app.conf.broker_url = settings.CELERY_BROKER_URL
|
||||||
@@ -11,10 +11,13 @@ https://docs.djangoproject.com/en/4.2/ref/settings/
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from decouple import config
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
|
CSRF_TRUSTED_ORIGINS = ['https://tripwb.com']
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
|
||||||
@@ -28,6 +31,50 @@ DEBUG = True
|
|||||||
ALLOWED_HOSTS = ["*"]
|
ALLOWED_HOSTS = ["*"]
|
||||||
|
|
||||||
|
|
||||||
|
WEBPUSH_SETTINGS = {
|
||||||
|
"VAPID_PUBLIC_KEY": "BKS8byh3MucwCF2h06JY9oey1s1RYII09j-j3ehI3qTYhs965UHv0qNPl-jFjQBbIJCvjVXm9RW6t_oJJK8yMOk",
|
||||||
|
"VAPID_PRIVATE_KEY": "f5NMgOntBtRqsyeKwEzloK-051ggMnZGF_GFimERY0w",
|
||||||
|
"VAPID_ADMIN_EMAIL": "admin@tripwb.com"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SOCIALACCOUNT_LOGIN_ON_GET=True
|
||||||
|
ACCOUNT_DEFAULT_HTTP_PROTOCOL='https'
|
||||||
|
|
||||||
|
ACCOUNT_EMAIL_REQUIRED = True
|
||||||
|
ACCOUNT_USERNAME_REQUIRED = False
|
||||||
|
ACCOUNT_AUTHENTICATION_METHOD = 'email'
|
||||||
|
ACCOUNT_EMAIL_VERIFICATION = 'optional'
|
||||||
|
LOGIN_REDIRECT_URL = '/profile/page/dashboard/'
|
||||||
|
LOGIN_URL = '/profile/login/'
|
||||||
|
|
||||||
|
LOGOUT_REDIRECT_URL = '/profile/login/'
|
||||||
|
|
||||||
|
ACCOUNT_SIGNUP_REDIRECT_URL = '/profile/page/dashboard/'
|
||||||
|
ACCOUNT_LOGOUT_ON_GET = True
|
||||||
|
# SOCIALACCOUNT_ADAPTER = 'GeneralApp.allauth_funcs.MyAccountAdapter'
|
||||||
|
ACCOUNT_ADAPTER = 'GeneralApp.allauth_funcs.MyAccountAdapter'
|
||||||
|
|
||||||
|
AUTHENTICATION_BACKENDS = [
|
||||||
|
'django.contrib.auth.backends.ModelBackend',
|
||||||
|
'allauth.account.auth_backends.AuthenticationBackend',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
SOCIALACCOUNT_PROVIDERS = {
|
||||||
|
'google': {
|
||||||
|
'SCOPE': [
|
||||||
|
'profile',
|
||||||
|
'email',
|
||||||
|
],
|
||||||
|
'AUTH_PARAMS': {
|
||||||
|
'access_type': 'online',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# NOTIFICATION_KEY = 'BJLyGzmo8sLI3Qkc6pN2cz11frCXiJdewvgve7Yps-_fM1lY1LSnTQfQxYtAgQ_26nAji_rgeYC1DkLiTwxw0Mo'
|
||||||
|
|
||||||
# SESSION_COOKIE_HTTPONLY = False
|
# SESSION_COOKIE_HTTPONLY = False
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
@@ -46,17 +93,27 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'django.contrib.humanize',
|
'django.contrib.humanize',
|
||||||
|
|
||||||
|
'django.contrib.sites',
|
||||||
|
|
||||||
'colorfield',
|
'colorfield',
|
||||||
|
|
||||||
'ckeditor',
|
'ckeditor',
|
||||||
'ckeditor_uploader',
|
'ckeditor_uploader',
|
||||||
|
|
||||||
|
'webpush',
|
||||||
|
|
||||||
|
'allauth',
|
||||||
|
'allauth.account',
|
||||||
|
'allauth.socialaccount',
|
||||||
|
'allauth.socialaccount.providers.google',
|
||||||
|
|
||||||
'GeneralApp',
|
'GeneralApp',
|
||||||
'AuthApp',
|
'AuthApp',
|
||||||
'RoutesApp',
|
'RoutesApp',
|
||||||
'ReferenceDataApp',
|
'ReferenceDataApp',
|
||||||
'ArticlesApp',
|
'ArticlesApp',
|
||||||
'SubscribesApp',
|
'SubscribesApp',
|
||||||
|
'PushMessages',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
@@ -69,8 +126,14 @@ MIDDLEWARE = [
|
|||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
'AuthApp.middleware.ResponseInterceptionMiddleware',
|
'AuthApp.middleware.ResponseInterceptionMiddleware',
|
||||||
|
'TWB.tz_middelware.TimezoneMiddleware',
|
||||||
|
# 'tz_detect.middleware.TimezoneMiddleware',
|
||||||
|
|
||||||
|
"allauth.account.middleware.AccountMiddleware",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
SITE_ID = 1
|
||||||
|
|
||||||
ROOT_URLCONF = 'TWB.urls'
|
ROOT_URLCONF = 'TWB.urls'
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
@@ -109,11 +172,8 @@ CHANNEL_LAYERS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
POSTGRES_DB = config('POSTGRES_DB')
|
||||||
|
POSTGRES_USER = config('POSTGRES_USER')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
@@ -122,8 +182,8 @@ CHANNEL_LAYERS = {
|
|||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||||
'NAME': 'twbDB',
|
'NAME': POSTGRES_DB,
|
||||||
'USER': 'test_user',
|
'USER': POSTGRES_USER,
|
||||||
'PASSWORD': 'test_db_pass',
|
'PASSWORD': 'test_db_pass',
|
||||||
'HOST': '127.0.0.1',
|
'HOST': '127.0.0.1',
|
||||||
'PORT': '5432',
|
'PORT': '5432',
|
||||||
@@ -209,6 +269,7 @@ django.conf.locale.LANG_INFO = LANG_INFO
|
|||||||
|
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
|
|
||||||
|
DATA_UPLOAD_MAX_MEMORY_SIZE = 4145728
|
||||||
|
|
||||||
CKEDITOR_BASEPATH = "/static/ckeditor/ckeditor/"
|
CKEDITOR_BASEPATH = "/static/ckeditor/ckeditor/"
|
||||||
CKEDITOR_UPLOAD_PATH = "uploads/"
|
CKEDITOR_UPLOAD_PATH = "uploads/"
|
||||||
@@ -216,7 +277,9 @@ CKEDITOR_RESTRICT_BY_DATE = False
|
|||||||
CKEDITOR_RESTRICT_BY_USER = True
|
CKEDITOR_RESTRICT_BY_USER = True
|
||||||
CKEDITOR_BROWSE_SHOW_DIRS = True
|
CKEDITOR_BROWSE_SHOW_DIRS = True
|
||||||
|
|
||||||
CKEDITOR_IMAGE_BACKEND = "pillow"
|
# CKEDITOR_IMAGE_BACKEND = 'ckeditor_uploader.backends.PillowBackend'
|
||||||
|
# CKEDITOR_IMAGE_BACKEND = 'pillow'
|
||||||
|
CKEDITOR_IMAGE_BACKEND = "BaseModels.PIL.pillow_backend.PillowBackend"
|
||||||
|
|
||||||
# CKEDITOR_BROWSE_SHOW_DIRS = True
|
# CKEDITOR_BROWSE_SHOW_DIRS = True
|
||||||
|
|
||||||
@@ -231,6 +294,10 @@ CKEDITOR_CONFIGS = {
|
|||||||
'toolbar': 'Custom',
|
'toolbar': 'Custom',
|
||||||
'forcePasteAsPlainText': True,
|
'forcePasteAsPlainText': True,
|
||||||
'allowedContent': True,
|
'allowedContent': True,
|
||||||
|
|
||||||
|
'filebrowserImageThumbWidth': 300,
|
||||||
|
'filebrowserImageThumbHeight': 300,
|
||||||
|
'filebrowserUploadUrl': '/ckeditor/upload/',
|
||||||
# 'disallowedContent': 'img{width,height};img[width,height]',
|
# 'disallowedContent': 'img{width,height};img[width,height]',
|
||||||
# 'extraPlugins': 'image2',
|
# 'extraPlugins': 'image2',
|
||||||
|
|
||||||
@@ -266,6 +333,16 @@ CKEDITOR_CONFIGS = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CELERY_BROKER_URL = config('CELERY_BROKER_URL')
|
||||||
|
CELERY_RESULT_BACKEND = config('CELERY_RESULT_BACKEND')
|
||||||
|
|
||||||
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
|
EMAIL_HOST = 'smtp.gmail.com'
|
||||||
|
EMAIL_USE_TLS = True
|
||||||
|
EMAIL_PORT = 587
|
||||||
|
EMAIL_HOST_USER = config('EMAIL_HOST_USER')
|
||||||
|
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')
|
||||||
|
|
||||||
|
|
||||||
# CKEDITOR_OPTIONS = {
|
# CKEDITOR_OPTIONS = {
|
||||||
# 'height': 291,
|
# 'height': 291,
|
||||||
|
|||||||
40
TWB/tasks.py
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
from datetime import datetime, timedelta, timezone
|
||||||
|
|
||||||
|
from SubscribesApp.models import SubscribeForUser
|
||||||
|
from TWB import settings
|
||||||
|
from TWB.celery import app
|
||||||
|
from django.core.mail import send_mail
|
||||||
|
|
||||||
|
|
||||||
|
@app.task
|
||||||
|
def check_auto_subscribe():
|
||||||
|
current_time = datetime.now()
|
||||||
|
subscribes = SubscribeForUser.objects.filter(auto_continue=True)
|
||||||
|
if subscribes:
|
||||||
|
for subscribe in subscribes:
|
||||||
|
if subscribe.paid_period_to_DT and subscribe.paid_period_to_DT <= current_time + timedelta(hours=1):
|
||||||
|
user_email = subscribe.user.email
|
||||||
|
subject = 'Подписка продлена!'
|
||||||
|
message = 'Ваша подписка успешно продлена!'
|
||||||
|
send_mail(subject, message, settings.EMAIL_HOST_USER, [user_email], fail_silently=False)
|
||||||
|
else:
|
||||||
|
print('Нету подписок')
|
||||||
|
|
||||||
|
|
||||||
|
@app.task
|
||||||
|
def subscription_expiration_check():
|
||||||
|
current_time = datetime.now()
|
||||||
|
subscribes = SubscribeForUser.objects.filter(paid_period_to_DT__gte=current_time)
|
||||||
|
if subscribes:
|
||||||
|
for subscribe in subscribes:
|
||||||
|
expiration_date = subscribe.paid_period_to_DT
|
||||||
|
remaining_days = (expiration_date - current_time).days
|
||||||
|
|
||||||
|
if remaining_days <= 7:
|
||||||
|
message = f'Ваша подписка заканчивается через {remaining_days} дня. Пожалуйста, продлите её.'
|
||||||
|
|
||||||
|
user_email = subscribe.user.email
|
||||||
|
subject = 'Подписка истекает!'
|
||||||
|
send_mail(subject, message, settings.EMAIL_HOST_USER, [user_email], fail_silently=False)
|
||||||
|
else:
|
||||||
|
print('Нету подписок')
|
||||||
22
TWB/tz_middelware.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import zoneinfo
|
||||||
|
from django.utils import timezone
|
||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
class TimezoneMiddleware:
|
||||||
|
def __init__(self, get_response):
|
||||||
|
self.get_response = get_response
|
||||||
|
|
||||||
|
def __call__(self, request):
|
||||||
|
tz = request.COOKIES.get("user_tz")
|
||||||
|
if tz:
|
||||||
|
if request.user.is_authenticated:
|
||||||
|
if not 'user_timezone' in request.user.user_profile.json_data or request.user.user_profile.json_data['user_timezone'] != tz:
|
||||||
|
request.user.user_profile.json_data['user_timezone'] = tz
|
||||||
|
request.user.user_profile.save(update_fields=['json_data'])
|
||||||
|
|
||||||
|
msg = f'user={str(request.user.id)} tz={str(tz)}'
|
||||||
|
print(msg)
|
||||||
|
timezone.activate(zoneinfo.ZoneInfo(tz))
|
||||||
|
else:
|
||||||
|
timezone.activate(zoneinfo.ZoneInfo("UTC"))
|
||||||
|
return self.get_response(request)
|
||||||
22
TWB/urls.py
@@ -1,18 +1,30 @@
|
|||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path, include
|
from django.urls import path, include
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from GeneralApp.views import Page404
|
||||||
|
from AuthApp.views import login_View
|
||||||
|
|
||||||
|
handler404 = Page404
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# path('admin/', admin.site.urls),
|
|
||||||
path('ckeditor/', include('ckeditor_uploader.urls')),
|
path('ckeditor/', include('ckeditor_uploader.urls')),
|
||||||
path('i18n/', include('django.conf.urls.i18n')),
|
path('i18n/', include('django.conf.urls.i18n')),
|
||||||
|
|
||||||
|
# path('tz_detect/', include('tz_detect.urls')),
|
||||||
|
|
||||||
|
path('accounts/signup/', login_View, name='signup'),
|
||||||
|
path('accounts/login/cancelled/', login_View),
|
||||||
|
|
||||||
|
path('accounts/', include('allauth.urls')),
|
||||||
|
path('accounts/', include('allauth.socialaccount.urls')),
|
||||||
|
|
||||||
path('messages/', include('ChatServiceApp.urls')),
|
path('messages/', include('ChatServiceApp.urls')),
|
||||||
|
|
||||||
path('user_account/', include('AuthApp.js_urls')),
|
path('user_account/', include('AuthApp.js_urls')),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
path('routes/', include('RoutesApp.js_urls')),
|
path('routes/', include('RoutesApp.js_urls')),
|
||||||
|
|
||||||
path('subscribes/', include('SubscribesApp.js_urls')),
|
path('subscribes/', include('SubscribesApp.js_urls')),
|
||||||
@@ -22,6 +34,12 @@ urlpatterns = [
|
|||||||
path('reference_data/', include('ReferenceDataApp.js_urls')),
|
path('reference_data/', include('ReferenceDataApp.js_urls')),
|
||||||
|
|
||||||
path('', include('ArticlesApp.js_urls')),
|
path('', include('ArticlesApp.js_urls')),
|
||||||
|
|
||||||
|
path('test_404', Page404, name='page_404'),
|
||||||
|
|
||||||
|
path('', include('PushMessages.urls')),
|
||||||
|
path('', include('SubscribesApp.urls')),
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
from django.conf.urls.i18n import i18n_patterns
|
from django.conf.urls.i18n import i18n_patterns
|
||||||
|
|||||||
8
env.sample
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
EMAIL_HOST_USER=
|
||||||
|
EMAIL_HOST_PASSWORD=
|
||||||
|
|
||||||
|
POSTGRES_DB=
|
||||||
|
POSTGRES_USER=
|
||||||
|
|
||||||
|
CELERY_BROKER_URL=
|
||||||
|
CELERY_RESULT_BACKEND=
|
||||||
@@ -580,9 +580,9 @@ msgstr ""
|
|||||||
#: .\templates\blocks\static_pages_blocks\b_partners.html:18
|
#: .\templates\blocks\static_pages_blocks\b_partners.html:18
|
||||||
msgid ""
|
msgid ""
|
||||||
"Вы можете разместить объявление о перевозке посылки и перевозчики со всего "
|
"Вы можете разместить объявление о перевозке посылки и перевозчики со всего "
|
||||||
"мира откликнуться на ваше объявление или воспользовавшись поиском на сайте "
|
"мира откликнутся на ваше объявление или воспользовавшись поиском на сайте "
|
||||||
"найти перевозчика, который будет готов взять Вашу посылку и доставить в "
|
"найти перевозчика, который будет готов взять Вашу посылку и доставить в "
|
||||||
"указанное место авто- или авива транспортом."
|
"указанное место наземным или авиатранспортом."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: .\templates\blocks\static_pages_blocks\b_about_service.html:22
|
#: .\templates\blocks\static_pages_blocks\b_about_service.html:22
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ Django==4.2.2
|
|||||||
django-ckeditor==6.5.1
|
django-ckeditor==6.5.1
|
||||||
psycopg2-binary==2.9.6
|
psycopg2-binary==2.9.6
|
||||||
requests
|
requests
|
||||||
Pillow
|
|
||||||
django-modeltranslation==0.18.10
|
django-modeltranslation==0.18.10
|
||||||
overpass
|
overpass
|
||||||
geopy
|
geopy
|
||||||
@@ -10,4 +9,9 @@ channels==4.0.0
|
|||||||
daphne==4.0.0
|
daphne==4.0.0
|
||||||
channels-redis==4.1.0
|
channels-redis==4.1.0
|
||||||
django-colorfield
|
django-colorfield
|
||||||
|
django-webpush==0.3.5
|
||||||
|
django-allauth==0.60.0
|
||||||
|
pytz==2024.1
|
||||||
|
celery==5.3.6
|
||||||
|
djangorestframework==3.14.0
|
||||||
|
python-decouple==3.8
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
@media (max-width: 1280px){
|
@media (max-width: 1280px){
|
||||||
|
|
||||||
button#remove_route{
|
.remove_route{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@@ -18,11 +18,21 @@
|
|||||||
@media (max-width: 1199px){
|
@media (max-width: 1199px){
|
||||||
|
|
||||||
.dropbtn{
|
.dropbtn{
|
||||||
margin-right: 20px;
|
margin-right: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.header_logo, .header_btn_mover{
|
.header_logo, .header_btn_mover{
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
.dropbtn_lang{
|
||||||
|
padding: 2px 0.5px;
|
||||||
|
border-radius: 12px;
|
||||||
|
|
||||||
|
}
|
||||||
|
#ru_lang,#en_lang{
|
||||||
|
padding: unset;
|
||||||
|
}
|
||||||
|
|
||||||
#customer_service{
|
#customer_service{
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
@@ -61,41 +71,41 @@
|
|||||||
left: 33%;
|
left: 33%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cards_item_1,
|
/* .cards_item_1,*/
|
||||||
.cards_item_2,
|
/*.cards_item_2,*/
|
||||||
.cards_item_3,
|
/*.cards_item_3,*/
|
||||||
.cards_item_4
|
/*.cards_item_4*/
|
||||||
{
|
/*{*/
|
||||||
width: 46%;
|
/* width: 46%;*/
|
||||||
height: 180px;
|
/* height: 180px;*/
|
||||||
background-size:60%;
|
/* background-size:60%;*/
|
||||||
}
|
/*}*/
|
||||||
|
|
||||||
.card_title_1{
|
/* .card_title_1{*/
|
||||||
font-size: 34px;
|
/* font-size: 34px;*/
|
||||||
font-style: normal;
|
/* font-style: normal;*/
|
||||||
font-weight: 700;
|
/* font-weight: 700;*/
|
||||||
line-height: 42px;
|
/* line-height: 42px;*/
|
||||||
margin: 22px 0 0 10px;
|
/* margin: 22px 0 0 10px;*/
|
||||||
text-shadow: 1px 1px 0px #272424;
|
/* text-shadow: 1px 1px 0px #272424;*/
|
||||||
}
|
/*}*/
|
||||||
.card_title_2{
|
/*.card_title_2{*/
|
||||||
font-size: 17px;
|
/* font-size: 17px;*/
|
||||||
font-style: normal;
|
/* font-style: normal;*/
|
||||||
font-weight: 600;
|
/* font-weight: 600;*/
|
||||||
line-height: 26px;
|
/* line-height: 26px;*/
|
||||||
margin: 10px 0 0 10px;
|
/* margin: 10px 0 0 10px;*/
|
||||||
text-shadow: 1px 1px 0px #272424;
|
/* text-shadow: 1px 1px 0px #272424;*/
|
||||||
}
|
/*}*/
|
||||||
.card_title_3{
|
/*.card_title_3{*/
|
||||||
margin: 10px 0 0 10px;
|
/* margin: 10px 0 0 10px;*/
|
||||||
width: 95%;
|
/* width: 95%;*/
|
||||||
font-size: 12px;
|
/* font-size: 12px;*/
|
||||||
font-style: normal;
|
/* font-style: normal;*/
|
||||||
font-weight: 400;
|
/* font-weight: 400;*/
|
||||||
line-height: 20px;
|
/* line-height: 20px;*/
|
||||||
text-shadow: 1px 1px 0px #272424;
|
/* text-shadow: 1px 1px 0px #272424;*/
|
||||||
}
|
/*}*/
|
||||||
.sf_1_column {
|
.sf_1_column {
|
||||||
padding-left: 25px;
|
padding-left: 25px;
|
||||||
padding-right: 90px;
|
padding-right: 90px;
|
||||||
@@ -106,12 +116,102 @@
|
|||||||
}
|
}
|
||||||
@media (max-width: 1180px){
|
@media (max-width: 1180px){
|
||||||
|
|
||||||
|
.input_list.find_route{
|
||||||
|
left: unset;
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.handler_curtain_left{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.handler_curtain_left.close{
|
||||||
|
left: 0;
|
||||||
|
top: 293px;
|
||||||
|
position: fixed;
|
||||||
|
height: 127px;
|
||||||
|
width: 32px;
|
||||||
|
background: #FF613A;
|
||||||
|
border-radius: 0 10px 10px 0;
|
||||||
|
z-index: 101;
|
||||||
|
transition: 200ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container_content_handler_curtain_left{
|
||||||
|
display: flex;
|
||||||
|
rotate: 90deg;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 32px;
|
||||||
|
width: 87px;
|
||||||
|
position: relative;
|
||||||
|
left: -49px;
|
||||||
|
top: 47px;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.handler_curtain_left.open{
|
||||||
|
left: 320px;
|
||||||
|
top: 293px;
|
||||||
|
position: fixed;
|
||||||
|
height: 127px;
|
||||||
|
width: 32px;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 0 10px 10px 0;
|
||||||
|
z-index: 101;
|
||||||
|
transition: 200ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.handler_curtain_left.open .container_content_handler_curtain_left{
|
||||||
|
rotate: 270deg;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cards_item_1,
|
||||||
|
.cards_item_2,
|
||||||
|
.cards_item_3,
|
||||||
|
.cards_item_4{
|
||||||
|
height: 322px;
|
||||||
|
width: 65%;
|
||||||
|
float: unset;
|
||||||
|
margin: 15px auto;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter_img{
|
||||||
|
width: 15px;
|
||||||
|
display: block;
|
||||||
|
position: relative;
|
||||||
|
bottom: 0;
|
||||||
|
transform: rotate(270deg) translate(0, 0);
|
||||||
|
filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(296deg) brightness(106%) contrast(101%);
|
||||||
|
/*transition: 200ms;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.handler_curtain_left.open .filter_img{
|
||||||
|
transform: translate(0, 0);
|
||||||
|
filter: brightness(0) saturate(100%) invert(53%) sepia(48%) saturate(4340%) hue-rotate(337deg) brightness(102%) contrast(102%);
|
||||||
|
/*transition: 200ms;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrows_handler_curtain_left{
|
||||||
|
width: 7px;
|
||||||
|
rotate: -90deg;
|
||||||
|
filter: unset;
|
||||||
|
/*transition: 200ms;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.handler_curtain_left.open .arrows_handler_curtain_left{
|
||||||
|
filter: brightness(0) saturate(100%) invert(53%) sepia(48%) saturate(4340%) hue-rotate(337deg) brightness(102%) contrast(102%);
|
||||||
|
transition: 200ms;
|
||||||
|
}
|
||||||
.wrapper_name_art{
|
.wrapper_name_art{
|
||||||
font-size: 29px;
|
font-size: 29px;
|
||||||
line-height: 33px;
|
line-height: 33px;
|
||||||
}
|
}
|
||||||
|
.header_buttons{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.confirm_profile_btn{
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
.not_found_routes>img{
|
.not_found_routes>img{
|
||||||
display: none;
|
display: none;
|
||||||
@@ -283,8 +383,9 @@
|
|||||||
}
|
}
|
||||||
.button_profile_header_mobile{
|
.button_profile_header_mobile{
|
||||||
display: inline-block ;
|
display: inline-block ;
|
||||||
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
.header-first>div {
|
.header_logo_mobile {
|
||||||
margin-right: 37px;
|
margin-right: 37px;
|
||||||
}
|
}
|
||||||
.line_f_header{
|
.line_f_header{
|
||||||
@@ -335,10 +436,11 @@
|
|||||||
margin-top: unset;
|
margin-top: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
button#more_button{
|
#more_button, #send_parcel_button{
|
||||||
width: 50%;
|
width: 50%;
|
||||||
/*margin-top: 40px;*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#title_static{
|
#title_static{
|
||||||
font-size: 33px;
|
font-size: 33px;
|
||||||
line-height: 42px;
|
line-height: 42px;
|
||||||
@@ -474,7 +576,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#request_btn{
|
#request_btn{
|
||||||
width: 109%;
|
width: 103%;
|
||||||
|
}
|
||||||
|
.bottom_block_static>form>.button_register{
|
||||||
|
padding: 10px 0;
|
||||||
|
width: 97%;
|
||||||
|
margin: unset;
|
||||||
}
|
}
|
||||||
/*END logi_page*/
|
/*END logi_page*/
|
||||||
|
|
||||||
@@ -489,6 +596,7 @@
|
|||||||
section.register>form{
|
section.register>form{
|
||||||
display: block;
|
display: block;
|
||||||
width: unset;
|
width: unset;
|
||||||
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputs{
|
.inputs{
|
||||||
@@ -585,13 +693,14 @@
|
|||||||
width: unset;
|
width: unset;
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
.bottom_block_static>form>.button_register{
|
.bottom_block_static>.form_wrapper>form>.button_register{
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
width: 92%;
|
width: 92%;
|
||||||
padding: unset;
|
padding: unset;
|
||||||
}
|
}
|
||||||
#scroll_to_div>form>.button_register{
|
#scroll_to_div>form>.button_register{
|
||||||
width: 92%;
|
width: 97%;
|
||||||
|
margin: unset;
|
||||||
}
|
}
|
||||||
span#sub_title_static{
|
span#sub_title_static{
|
||||||
/*margin: unset;*/
|
/*margin: unset;*/
|
||||||
@@ -633,7 +742,7 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
.cut_width_f_curtain.n_profile.left{
|
.cut_width_f_curtain.n_profile.left{
|
||||||
position: fixed;
|
position: sticky;
|
||||||
/*min-width: 1280px;*/
|
/*min-width: 1280px;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,10 +970,10 @@
|
|||||||
|
|
||||||
|
|
||||||
.left-part-block-enter-message{
|
.left-part-block-enter-message{
|
||||||
width: 70%;
|
width: calc(70% - 74px);
|
||||||
}
|
}
|
||||||
.right-part-block-enter-message{
|
.right-part-block-enter-message{
|
||||||
width: 30%;
|
width: 74px;
|
||||||
}
|
}
|
||||||
.container-message_support_chat{
|
.container-message_support_chat{
|
||||||
width: 70%;
|
width: 70%;
|
||||||
@@ -906,28 +1015,32 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.inputs_l>input{
|
.inputs_l>input{
|
||||||
width: calc(100% - 10px);
|
width: calc(100% - 15px);
|
||||||
}
|
}
|
||||||
.inputs_l{
|
.inputs_l{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.counter-box>textarea{
|
.counter-box>textarea{
|
||||||
width: calc(100% - 10px);
|
width: calc(100% - 15px);
|
||||||
max-width: unset;
|
max-width: unset;
|
||||||
min-width: unset;
|
min-width: unset;
|
||||||
}
|
}
|
||||||
button#send_feedback_form{
|
button#send_feedback_form{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
button#send_feedback_form:active{
|
||||||
|
box-shadow:unset;
|
||||||
|
background: rgba(255, 97, 58, 0.60);
|
||||||
|
}
|
||||||
/* END feedback_form*/
|
/* END feedback_form*/
|
||||||
|
|
||||||
/* news_page*/
|
/* news_page*/
|
||||||
.wrapper_advertisement{
|
.wrapper_advertisement{
|
||||||
padding: unset;
|
padding: unset;
|
||||||
}
|
}
|
||||||
.advertisement_block_news{
|
/*.advertisement_block_news{*/
|
||||||
height: 80px;
|
/* height: 80px;*/
|
||||||
}
|
/*}*/
|
||||||
.three_pinned_news{
|
.three_pinned_news{
|
||||||
margin: unset;
|
margin: unset;
|
||||||
}
|
}
|
||||||
@@ -1020,7 +1133,7 @@
|
|||||||
.cargo_type_trans{
|
.cargo_type_trans{
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
float: unset;
|
/*float: unset;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.from-to-country-container-carrier{
|
.from-to-country-container-carrier{
|
||||||
@@ -1348,7 +1461,9 @@
|
|||||||
.header_logo, .header_btn_mover{
|
.header_logo, .header_btn_mover{
|
||||||
margin-right: 26px;
|
margin-right: 26px;
|
||||||
}
|
}
|
||||||
|
.cookie_block{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.menu_buttons.curtain.left.close.chat{
|
.menu_buttons.curtain.left.close.chat{
|
||||||
width: 265px;
|
width: 265px;
|
||||||
}
|
}
|
||||||
@@ -1390,11 +1505,69 @@
|
|||||||
width: 490px;
|
width: 490px;
|
||||||
margin: 0 auto 30px;
|
margin: 0 auto 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.news_item_pagination{
|
||||||
|
width: 490px;
|
||||||
|
}
|
||||||
|
.pag_news_img{
|
||||||
|
width: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.news_item_pagination.odd .pag_news_img, .news_item_pagination.odd .pag_news_item_text{
|
||||||
|
float: unset;
|
||||||
|
|
||||||
|
}
|
||||||
|
.news_item_pagination.even .pag_news_img, .news_item_pagination.even .pag_news_item_text{
|
||||||
|
float: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_news_item_text{
|
||||||
|
width: unset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@media (max-width: 850px){
|
@media (max-width: 850px){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.cards_item_1,
|
||||||
|
.cards_item_2,
|
||||||
|
.cards_item_3,
|
||||||
|
.cards_item_4{
|
||||||
|
width: 70%;
|
||||||
|
height: unset;
|
||||||
|
float: unset;
|
||||||
|
margin: 15px auto;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.cards_item_img, .cards_item_text{
|
||||||
|
float: unset;
|
||||||
|
width: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cards_item_1>.cards_item_img>img,
|
||||||
|
.cards_item_2>.cards_item_img>img,
|
||||||
|
.cards_item_3>.cards_item_img>img,
|
||||||
|
.cards_item_4>.cards_item_img>img{
|
||||||
|
float: unset;
|
||||||
|
aspect-ratio: 4/3;
|
||||||
|
object-fit: cover;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.cards_item_text{
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card_title_1{
|
||||||
|
margin: 25px 0 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.read_more_about_subscribe{
|
.read_more_about_subscribe{
|
||||||
padding: 0 14px;
|
padding: 0 14px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
@@ -1461,6 +1634,25 @@
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
.marker_messages_mobile{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
border-radius: 100%;
|
||||||
|
background: #ff0000;
|
||||||
|
height: 14px;
|
||||||
|
width: 15px;
|
||||||
|
}
|
||||||
|
.marker_messages_mobile.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.marker_messages_mobile.show{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 828px){
|
@media (max-width: 828px){
|
||||||
/*.to_address_point_txt.find_route {*/
|
/*.to_address_point_txt.find_route {*/
|
||||||
/*width: 54.6%;*/
|
/*width: 54.6%;*/
|
||||||
@@ -1521,6 +1713,17 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
@media (max-width: 699px){
|
@media (max-width: 699px){
|
||||||
|
|
||||||
|
.block-chat.support {
|
||||||
|
/*height: calc(100vh - 190px);*/
|
||||||
|
/*1. 100svh 2. 45px - header 3. name_ticket 4. just padding */
|
||||||
|
height: calc(100svh - 45px - 40px - 50px);
|
||||||
|
}
|
||||||
|
.block-chat{
|
||||||
|
/*height: calc(88vh - 50px);*/
|
||||||
|
/*1. 100svh 2. 45px - header 3. just padding */
|
||||||
|
height: calc(100svh - 45px - 50px);
|
||||||
|
}
|
||||||
.block_overlay.show{
|
.block_overlay.show{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -1563,6 +1766,28 @@
|
|||||||
background: #FFF;
|
background: #FFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu_buttons.right.open .menu_profile{
|
||||||
|
padding-top: unset;
|
||||||
|
}
|
||||||
|
.menu_profile>div{
|
||||||
|
height: 30px;
|
||||||
|
margin-top: 3px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
#customer>.text_btn_profile, #mover>.text_btn_profile{
|
||||||
|
top: 8px;
|
||||||
|
}
|
||||||
|
/*.text_btn_profile{*/
|
||||||
|
/* top: 14px;*/
|
||||||
|
/*}*/
|
||||||
|
.menu_profile > .subscribe_type_txt{
|
||||||
|
margin-bottom: 12px;
|
||||||
|
padding-top: 12px;
|
||||||
|
}
|
||||||
|
.menu_profile>div>img.svg{
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.info_profile{
|
.info_profile{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -1621,10 +1846,16 @@
|
|||||||
}
|
}
|
||||||
@media (max-width: 575px){
|
@media (max-width: 575px){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.phones_carrier{
|
.phones_carrier{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.news_item_pagination{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.previous_next_news>.news_item_static{
|
.previous_next_news>.news_item_static{
|
||||||
margin: unset;
|
margin: unset;
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
@@ -1672,24 +1903,47 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
button#more_button{
|
#more_button{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#send_parcel_button{
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.news_block_main{
|
.news_block_main{
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cards_item_1,
|
/*.cards_item_1,*/
|
||||||
.cards_item_2,
|
/*.cards_item_2,*/
|
||||||
.cards_item_3,
|
/*.cards_item_3,*/
|
||||||
.cards_item_4
|
/*.cards_item_4*/
|
||||||
{
|
/*{*/
|
||||||
width: 100%;
|
/* width: 100%;*/
|
||||||
height: 180px;
|
/* height: 180px;*/
|
||||||
background-size:60%;
|
/* background-size:60%;*/
|
||||||
|
/*}*/
|
||||||
|
.card_title_1{
|
||||||
|
font-size: 34px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 42px;
|
||||||
|
}
|
||||||
|
.card_title_2{
|
||||||
|
font-size: 18px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 26px;
|
||||||
|
}
|
||||||
|
.card_title_3{
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cards_wrapper{
|
.cards_wrapper{
|
||||||
@@ -1754,9 +2008,7 @@
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header_buttons{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
/*.to_address_point_txt.find_route {*/
|
/*.to_address_point_txt.find_route {*/
|
||||||
/* width: 48.4%;*/
|
/* width: 48.4%;*/
|
||||||
/*}*/
|
/*}*/
|
||||||
@@ -1767,7 +2019,7 @@
|
|||||||
|
|
||||||
|
|
||||||
.container_inp_w_abr {
|
.container_inp_w_abr {
|
||||||
width: 99%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.another_subscribe{
|
.another_subscribe{
|
||||||
@@ -1781,6 +2033,10 @@
|
|||||||
|
|
||||||
@media (max-width: 440px){
|
@media (max-width: 440px){
|
||||||
|
|
||||||
|
.card_title_3{
|
||||||
|
margin: 20px 5px 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.f-r{
|
.f-r{
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
@@ -1848,6 +2104,13 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
@media (max-width: 360px){
|
@media (max-width: 360px){
|
||||||
|
|
||||||
|
#customer>.text_btn_profile, #mover>.text_btn_profile{
|
||||||
|
width: 53%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.loader_chat_f_sw_chats.show {
|
.loader_chat_f_sw_chats.show {
|
||||||
display: block;
|
display: block;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
@@ -1856,6 +2119,76 @@
|
|||||||
top: 35%;
|
top: 35%;
|
||||||
left: 34%;
|
left: 34%;
|
||||||
}
|
}
|
||||||
|
.menu_buttons.left.open.filters {
|
||||||
|
width: calc(100vw - 35px);
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 10px;
|
||||||
|
height: 100vh;
|
||||||
|
left: 19px;
|
||||||
|
padding: 13px;
|
||||||
|
/* position: fixed; */
|
||||||
|
float: left;
|
||||||
|
text-align: left;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
transition: 0ms;
|
||||||
|
scrollbar-width: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.menu_buttons.right.open {
|
||||||
|
right: 0;
|
||||||
|
transition: 200ms;
|
||||||
|
position: fixed;
|
||||||
|
display: block;
|
||||||
|
padding-top: 10px;
|
||||||
|
top: 35px;
|
||||||
|
background: #ffffff;
|
||||||
|
width: calc(100vw - 35px);
|
||||||
|
}
|
||||||
|
.menu_profile>div {
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
.menu_buttons.close .btns_f_curtain {
|
||||||
|
transition: 200ms;
|
||||||
|
transform: rotate(270deg);
|
||||||
|
filter: brightness(0) saturate(100%) invert(100%) sepia(2%) saturate(0%) hue-rotate(162deg) brightness(104%) contrast(103%);
|
||||||
|
/* padding-right: 2px; */
|
||||||
|
padding-right: 0;
|
||||||
|
bottom: -2px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.menu_buttons.left.open {
|
||||||
|
left: 0;
|
||||||
|
transition: 200ms;
|
||||||
|
position: fixed;
|
||||||
|
float: unset;
|
||||||
|
padding-top: 10px;
|
||||||
|
height: 100vh;
|
||||||
|
max-height: 100vh;
|
||||||
|
width: calc(100vw - 35px);
|
||||||
|
}
|
||||||
|
.menu_buttons.left.open.first.filters .btns_f_curtain {
|
||||||
|
transition: 200ms;
|
||||||
|
transform: rotate(270deg);
|
||||||
|
filter: brightness(0) saturate(100%) invert(100%) sepia(2%) saturate(0%) hue-rotate(162deg) brightness(104%) contrast(103%);
|
||||||
|
padding-left: 10px;
|
||||||
|
position: relative;
|
||||||
|
top: 7px;
|
||||||
|
}
|
||||||
|
.menu_profile {
|
||||||
|
width: 100%;
|
||||||
|
text-align: -webkit-center;
|
||||||
|
}
|
||||||
|
.menu_buttons.right.open .handler_menu {
|
||||||
|
background: #FFFFFF;
|
||||||
|
color: #000000;
|
||||||
|
right: calc(100vw - 83px);
|
||||||
|
}
|
||||||
|
.menu_buttons.left.open .handler_menu {
|
||||||
|
background: #FFFFFF;
|
||||||
|
color: #000000;
|
||||||
|
left: calc(100vw - 83px);
|
||||||
|
}
|
||||||
.tab-btn-1{
|
.tab-btn-1{
|
||||||
padding: unset;
|
padding: unset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,8 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
/*background: rgba(39, 53, 62, 0.7);*/
|
/*background: rgba(39, 53, 62, 0.7);*/
|
||||||
backdrop-filter: blur(6px);
|
backdrop-filter: blur(6px);
|
||||||
|
-webkit-backdrop-filter: blur(6px);
|
||||||
|
-moz-backdrop-filter: blur(6px);
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -221,6 +223,7 @@
|
|||||||
-webkit-background-clip: text;
|
-webkit-background-clip: text;
|
||||||
-webkit-text-fill-color: transparent;
|
-webkit-text-fill-color: transparent;
|
||||||
float: left;
|
float: left;
|
||||||
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-sprt-inf{
|
.message-sprt-inf{
|
||||||
@@ -447,6 +450,7 @@
|
|||||||
box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20);
|
box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20);
|
||||||
float: right;
|
float: right;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.block_loader_chat{
|
.block_loader_chat{
|
||||||
@@ -481,7 +485,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bottom_part_of_chats{
|
.bottom_part_of_chats{
|
||||||
height: calc(100% - 39px);
|
height: 100%;
|
||||||
|
padding-bottom: 39px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,6 +497,8 @@
|
|||||||
width: calc(100% - 40px);
|
width: calc(100% - 40px);
|
||||||
height: 60px;
|
height: 60px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-chat-left-part{
|
.header-chat-left-part{
|
||||||
@@ -535,14 +542,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.container-messages{
|
.container-messages{
|
||||||
height: calc(100% - 175px);
|
height: calc(100% - 224px);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* transform: rotate(180deg); */
|
/* transform: rotate(180deg); */
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
/* transform: scaleY(-1); */
|
/* transform: scaleY(-1); */
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
padding-top: 70px;
|
padding-bottom: 63px;
|
||||||
|
margin-top: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -559,7 +567,7 @@
|
|||||||
border: 1px solid #E6E6E6;
|
border: 1px solid #E6E6E6;
|
||||||
padding: 0 20px 0 20px;
|
padding: 0 20px 0 20px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 43px;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-chat.hide{
|
.footer-chat.hide{
|
||||||
@@ -567,12 +575,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.left-part-block-enter-message{
|
.left-part-block-enter-message{
|
||||||
width: 80%;
|
width: calc(80% - 74px);
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-part-block-enter-message{
|
.right-part-block-enter-message{
|
||||||
width: 20%;
|
width: 74px;
|
||||||
float: right;
|
float: right;
|
||||||
padding-top: 11px;
|
padding-top: 11px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
@@ -1025,7 +1033,7 @@
|
|||||||
|
|
||||||
.from_address_point_txt.find_route.first.w_100{
|
.from_address_point_txt.find_route.first.w_100{
|
||||||
width: calc(100% - 35px);
|
width: calc(100% - 35px);
|
||||||
border-right: 1px solid #E6E6E6;
|
border-right: 2px solid #E6E6E6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.from_address_point_txt.post_route.first.w_100{
|
.from_address_point_txt.post_route.first.w_100{
|
||||||
@@ -1071,15 +1079,20 @@
|
|||||||
|
|
||||||
|
|
||||||
.input_list.find_route{
|
.input_list.find_route{
|
||||||
width: 100%;
|
width: 90%;
|
||||||
/* display: block; */
|
/*display: block;*/
|
||||||
border-radius: 0 10px;
|
border-radius: 0 0 10px 10px;
|
||||||
top: 61px;
|
top: 62px;
|
||||||
z-index: 12;
|
left: 9px;
|
||||||
|
z-index: 10000;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input_list.find_route.show{
|
.input_list.find_route.show{
|
||||||
display: block;
|
display: block;
|
||||||
|
border: 2px solid #E6E6E6;
|
||||||
|
border-top: hidden;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.container_inp_w_abr{
|
.container_inp_w_abr{
|
||||||
@@ -1199,9 +1212,9 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cont-el-form-search-carrier.last > label{
|
/*.cont-el-form-search-carrier.last > label{*/
|
||||||
opacity: 0;
|
/* opacity: 0;*/
|
||||||
}
|
/*}*/
|
||||||
|
|
||||||
|
|
||||||
.block-filters-find-route {
|
.block-filters-find-route {
|
||||||
@@ -1230,8 +1243,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.not_found_routes{
|
.not_found_routes{
|
||||||
width: 98%;
|
width: 96%;
|
||||||
height: 250px;
|
min-height: 250px;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20);
|
box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20);
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -1484,6 +1497,17 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.open_inf_carrier{
|
||||||
|
display: block;
|
||||||
|
width: 88%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.show_contact_wrapper {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.open_inf_carrier:hover{
|
.open_inf_carrier:hover{
|
||||||
background: #FF613A;
|
background: #FF613A;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
@@ -1534,7 +1558,13 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: #272424;
|
color: #272424;
|
||||||
padding-bottom: 10px;
|
|
||||||
|
margin-bottom: 10px;
|
||||||
|
/*border: 2px solid #FF613A;*/
|
||||||
|
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 7px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name_carrier{
|
.name_carrier{
|
||||||
@@ -2101,7 +2131,7 @@
|
|||||||
|
|
||||||
.button_profile_header{
|
.button_profile_header{
|
||||||
height: 50px;
|
height: 50px;
|
||||||
width: 150px;
|
width: 155px;
|
||||||
background: #FF613A;
|
background: #FF613A;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
/* Heading 5 */
|
/* Heading 5 */
|
||||||
@@ -2241,6 +2271,10 @@
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input_f_profile.grey{
|
||||||
|
background: #F8F8F8;
|
||||||
|
}
|
||||||
|
|
||||||
.status_f_profile{
|
.status_f_profile{
|
||||||
width: calc(100% - 120px);
|
width: calc(100% - 120px);
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
@@ -2329,11 +2363,11 @@
|
|||||||
/*p_main news*/
|
/*p_main news*/
|
||||||
|
|
||||||
.news_description{
|
.news_description{
|
||||||
/*background: linear-gradient(45deg, #040404 33%, #c5c5c5 66%, #ffffff);*/
|
|
||||||
/*-webkit-background-clip: text;*/
|
|
||||||
/*-webkit-text-fill-color: transparent;*/
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
background: linear-gradient(180deg, #040404 46%, #ffffff 72%, #ffffff);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu_buttons.right.close{
|
.menu_buttons.right.close{
|
||||||
@@ -2389,6 +2423,27 @@
|
|||||||
height: 695px;
|
height: 695px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu_buttons.left::-webkit-scrollbar-track{
|
||||||
|
background-color: #F6F6F6;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu_buttons.left::-webkit-scrollbar-thumb{
|
||||||
|
background-color: #989898;
|
||||||
|
border-radius: 3px;
|
||||||
|
width: 3px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu_buttons.left::-webkit-scrollbar{
|
||||||
|
background-color:#FF613A;
|
||||||
|
width: 4px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.menu_buttons{
|
.menu_buttons{
|
||||||
/*background: #FFFFFF;*/
|
/*background: #FFFFFF;*/
|
||||||
/*height: 100vh;*/
|
/*height: 100vh;*/
|
||||||
@@ -2523,6 +2578,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 293px;
|
top: 293px;
|
||||||
transition: 0ms;
|
transition: 0ms;
|
||||||
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2629,7 +2685,7 @@
|
|||||||
|
|
||||||
.menu_buttons.left.open.first.filters .text_f_curtain > img{
|
.menu_buttons.left.open.first.filters .text_f_curtain > img{
|
||||||
transition: 200ms;
|
transition: 200ms;
|
||||||
transform: rotate(270deg);
|
transform: rotate(270deg) translate(0, 0);
|
||||||
filter: brightness(0) saturate(100%) invert(100%) sepia(2%) saturate(0%) hue-rotate(162deg) brightness(104%) contrast(103%);
|
filter: brightness(0) saturate(100%) invert(100%) sepia(2%) saturate(0%) hue-rotate(162deg) brightness(104%) contrast(103%);
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@@ -2647,6 +2703,7 @@
|
|||||||
height: calc(100vh - 95px);
|
height: calc(100vh - 95px);
|
||||||
max-height: 697px;
|
max-height: 697px;
|
||||||
background: #F8F8F8;
|
background: #F8F8F8;
|
||||||
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu_profile.background{
|
.menu_profile.background{
|
||||||
@@ -2744,6 +2801,9 @@
|
|||||||
.container_descript_one_news{
|
.container_descript_one_news{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
|
background: linear-gradient(180deg, #040404 46%, #ffffff 72%, #ffffff);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container_name_one_news{
|
.container_name_one_news{
|
||||||
@@ -2839,9 +2899,70 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text_in_btn_a_anchor{
|
.text_in_btn_a_anchor{
|
||||||
padding-top: 20px;
|
padding-top: 17px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.anchor{
|
.anchor{
|
||||||
scroll-margin-top: 60px;
|
scroll-margin-top: 60px;
|
||||||
|
}
|
||||||
|
.anchor.about_service{
|
||||||
|
scroll-margin-top: 150px;
|
||||||
|
}
|
||||||
|
/*login page*/
|
||||||
|
.error_f_login{
|
||||||
|
color: #f00;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*b_profile_first_page*/
|
||||||
|
|
||||||
|
.title_b_first_page{
|
||||||
|
margin-top: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* handler_curtain changed*/
|
||||||
|
|
||||||
|
.handler_curtain_left{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*cookie*/
|
||||||
|
|
||||||
|
.cookie_block{
|
||||||
|
background: #000000;
|
||||||
|
width: 951px;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 5px;
|
||||||
|
z-index: 100000000000000;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cookie_block.show{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.txt_cookie{
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.a_cookie{
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container_content_cookie_block{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cookie_btn{
|
||||||
|
background: none;
|
||||||
|
border: 2px solid white;
|
||||||
|
color: #FFFFFF;
|
||||||
|
height: 25px;
|
||||||
|
width: 95px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@@ -23,24 +23,28 @@
|
|||||||
src: url("/static/fonts/inter/Inter-Regular.ttf") format('truetype');
|
src: url("/static/fonts/inter/Inter-Regular.ttf") format('truetype');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@font-face{
|
@font-face{
|
||||||
font-family: 'Inter';
|
font-family: 'Inter';
|
||||||
src: url("/static/fonts/inter/Inter-Medium.ttf") format('truetype') ;
|
src: url("/static/fonts/inter/Inter-Medium.ttf") format('truetype') ;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@font-face{
|
@font-face{
|
||||||
font-family: 'Inter';
|
font-family: 'Inter';
|
||||||
src: url("/static/fonts/inter/Inter-SemiBold.ttf") format('truetype') ;
|
src: url("/static/fonts/inter/Inter-SemiBold.ttf") format('truetype') ;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@font-face{
|
@font-face{
|
||||||
font-family: 'Inter';
|
font-family: 'Inter';
|
||||||
src: url("/static/fonts/inter/Inter-Bold.ttf") format('truetype') ;
|
src: url("/static/fonts/inter/Inter-Bold.ttf") format('truetype') ;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Links */
|
/* Links */
|
||||||
@@ -136,8 +140,15 @@ legend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
html, body{
|
html, body{
|
||||||
height: 100%;
|
/*height: 100%;*/
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
|
/*boris changed height*/
|
||||||
|
height: 100vh;
|
||||||
|
height: -webkit-fill-available;
|
||||||
|
height: fill-available;
|
||||||
|
max-height: fill-available;
|
||||||
|
max-height: -webkit-fill-available;
|
||||||
|
/* end*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper_content {
|
.wrapper_content {
|
||||||
@@ -145,6 +156,7 @@ html, body{
|
|||||||
max-width: 1280px;
|
max-width: 1280px;
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 695px;
|
min-height: 695px;
|
||||||
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper_content.m_h_0{
|
.wrapper_content.m_h_0{
|
||||||
@@ -222,6 +234,8 @@ body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background: #F8F8F8;
|
background: #F8F8F8;
|
||||||
|
/*mix-blend-mode: multiply;*/
|
||||||
|
/*пока убрал надо чтобы fire протестил на iphone*/
|
||||||
}
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
@@ -257,11 +271,15 @@ section.register>h1 {
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
.footer_input_wrap.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
.footer_input_wrap {
|
.footer_input_wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
color: #FF613A;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.footer_input::placeholder {
|
.footer_input::placeholder {
|
||||||
color: rgba(39, 36, 36, 0.60);
|
color: rgba(39, 36, 36, 0.60);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
@@ -458,6 +476,9 @@ footer>div {
|
|||||||
.fifth-column-first {
|
.fifth-column-first {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
.wrapper_footer_form{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
#footer_input_button {
|
#footer_input_button {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -533,6 +554,21 @@ header .header-first {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
#changes_saved_txt{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#changes_saved_txt.show{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
#save_changes_txt.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#mover_title_color{
|
||||||
|
background: #e0bff0;
|
||||||
|
}
|
||||||
|
#customer_title_color{
|
||||||
|
background: #f5d813;
|
||||||
|
}
|
||||||
|
|
||||||
.dropdown {
|
.dropdown {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -553,6 +589,7 @@ header .header-first {
|
|||||||
height: 390px;
|
height: 390px;
|
||||||
box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);
|
box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
top: 30px;
|
||||||
}
|
}
|
||||||
.dropdown-content.show{
|
.dropdown-content.show{
|
||||||
display:block;
|
display:block;
|
||||||
@@ -631,8 +668,26 @@ header .header-second {
|
|||||||
|
|
||||||
.button_profile_header_mobile{
|
.button_profile_header_mobile{
|
||||||
display: none;
|
display: none;
|
||||||
|
cursor: pointer;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.route_contact_avatar{
|
||||||
|
object-fit: cover;
|
||||||
|
height: 40px;
|
||||||
|
width: 40px;
|
||||||
|
border-radius: 10px;
|
||||||
|
aspect-ratio: 4/3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.from_address_point_txt.red_text{
|
||||||
|
color: #ff0000;
|
||||||
|
}
|
||||||
|
.to_address_point_txt.red_text{
|
||||||
|
color: #ff0000;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.header-second-item,
|
.header-second-item,
|
||||||
.cont_header_btn_profile,
|
.cont_header_btn_profile,
|
||||||
@@ -667,8 +722,9 @@ span.btn_profile_name {
|
|||||||
/*Language select*/
|
/*Language select*/
|
||||||
|
|
||||||
.dropbtn_lang {
|
.dropbtn_lang {
|
||||||
padding: 7px 0 7px 0;
|
padding: 8px 6.5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
border-radius: 23px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The container <div> - needed to position the dropdown content */
|
/* The container <div> - needed to position the dropdown content */
|
||||||
@@ -687,9 +743,9 @@ span.btn_profile_name {
|
|||||||
|
|
||||||
.dropbtn_lang
|
.dropbtn_lang
|
||||||
{
|
{
|
||||||
background: url('/static/img/png/ru.png') no-repeat left center;
|
/*background: url('/static/img/svg/ru.svg') no-repeat left center;*/
|
||||||
padding-left: 25px;
|
/*padding-left: 25px;*/
|
||||||
width: 40px;
|
/*width: 40px;*/
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -705,16 +761,19 @@ span.btn_profile_name {
|
|||||||
|
|
||||||
#ru_lang
|
#ru_lang
|
||||||
{
|
{
|
||||||
background: url('/static/img/png/ru.png') no-repeat left center;
|
background: url('/static/img/svg/ru.svg') no-repeat center;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
padding: 10px;
|
padding: 6px;
|
||||||
|
margin: 5px 0;
|
||||||
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#en_lang
|
#en_lang
|
||||||
{
|
{
|
||||||
background: url('/static/img/png/en.png') no-repeat left center;
|
background: url('/static/img/svg/gb.svg') no-repeat center;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
padding: 10px;
|
padding: 6px;
|
||||||
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Links inside the dropdown */
|
/* Links inside the dropdown */
|
||||||
@@ -729,6 +788,20 @@ span.btn_profile_name {
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#create_route{
|
||||||
|
border-radius: 10px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
background: #FF613A;
|
||||||
|
/*height: 60px;*/
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 500;
|
||||||
|
width: 80%;
|
||||||
|
margin-top: 10px;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
padding: 15px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Change color of dropdown links on hover */
|
/* Change color of dropdown links on hover */
|
||||||
.dropdown-content-lang a:hover {background-color: #f1f1f1}
|
.dropdown-content-lang a:hover {background-color: #f1f1f1}
|
||||||
|
|
||||||
@@ -739,8 +812,9 @@ span.btn_profile_name {
|
|||||||
/*END Language select*/
|
/*END Language select*/
|
||||||
|
|
||||||
|
|
||||||
.header-second>div>img{
|
#support_img{
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
margin-left: 40px;
|
||||||
}
|
}
|
||||||
#customer_service{
|
#customer_service{
|
||||||
margin-right: 35px;
|
margin-right: 35px;
|
||||||
@@ -817,13 +891,15 @@ section.register>form {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.agree {
|
.agree {
|
||||||
display: flex;
|
/*display: flex;*/
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
align-items: end;
|
align-items: end;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agree>.checkbox{
|
.agree>.checkbox{
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agree_text {
|
.agree_text {
|
||||||
@@ -833,6 +909,8 @@ section.register>form {
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
display: inline-block;
|
||||||
|
width: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button_register>button {
|
.button_register>button {
|
||||||
@@ -1047,7 +1125,7 @@ section.login>form {
|
|||||||
|
|
||||||
.inputs_l {
|
.inputs_l {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60px;
|
/*height: 60px;*/
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1324,6 +1402,13 @@ h2.title_new_route{
|
|||||||
|
|
||||||
.prof_second_line>a {
|
.prof_second_line>a {
|
||||||
color: #FF613A;
|
color: #FF613A;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
#id_email{
|
||||||
|
cursor: unset;
|
||||||
|
}
|
||||||
|
#error_arrival_DT.hide, #error_departure_DT.hide{
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prof_third_line>a {
|
.prof_third_line>a {
|
||||||
@@ -1366,14 +1451,14 @@ h2.title_new_route{
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.errorlist{
|
.errorlist{
|
||||||
position: absolute;
|
/*position: absolute;*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.errorlist>li{
|
.errorlist>li{
|
||||||
color:red;
|
color:red;
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
font-size: 14px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
span.errorlist{
|
span.errorlist{
|
||||||
color: red;
|
color: red;
|
||||||
@@ -1387,6 +1472,7 @@ span.errorlist{
|
|||||||
|
|
||||||
/*create new route*/
|
/*create new route*/
|
||||||
select#id_type_transport{
|
select#id_type_transport{
|
||||||
|
cursor: pointer;
|
||||||
display: block;
|
display: block;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
width: 47%;
|
width: 47%;
|
||||||
@@ -1580,6 +1666,10 @@ div.departure_arrival>div>input{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#hide_owner_type{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*end create new route*/
|
/*end create new route*/
|
||||||
@@ -1645,12 +1735,32 @@ div.departure_arrival>div>input{
|
|||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: #F8F8F8;
|
background-color: #FFFFFF;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
overflow-x:hidden;
|
overflow-x:hidden;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*.input_list::-webkit-scrollbar {*/
|
||||||
|
/* width: 5px;*/
|
||||||
|
/* height: 20px;*/
|
||||||
|
/* background-color: #FF613A;*/
|
||||||
|
|
||||||
|
/*}*/
|
||||||
|
|
||||||
|
|
||||||
|
.input_list::-webkit-scrollbar {
|
||||||
|
width: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.input_list::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #FF613A;
|
||||||
|
border-radius: 20px;
|
||||||
|
border: 3px solid white;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.input_list.post_route{
|
.input_list.post_route{
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
max-width: 390px;
|
max-width: 390px;
|
||||||
@@ -1666,6 +1776,12 @@ div.departure_arrival>div>input{
|
|||||||
.input_list .hide{
|
.input_list .hide{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
span.hide, .error_to_address_point.hide, #id_cargo_lable.hide, #error_id_phone.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#agreement_check.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1874,13 +1990,89 @@ button#edit_route {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
button#remove_route {
|
.remove_route {
|
||||||
height: 44px;
|
height: 44px;
|
||||||
width: 285px;
|
width: 285px;
|
||||||
color: rgba(39, 36, 36, 0.60);
|
color: rgba(39, 36, 36, 0.60);
|
||||||
}
|
}
|
||||||
|
.remove_route.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.msg_send{
|
||||||
|
font-size: 24px;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 700;
|
||||||
|
background: #F8F8F8;
|
||||||
|
z-index: 1;
|
||||||
|
position: absolute;
|
||||||
|
height: -webkit-fill-available;
|
||||||
|
width: -webkit-fill-available;
|
||||||
|
width: -moz-available;
|
||||||
|
}
|
||||||
|
|
||||||
|
#error_footer{
|
||||||
|
color: #ff0000;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_news_img>img{
|
||||||
|
object-fit: cover;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 10px;
|
||||||
|
aspect-ratio: 4 / 3;
|
||||||
|
max-height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#error_footer.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg_sub_text{
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
background: #FF613A;
|
||||||
|
color: #FFF;
|
||||||
|
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12);
|
||||||
|
line-height: 34px;
|
||||||
|
width: 100px;
|
||||||
|
border-radius: 10px;
|
||||||
|
text-align: center;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close_msg_block{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#error_com_offer, #error_feedback, #error_feedback_text{
|
||||||
|
color: #ff0000;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg_text {
|
||||||
|
margin-top: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.msg_send.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form_wrapper{
|
||||||
|
margin-top: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form_com_wrapper{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
button.confirm_remove{
|
button.confirm_remove{
|
||||||
width: 49.5%;
|
width: 48.5%;
|
||||||
border: 1px solid #ff0000a8;
|
border: 1px solid #ff0000a8;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
color: #ff0000a8;
|
color: #ff0000a8;
|
||||||
@@ -1890,10 +2082,11 @@ button.confirm_remove{
|
|||||||
/*padding: 5px 0px 5px 0px;*/
|
/*padding: 5px 0px 5px 0px;*/
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
button.cancel_remove{
|
button.cancel_remove{
|
||||||
width: 49.5%;
|
width: 48.5%;
|
||||||
border: 1px solid #808080cc;
|
border: 1px solid #808080cc;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
color: #808080cc;
|
color: #808080cc;
|
||||||
@@ -1902,18 +2095,48 @@ button.cancel_remove{
|
|||||||
/*padding: 5px 0px 5px 0px;*/
|
/*padding: 5px 0px 5px 0px;*/
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
|
display: none;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button.cancel_remove.show, button.confirm_remove.show{
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*Static_pages*/
|
/*Static_pages*/
|
||||||
|
|
||||||
|
.not_found_wrap{
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.not_found_text{
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 52px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.not_found_title{
|
||||||
|
font-size: 60px;
|
||||||
|
}
|
||||||
|
.not_found_sub_title{
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
#title_static{
|
#title_static{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 44px;
|
font-size: 44px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
line-height: 52px;
|
line-height: 52px;
|
||||||
margin-bottom: 40px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.ta_center{
|
||||||
|
margin: 120px auto 40px;
|
||||||
}
|
}
|
||||||
#title_static_customer{
|
#title_static_customer{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -1949,9 +2172,9 @@ span#sub_title_static{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
button#more_button{
|
#more_button, #send_parcel_button{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 60px;
|
/*height: 60px;*/
|
||||||
width: 20%;
|
width: 20%;
|
||||||
background: #FF613A;
|
background: #FF613A;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
@@ -1969,6 +2192,11 @@ button#more_button{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#send_parcel_button{
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
.top_block_static{
|
.top_block_static{
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
@@ -2160,8 +2388,8 @@ figure{
|
|||||||
}
|
}
|
||||||
.bottom_block_static>form>.button_register{
|
.bottom_block_static>form>.button_register{
|
||||||
margin: auto;
|
margin: auto;
|
||||||
padding: 10px;
|
padding: 10px 0;
|
||||||
width: 30%;
|
width: 39%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom_block_static>#box1 {
|
.bottom_block_static>#box1 {
|
||||||
@@ -2173,7 +2401,7 @@ figure{
|
|||||||
|
|
||||||
.bottom_block_static>#box2 {
|
.bottom_block_static>#box2 {
|
||||||
/* Положение верхнего левого изображения */
|
/* Положение верхнего левого изображения */
|
||||||
top: 16%;
|
top: 0%;
|
||||||
left: -2%;
|
left: -2%;
|
||||||
transform: scale(-1, 1);
|
transform: scale(-1, 1);
|
||||||
|
|
||||||
@@ -2191,7 +2419,7 @@ figure{
|
|||||||
|
|
||||||
.bottom_block_static>#box4 {
|
.bottom_block_static>#box4 {
|
||||||
/* Положение верхнего правого изображения */
|
/* Положение верхнего правого изображения */
|
||||||
top: 18%;
|
top: 9%;
|
||||||
right: -1%;
|
right: -1%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2261,11 +2489,11 @@ figure{
|
|||||||
/*float: left;*/
|
/*float: left;*/
|
||||||
/*width: 45%;*/
|
/*width: 45%;*/
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 42%;
|
width: 47%;
|
||||||
padding-right: 14px;
|
padding-right: 14px;
|
||||||
}
|
}
|
||||||
.right_inputs_form{
|
.right_inputs_form{
|
||||||
/*float: right;*/
|
float: right;
|
||||||
/*width: 50%;*/
|
/*width: 50%;*/
|
||||||
width: 50%;
|
width: 50%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -2313,6 +2541,23 @@ button#send_feedback_form{
|
|||||||
width: 103%;
|
width: 103%;
|
||||||
margin-top: 13px;
|
margin-top: 13px;
|
||||||
}
|
}
|
||||||
|
button#send_feedback_form:active{
|
||||||
|
box-shadow:unset;
|
||||||
|
background: rgba(255, 97, 58, 0.60);
|
||||||
|
}
|
||||||
|
#error_feedback.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#error_feedback_text.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#error_footer.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#error_com_offer.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.subscribes_container{
|
.subscribes_container{
|
||||||
width: 80%;
|
width: 80%;
|
||||||
@@ -2447,18 +2692,40 @@ button#send_feedback_form{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cards_wrapper{
|
.cards_wrapper{
|
||||||
display: flex;
|
/*display: flex;*/
|
||||||
flex-direction: row;
|
/*flex-direction: row;*/
|
||||||
flex-wrap: wrap;
|
/*flex-wrap: wrap;*/
|
||||||
justify-content: center;
|
/*justify-content: center;*/
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.cards_item_1, .cards_item_3{
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.cards_item_2, .cards_item_4{
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.cards_item_1>.cards_item_img>img,
|
||||||
|
.cards_item_2>.cards_item_img>img,
|
||||||
|
.cards_item_3>.cards_item_img>img,
|
||||||
|
.cards_item_4>.cards_item_img>img{
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
#reg_or_text{
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cards_item_2>.cards_item_text>div, .cards_item_3>.cards_item_text>div{
|
||||||
|
color: #1d1e20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.cards_item_1{
|
.cards_item_1{
|
||||||
width: 48%;
|
|
||||||
height: 322px;
|
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background: url(/static/img/png/cards_item_1.png) #1d1e20 50%;
|
/*background: url(/static/img/png/cards_item_1.png) #1d1e20 50%;*/
|
||||||
|
background: #1d1e20 50%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: right;
|
background-position: right;
|
||||||
|
|
||||||
@@ -2467,13 +2734,7 @@ button#send_feedback_form{
|
|||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cards_item_1_left,
|
|
||||||
.cards_item_2_left,
|
|
||||||
.cards_item_3_left,
|
|
||||||
.cards_item_4_left{
|
|
||||||
width: 55%;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2488,10 +2749,9 @@ button#send_feedback_form{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cards_item_2{
|
.cards_item_2{
|
||||||
width: 48%;
|
border-radius: 10px;
|
||||||
height: 322px;
|
/*background: url(/static/img/png/cards_item_2.png) white 50%;*/
|
||||||
border-radius: 10px;
|
background: white 50%;
|
||||||
background: url(/static/img/png/cards_item_2.png) white 50%;
|
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: right;
|
background-position: right;
|
||||||
|
|
||||||
@@ -2501,13 +2761,23 @@ button#send_feedback_form{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cards_item_2>div,
|
.cards_item_text {
|
||||||
.cards_item_3>div{
|
float: left;
|
||||||
color: black;
|
width: 50%;
|
||||||
text-shadow: none;
|
|
||||||
text-shadow: 1px 1px 0px #ffffff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cards_item_img {
|
||||||
|
float: right;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*.cards_item_2>div,*/
|
||||||
|
/*.cards_item_3>div{*/
|
||||||
|
/* color: black;*/
|
||||||
|
/* text-shadow: none;*/
|
||||||
|
/* text-shadow: 1px 1px 0px #ffffff;*/
|
||||||
|
/*}*/
|
||||||
|
|
||||||
.cards_item_2_right{
|
.cards_item_2_right{
|
||||||
float: right;
|
float: right;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
@@ -2533,10 +2803,9 @@ button#send_feedback_form{
|
|||||||
|
|
||||||
|
|
||||||
.cards_item_3{
|
.cards_item_3{
|
||||||
width: 48%;
|
|
||||||
height: 322px;
|
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background: url(/static/img/png/cards_item_3.png) white 50%;
|
/*background: url(/static/img/png/cards_item_3.png) white 50%;*/
|
||||||
|
background: white 50%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: right;
|
background-position: right;
|
||||||
box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);
|
box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);
|
||||||
@@ -2556,10 +2825,9 @@ button#send_feedback_form{
|
|||||||
|
|
||||||
|
|
||||||
.cards_item_4{
|
.cards_item_4{
|
||||||
width: 48%;
|
|
||||||
height: 322px;
|
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background: url(/static/img/png/cards_item_4.png), #111217 50%;
|
/*background: url(/static/img/png/cards_item_4.png), #111217 50%;*/
|
||||||
|
background: #111217 50%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: right;
|
background-position: right;
|
||||||
|
|
||||||
@@ -2568,6 +2836,16 @@ button#send_feedback_form{
|
|||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cards_item_1,
|
||||||
|
.cards_item_2,
|
||||||
|
.cards_item_3,
|
||||||
|
.cards_item_4{
|
||||||
|
height: 322px;
|
||||||
|
width: 48%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.cards_item_4_right{
|
.cards_item_4_right{
|
||||||
float: right;
|
float: right;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
@@ -2584,7 +2862,7 @@ button#send_feedback_form{
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
line-height: 52px; /* 118.182% */
|
line-height: 52px; /* 118.182% */
|
||||||
margin: 104px 0 0 20px;
|
margin: 67px 0 0 20px;
|
||||||
}
|
}
|
||||||
.card_title_2{
|
.card_title_2{
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
@@ -2601,7 +2879,7 @@ button#send_feedback_form{
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
margin: 20px 0 0 20px;
|
margin: 20px 0 0 20px;
|
||||||
width: 50%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*faq_main_page*/
|
/*faq_main_page*/
|
||||||
@@ -2790,13 +3068,17 @@ details[open] summary ~ *{
|
|||||||
/*END_user_articles*/
|
/*END_user_articles*/
|
||||||
/*news articles all*/
|
/*news articles all*/
|
||||||
.advertisement_block_news{
|
.advertisement_block_news{
|
||||||
height: 200px;
|
/*text-align: center;*/
|
||||||
text-align: center;
|
/*background: #FFF;*/
|
||||||
border-radius: 10px;
|
/*box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);*/
|
||||||
background: #FFF;
|
|
||||||
box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);
|
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
}
|
}
|
||||||
|
.advertisement_content>img{
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.wrapper_advertisement {
|
.wrapper_advertisement {
|
||||||
/*padding-top: 140px;*/
|
/*padding-top: 140px;*/
|
||||||
@@ -2847,6 +3129,7 @@ details[open] summary ~ *{
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
.self_news_header{
|
.self_news_header{
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
@@ -2856,7 +3139,7 @@ details[open] summary ~ *{
|
|||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
}
|
}
|
||||||
.self_news_description{
|
.self_news_description{
|
||||||
margin-bottom: 40px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.self_news_text>p+img{
|
.self_news_text>p+img{
|
||||||
@@ -2872,6 +3155,7 @@ details[open] summary ~ *{
|
|||||||
float: right;
|
float: right;
|
||||||
width: 40%;
|
width: 40%;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 32 KiB |
BIN
static/img/png/banner_test.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
static/img/png/banner_test_3.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
7
static/img/svg/gb.svg
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icon-css-gb" viewBox="0 0 512 512">
|
||||||
|
<path fill="#012169" d="M0 0h512v512H0z"/>
|
||||||
|
<path fill="#FFF" d="M512 0v64L322 256l190 187v69h-67L254 324 68 512H0v-68l186-187L0 74V0h62l192 188L440 0z"/>
|
||||||
|
<path fill="#C8102E" d="M184 324l11 34L42 512H0v-3l184-185zm124-12l54 8 150 147v45L308 312zM512 0L320 196l-4-44L466 0h46zM0 1l193 189-59-8L0 49V1z"/>
|
||||||
|
<path fill="#FFF" d="M176 0v512h160V0H176zM0 176v160h512V176H0z"/>
|
||||||
|
<path fill="#C8102E" d="M0 208v96h512v-96H0zM208 0v512h96V0h-96z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 541 B |
1
static/img/svg/loader_white.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" width="32px" height="32px" viewBox="0 0 128 128" xml:space="preserve"><g><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="1"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.67" transform="rotate(45,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.42" transform="rotate(90,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.2" transform="rotate(135,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.12" transform="rotate(180,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.12" transform="rotate(225,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.12" transform="rotate(270,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.12" transform="rotate(315,64,64)"/><animateTransform attributeName="transform" type="rotate" values="0 64 64;315 64 64;270 64 64;225 64 64;180 64 64;135 64 64;90 64 64;45 64 64" calcMode="discrete" dur="720ms" repeatCount="indefinite"></animateTransform></g></svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
7
static/img/svg/ru.svg
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icon-css-ru" viewBox="0 0 512 512">
|
||||||
|
<g fill-rule="evenodd" stroke-width="1pt">
|
||||||
|
<path fill="#fff" d="M0 0h512v512H0z"/>
|
||||||
|
<path fill="#0039a6" d="M0 170.7h512V512H0z"/>
|
||||||
|
<path fill="#d52b1e" d="M0 341.3h512V512H0z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 290 B |
BIN
static/img/svg/user_icon_standart.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
@@ -3,6 +3,8 @@ function SendLoginForm(el){
|
|||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
let form = el.form;
|
let form = el.form;
|
||||||
let formData = new FormData(form);
|
let formData = new FormData(form);
|
||||||
|
let msr = sessionStorage.getItem('mailingSubscribeRequired')
|
||||||
|
formData.set('mailingSubscribeRequired',msr)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -18,7 +20,10 @@ function SendLoginForm(el){
|
|||||||
data: formData,
|
data: formData,
|
||||||
success: function(data){
|
success: function(data){
|
||||||
|
|
||||||
location.href = '/profile/page/dashboard/'
|
location.href = `/profile/page/dashboard/`
|
||||||
|
window.sessionStorage.removeItem('mailingSubscribeRequired')
|
||||||
|
window.sessionStorage.removeItem('email')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
|
|
||||||
function update_count_unread_messages (data) {
|
function update_count_unread_messages (data) {
|
||||||
let list_unrd = document.querySelectorAll(".unredmessages_value_text")
|
let selected_btn = document.querySelector(".selected")
|
||||||
let list_unrd_parent = document.querySelectorAll(".icon_unread_messages")
|
if (selected_btn.dataset['ajaxUrl'] !== 'chats'){
|
||||||
let i = 0
|
let list_unrd = document.querySelectorAll(".unredmessages_value_text")
|
||||||
for (i;i < list_unrd.length;i++){
|
let list_unrd_parent = document.querySelectorAll(".icon_unread_messages")
|
||||||
if (!list_unrd_parent[i].classList.contains("showed")){
|
let i = 0
|
||||||
list_unrd_parent[i].classList.toggle("showed")
|
for (i;i < list_unrd.length;i++){
|
||||||
|
if (!list_unrd_parent[i].classList.contains("showed")){
|
||||||
|
list_unrd_parent[i].classList.toggle("showed")
|
||||||
|
}
|
||||||
|
list_unrd[i].innerHTML = data.unread_msgs_count.toString()
|
||||||
}
|
}
|
||||||
list_unrd[i].innerHTML = data.unread_msgs_count.toString()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function update_chat_html (data,msg_cont) {
|
|||||||
|
|
||||||
|
|
||||||
function update_list_w_users (data,old_item_tab_user,el_tab) {
|
function update_list_w_users (data,old_item_tab_user,el_tab) {
|
||||||
let list_of_users = document.querySelector(".block-list-of-users")
|
let list_of_users = document.querySelector(".container_block_list_of_users")
|
||||||
if (list_of_users) {
|
if (list_of_users) {
|
||||||
|
|
||||||
if (data.users_list_html){
|
if (data.users_list_html){
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
|
|
||||||
|
|
||||||
function sendMessageSocket (data) {
|
function sendMessageSocket (data) {
|
||||||
if (chatSocket.readyState !== 1 && chatSocket.readyState !== 0){
|
if (chatSocket && chatSocket.readyState !== 0) {
|
||||||
init_ws()
|
if (chatSocket.readyState !== 1 && chatSocket.readyState !== 0){
|
||||||
}
|
init_ws()
|
||||||
loader_show_message(data)
|
|
||||||
chatSocket.send(JSON.stringify(data));
|
|
||||||
if (!data.ticket_id){
|
|
||||||
let el_tab = document.querySelector(".tab_user_messanger.select")
|
|
||||||
if (el_tab !== null){
|
|
||||||
el_tab.querySelector(".last-message-messenger-user-tab").innerHTML = data['text']
|
|
||||||
}
|
}
|
||||||
|
loader_show_message(data)
|
||||||
|
chatSocket.send(JSON.stringify(data));
|
||||||
|
if (!data.ticket_id){
|
||||||
|
let el_tab = document.querySelector(".tab_user_messanger.select")
|
||||||
|
if (el_tab !== null){
|
||||||
|
el_tab.querySelector(".last-message-messenger-user-tab").innerHTML = data['text']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
alert('Websoket connection failed')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,6 +39,16 @@ function wsReceiveData (e) {
|
|||||||
console.log(data)
|
console.log(data)
|
||||||
} else if (data.type === "update_chat") {
|
} else if (data.type === "update_chat") {
|
||||||
let msg_cont = document.querySelector(".container-messages")
|
let msg_cont = document.querySelector(".container-messages")
|
||||||
|
if (getInfoAboutUser('screen_width') < 800){
|
||||||
|
if (!window.location.href.includes("chat") && !window.location.href.includes("support")){
|
||||||
|
let marker_new_messages = document.querySelector(".marker_messages_mobile");
|
||||||
|
if (marker_new_messages.classList.contains('hide')){
|
||||||
|
marker_new_messages.classList.add('show')
|
||||||
|
marker_new_messages.classList.remove('hide')
|
||||||
|
}
|
||||||
|
setCokie(365,'twb_new_messages',true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
update_chat_html(data,msg_cont)
|
update_chat_html(data,msg_cont)
|
||||||
// document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'end',inline:'end'});
|
// document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'end',inline:'end'});
|
||||||
@@ -55,6 +69,8 @@ function wsReceiveData (e) {
|
|||||||
if (user_id) {
|
if (user_id) {
|
||||||
if (ticket_maneger.toString() !== user_id) {
|
if (ticket_maneger.toString() !== user_id) {
|
||||||
clear_messenger()
|
clear_messenger()
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -93,14 +109,25 @@ function wsReceiveData (e) {
|
|||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
// if
|
// if
|
||||||
|
if (window.location.href.includes("chat")){
|
||||||
update_list_w_users(data,old_item_tab_user,el_tab)
|
update_list_w_users(data,old_item_tab_user,el_tab)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} else if (data.type === "update_support_chat"){
|
} else if (data.type === "update_support_chat"){
|
||||||
update_support_chat_func(data,msg_cont)
|
update_support_chat_func(data,msg_cont)
|
||||||
}
|
}
|
||||||
if (data.unread_msgs_count > 0){
|
if (data.unread_msgs_count > 0){
|
||||||
|
if (getInfoAboutUser('screen_width') < 800){
|
||||||
|
if (!window.location.href.includes("chat") && !window.location.href.includes("support")){
|
||||||
|
let marker_new_messages = document.querySelector(".marker_messages_mobile");
|
||||||
|
if (marker_new_messages.classList.contains('hide')){
|
||||||
|
marker_new_messages.classList.add('show')
|
||||||
|
marker_new_messages.classList.remove('hide')
|
||||||
|
}
|
||||||
|
setCokie(365,'twb_new_messages',true)
|
||||||
|
}
|
||||||
|
}
|
||||||
update_count_unread_messages(data)
|
update_count_unread_messages(data)
|
||||||
}
|
}
|
||||||
if (data.required_beep === true) {
|
if (data.required_beep === true) {
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
*
|
*
|
||||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
!function(t,e) {
|
!function(t,e) {
|
||||||
|
|
||||||
if ("function" == typeof define && define.amd) define(["moment", "jquery"], function (t, a) {
|
if ("function" == typeof define && define.amd) define(["moment", "jquery"], function (t, a) {
|
||||||
@@ -47,19 +50,26 @@
|
|||||||
this.buttonClasses = "btn btn-sm",
|
this.buttonClasses = "btn btn-sm",
|
||||||
this.applyButtonClasses = "btn-primary",
|
this.applyButtonClasses = "btn-primary",
|
||||||
this.cancelButtonClasses = "btn-default",
|
this.cancelButtonClasses = "btn-default",
|
||||||
this.locale = {
|
|
||||||
direction: "ltr",
|
this.locale = i.locale,
|
||||||
// format: t.localeData().longDateFormat("L"),
|
this.locale.daysOfWeek = t.weekdaysMin(),
|
||||||
format: "DD.MM.YYYY",
|
this.locale.monthNames = t.monthsShort(),
|
||||||
separator: " - ",
|
this.locale.firstDay = t.localeData().firstDayOfWeek(),
|
||||||
applyLabel: "Apply",
|
|
||||||
cancelLabel: "Cancel",
|
// this.locale = {
|
||||||
weekLabel: "W",
|
// direction: "ltr",
|
||||||
customRangeLabel: "Custom Range",
|
// // format: t.localeData().longDateFormat("L"),
|
||||||
daysOfWeek: t.weekdaysMin(),
|
// format: "DD.MM.YYYY",
|
||||||
monthNames: t.monthsShort(),
|
// separator: " - ",
|
||||||
firstDay: t.localeData().firstDayOfWeek()
|
// applyLabel: "Принять",
|
||||||
}, this.callback = function () {
|
// cancelLabel: "Отменить",
|
||||||
|
// weekLabel: "Н",
|
||||||
|
// customRangeLabel: "Custom Range",
|
||||||
|
// daysOfWeek: t.weekdaysMin(),
|
||||||
|
// monthNames: t.monthsShort(),
|
||||||
|
// firstDay: t.localeData().firstDayOfWeek()
|
||||||
|
// }
|
||||||
|
this.callback = function () {
|
||||||
}, this.isShowing = !1, this.leftCalendar = {}, this.rightCalendar = {}, "object" == typeof i && null !== i || (i = {}), "string" == typeof (i = e.extend(this.element.data(), i)).template || i.template instanceof e || (i.template = '<div class="daterangepicker"><div class="ranges"></div><div class="drp-calendar left"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-calendar right"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-buttons"><span class="drp-selected"></span><button class="cancelBtn" type="button"></button><button class="applyBtn" disabled="disabled" type="button"></button> </div></div>'), this.parentEl = i.parentEl && e(i.parentEl).length ? e(i.parentEl) : e(this.parentEl), this.container = e(i.template).appendTo(this.parentEl), "object" == typeof i.locale && ("string" == typeof i.locale.direction && (this.locale.direction = i.locale.direction), "string" == typeof i.locale.format && (this.locale.format = i.locale.format), "string" == typeof i.locale.separator && (this.locale.separator = i.locale.separator), "object" == typeof i.locale.daysOfWeek && (this.locale.daysOfWeek = i.locale.daysOfWeek.slice()), "object" == typeof i.locale.monthNames && (this.locale.monthNames = i.locale.monthNames.slice()), "number" == typeof i.locale.firstDay && (this.locale.firstDay = i.locale.firstDay), "string" == typeof i.locale.applyLabel && (this.locale.applyLabel = i.locale.applyLabel), "string" == typeof i.locale.cancelLabel && (this.locale.cancelLabel = i.locale.cancelLabel), "string" == typeof i.locale.weekLabel && (this.locale.weekLabel = i.locale.weekLabel), "string" == typeof i.locale.customRangeLabel)) {
|
}, this.isShowing = !1, this.leftCalendar = {}, this.rightCalendar = {}, "object" == typeof i && null !== i || (i = {}), "string" == typeof (i = e.extend(this.element.data(), i)).template || i.template instanceof e || (i.template = '<div class="daterangepicker"><div class="ranges"></div><div class="drp-calendar left"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-calendar right"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-buttons"><span class="drp-selected"></span><button class="cancelBtn" type="button"></button><button class="applyBtn" disabled="disabled" type="button"></button> </div></div>'), this.parentEl = i.parentEl && e(i.parentEl).length ? e(i.parentEl) : e(this.parentEl), this.container = e(i.template).appendTo(this.parentEl), "object" == typeof i.locale && ("string" == typeof i.locale.direction && (this.locale.direction = i.locale.direction), "string" == typeof i.locale.format && (this.locale.format = i.locale.format), "string" == typeof i.locale.separator && (this.locale.separator = i.locale.separator), "object" == typeof i.locale.daysOfWeek && (this.locale.daysOfWeek = i.locale.daysOfWeek.slice()), "object" == typeof i.locale.monthNames && (this.locale.monthNames = i.locale.monthNames.slice()), "number" == typeof i.locale.firstDay && (this.locale.firstDay = i.locale.firstDay), "string" == typeof i.locale.applyLabel && (this.locale.applyLabel = i.locale.applyLabel), "string" == typeof i.locale.cancelLabel && (this.locale.cancelLabel = i.locale.cancelLabel), "string" == typeof i.locale.weekLabel && (this.locale.weekLabel = i.locale.weekLabel), "string" == typeof i.locale.customRangeLabel)) {
|
||||||
(p = document.createElement("textarea")).innerHTML = i.locale.customRangeLabel;
|
(p = document.createElement("textarea")).innerHTML = i.locale.customRangeLabel;
|
||||||
var n = p.value;
|
var n = p.value;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
timeout_range_slider = null
|
timeout_range_slider = null
|
||||||
|
|
||||||
function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null,weight=null){
|
function filters_func_find_route_main (el, owner_type=null, win_loc_replace=null, weight=null){
|
||||||
|
|
||||||
console.log("asd")
|
console.log("asd")
|
||||||
|
|
||||||
@@ -11,9 +11,9 @@ function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null,w
|
|||||||
let list = forloop_func_form(data_d,"get",get_url)
|
let list = forloop_func_form(data_d,"get",get_url)
|
||||||
data_d = list[0]
|
data_d = list[0]
|
||||||
get_url = list[1]
|
get_url = list[1]
|
||||||
// if (owner_type !== null) {
|
if (owner_type !== null) {
|
||||||
// data_d['owner_type'] = owner_type
|
data_d['owner_type'] = owner_type
|
||||||
// }
|
}
|
||||||
// get_url = get_url + `owner_type=${owner_type}`
|
// get_url = get_url + `owner_type=${owner_type}`
|
||||||
window.location.href = `${win_loc_replace}?${get_url}`
|
window.location.href = `${win_loc_replace}?${get_url}`
|
||||||
|
|
||||||
@@ -31,10 +31,10 @@ function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null,w
|
|||||||
let list = forloop_func_form(data_d,"get",get_url)
|
let list = forloop_func_form(data_d,"get",get_url)
|
||||||
data_d = list[0]
|
data_d = list[0]
|
||||||
get_url = list[1]
|
get_url = list[1]
|
||||||
// if (owner_type !== null) {
|
if (owner_type !== null) {
|
||||||
// data_d['owner_type'] = owner_type
|
data_d['owner_type'] = owner_type
|
||||||
// get_url = get_url + `owner_type=${owner_type}`
|
// get_url = get_url + `owner_type=${owner_type}`
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (weight){
|
if (weight){
|
||||||
|
|
||||||
@@ -58,6 +58,7 @@ function ajax_for_filter (data_d,get_url){
|
|||||||
document.querySelector(".container_loader_filters_routes").classList.toggle("show")
|
document.querySelector(".container_loader_filters_routes").classList.toggle("show")
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
// headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
url: '/routes/find_routes/',
|
url: '/routes/find_routes/',
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
|||||||
@@ -82,4 +82,11 @@ function focusOnInput (el) {
|
|||||||
let parent = el.offsetParent
|
let parent = el.offsetParent
|
||||||
let input = parent.querySelector('.find_route')
|
let input = parent.querySelector('.find_route')
|
||||||
input.focus()
|
input.focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkLetterOrNumber (el){
|
||||||
|
let txt = el.value
|
||||||
|
if (isNaN(txt)){
|
||||||
|
el.value = txt.slice(0, -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,31 +1,139 @@
|
|||||||
// $(document).ready(function (){
|
$(document).ready(function (){
|
||||||
// middleWareJS()
|
hide_or_show_new_messages_marker()
|
||||||
// })
|
checkStateCookie()
|
||||||
|
})
|
||||||
|
|
||||||
// window.onfocus = function () {
|
// window.onfocus = function () {
|
||||||
// getSocketState()
|
// getSocketState()
|
||||||
// }
|
// }
|
||||||
|
|
||||||
window.onload = function (){
|
window.onload = function (){
|
||||||
|
changeTopStrMobile()
|
||||||
middleWareJS()
|
middleWareJS()
|
||||||
|
openOrCloseCurtainSupportChat()
|
||||||
|
openOverlayOrClose()
|
||||||
|
goToChatIfChat()
|
||||||
|
|
||||||
|
// let body = document.querySelector("body")
|
||||||
|
// const viewPortH = body.getBoundingClientRect().height;
|
||||||
|
// const windowH = window.innerHeight;
|
||||||
|
// const browserUiBarsH = viewPortH - windowH;
|
||||||
|
// body.style.height = `calc(100vh - ${browserUiBarsH}px)`;
|
||||||
|
// let height = window.innerHeight
|
||||||
|
// document.querySelector('body').style.maxHeight = height + 'px'
|
||||||
|
// document.querySelector('body').style.height = height + 'px'
|
||||||
|
if (window.location.href.includes('profile') && !window.location.href.includes('login') && !window.location.href.includes('registration')){
|
||||||
|
let user_type = getInfoAboutUser()
|
||||||
|
if (user_type === 'mobile') {
|
||||||
|
open_curtain_w_btn_profile()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!window.location.href.includes('profile')){
|
||||||
|
open_curtain_w_btn_profile()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (window.location.href.includes("profile")){
|
||||||
|
setStandartSettingsToBlockOverlay()
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (window.location.href.includes("profile")){
|
||||||
|
// selectTabProfileIfHisNotSelected(url)
|
||||||
|
// }
|
||||||
|
let chats = document.querySelector(`[data-ajax-url='chats']`)
|
||||||
|
if (chats){
|
||||||
|
deleteMarkerMessages()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hide_or_show_new_messages_marker () {
|
||||||
|
if (getInfoAboutUser('screen_width') < 800){
|
||||||
|
if (window.location.href.includes("chat") || window.location.href.includes("support")){
|
||||||
|
setCokie(365,'twb_new_messages','false')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
function goToChatIfChat () {
|
||||||
|
if (document.querySelector('.block-chat')){
|
||||||
|
let scroll_el = document.querySelector('.block-chat')
|
||||||
|
if (document.querySelector(".name_ticket")){
|
||||||
|
scroll_el = document.querySelector(".name_ticket")
|
||||||
|
}
|
||||||
|
let top = scroll_el.offsetTop
|
||||||
|
window.scrollTo({top:top})
|
||||||
|
document.addEventListener('focusout', function(e,scroll_el) {
|
||||||
|
window.scrollTo(scroll_el, 0)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function middleWareJS(){
|
function middleWareJS(){
|
||||||
let footer = document.querySelector("footer")
|
let footer = document.querySelector("footer")
|
||||||
let body = document.querySelector("body")
|
let body = document.querySelector("body")
|
||||||
let type = getInfoAboutUser()
|
let type = getInfoAboutUser()
|
||||||
if (type !== 'mobile'){
|
// if (type !== 'mobile'){
|
||||||
if (document.querySelector(".menu_buttons.curtain.left") || window.location.href.includes('support') || window.location.href.includes('chat')){
|
if (document.querySelector(".menu_buttons.curtain.left") || window.location.href.includes('support') || window.location.href.includes('chat')){
|
||||||
footer.style.display = "none"
|
footer.style.display = "none"
|
||||||
body.style.overflow = "hidden"
|
body.style.overflow = "hidden"
|
||||||
|
|
||||||
|
} else {
|
||||||
|
footer.style.display = ""
|
||||||
|
body.style.overflow = ""
|
||||||
|
}
|
||||||
|
// }/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function changeTopStrMobile (){
|
||||||
|
let body = document.querySelector("body")
|
||||||
|
// if (!window.location.href.includes("mobile")){
|
||||||
|
// if (!window.location.href.includes("mobile") && !window.location.href.includes("route_search_results")){
|
||||||
|
// window.location.href = window.location.href + `?mobile=${getInfoAboutUser() === 'mobile'}`
|
||||||
|
// }
|
||||||
|
body.style.opacity = ''
|
||||||
|
body.style.transition = '500ms'
|
||||||
|
// } else {
|
||||||
|
body.style.display = ''
|
||||||
|
body.style.transition = '500ms'
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
function openOrCloseCurtainSupportChat (){
|
||||||
|
if (window.location.href.includes("support")){
|
||||||
|
let type_screen = getInfoAboutUser()
|
||||||
|
let chat_block = document.querySelector(".block-chat")
|
||||||
|
let name_ticket = document.querySelector(".name_ticket")
|
||||||
|
let str = 'menu_buttons curtain left'
|
||||||
|
if (type_screen === 'mobile'){
|
||||||
|
if (!chat_block){
|
||||||
|
str = `${str} open`
|
||||||
|
} else {
|
||||||
|
str = `${str} close`
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
footer.style.display = ""
|
str = `${str} open`
|
||||||
body.style.overflow = ""
|
}
|
||||||
|
if (name_ticket){
|
||||||
|
str = `${str} margin`
|
||||||
|
}
|
||||||
|
document.querySelector(".menu_buttons").class = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openOverlayOrClose () {
|
||||||
|
if (window.location.href.includes("profile") && !window.location.href.includes("login") && !window.location.href.includes("registration")){
|
||||||
|
let overlay = document.querySelector('.block_overlay')
|
||||||
|
if (screen.width < 700){
|
||||||
|
if (!overlay.classList.contains("show")){
|
||||||
|
overlay.classList.add("show")
|
||||||
|
overlay.classList.remove("hidden")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTypeOfData (data) {
|
function getTypeOfData (data) {
|
||||||
@@ -34,41 +142,58 @@ function getTypeOfData (data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getInfoAboutUser (){
|
function getInfoAboutUser (screen_width){
|
||||||
let user_type = ''
|
let user_type = ''
|
||||||
if (screen.width <= 700){
|
if (screen.width <= 700){
|
||||||
user_type = 'mobile'
|
user_type = 'mobile'
|
||||||
} else if (screen.width > 1024) {
|
} else if (screen.width > 1180) {
|
||||||
user_type = 'desctop'
|
user_type = 'desctop'
|
||||||
} else if (screen.width > 700 && screen.width < 1024) {
|
} else if (screen.width > 700 && screen.width <= 1180) {
|
||||||
user_type = 'laptop'
|
user_type = 'laptop'
|
||||||
}
|
}
|
||||||
return user_type
|
if (screen_width){
|
||||||
|
return screen.width
|
||||||
|
} else {
|
||||||
|
return user_type
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
let img = document.getElementById('dropbtn_lang')
|
let img = document.getElementById('dropbtn_lang')
|
||||||
if (window.location.href.indexOf("ru") > -1){
|
if (window.location.href.indexOf("ru") > -1){
|
||||||
img.style.background = "url('/static/img/png/ru.png')"
|
img.style.background = "url('/static/img/svg/ru.svg')"
|
||||||
img.style.backgroundRepeat = "no-repeat"
|
img.style.backgroundRepeat = "no-repeat"
|
||||||
img.style.backgroundPosition = "left center"
|
img.style.backgroundPosition = "center"
|
||||||
|
// img.style.backgroundSize = '50%'
|
||||||
|
|
||||||
}else if(window.location.href.indexOf("en") > -1){
|
}else if(window.location.href.indexOf("en") > -1){
|
||||||
img.style.background = "url('/static/img/png/en.png')"
|
img.style.background = "url('/static/img/svg/gb.svg')"
|
||||||
img.style.backgroundRepeat = "no-repeat"
|
img.style.backgroundRepeat = "no-repeat"
|
||||||
img.style.backgroundPosition = "left center"
|
img.style.backgroundPosition = "center"
|
||||||
|
// img.style.backgroundSize = '50%'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let login_email = document.getElementById('login_email_input')
|
||||||
|
let registration_email = document.getElementById('registration_email_input')
|
||||||
|
if(login_email){
|
||||||
|
login_email.value = sessionStorage.getItem('email')
|
||||||
|
}else if(registration_email){
|
||||||
|
registration_email.value = sessionStorage.getItem('email')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('scroll', () => {
|
// window.addEventListener('scroll', () => {
|
||||||
// let headerBG = document.getElementById('header_bg')
|
// // let headerBG = document.getElementById('header_bg')
|
||||||
//
|
// //
|
||||||
// headerBG.style.backgroundColor = 'rgb(248 248 248 / 90%)'
|
// // headerBG.style.backgroundColor = 'rgb(248 248 248 / 90%)'
|
||||||
// headerBG.style.padding = '20px 40px'
|
// // headerBG.style.padding = '20px 40px'
|
||||||
// headerBG.style.paddingBottom = 'padding: 10px 40px 10px 40px'
|
// // headerBG.style.paddingBottom = 'padding: 10px 40px 10px 40px'
|
||||||
// headerBG.style.paddingRight = 'padding: 10px 40px 10px 40px'
|
// // headerBG.style.paddingRight = 'padding: 10px 40px 10px 40px'
|
||||||
// headerBG.style.paddingLeft = 'padding: 10px 40px 10px 40px'
|
// // headerBG.style.paddingLeft = 'padding: 10px 40px 10px 40px'
|
||||||
})
|
// })
|
||||||
|
|
||||||
// Действия при изменении URL
|
// Действия при изменении URL
|
||||||
|
|
||||||
@@ -98,3 +223,50 @@ function scroll_ev (event,el){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkStateCookie () {
|
||||||
|
if (!window.document.cookie.includes("allow_cookie=true")){
|
||||||
|
document.querySelector(".cookie_block").classList.add("show")
|
||||||
|
}
|
||||||
|
if (window.document.cookie.includes("twb_new_messages=true")){
|
||||||
|
if (getInfoAboutUser('screen_width') < 800) {
|
||||||
|
let marker_new_messages = document.querySelector(".marker_messages_mobile");
|
||||||
|
if (marker_new_messages.classList.contains('hide')) {
|
||||||
|
marker_new_messages.classList.remove('hide')
|
||||||
|
marker_new_messages.classList.add('show')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (window.document.cookie.includes("twb_new_messages=false")){
|
||||||
|
if (getInfoAboutUser('screen_width') < 800) {
|
||||||
|
let marker_new_messages = document.querySelector(".marker_messages_mobile");
|
||||||
|
if (marker_new_messages.classList.contains('show')) {
|
||||||
|
marker_new_messages.classList.add('hide')
|
||||||
|
marker_new_messages.classList.remove('show')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCsrfCookie () {
|
||||||
|
let str = window.document.cookie
|
||||||
|
str = str.split('; ');
|
||||||
|
let obj_cookie = {}
|
||||||
|
for (let i = 0;i < str.length;i++){
|
||||||
|
let cur = str[i].split('=');
|
||||||
|
obj_cookie[cur[0]] = cur[1]
|
||||||
|
}
|
||||||
|
let csrf = obj_cookie['csrftoken']
|
||||||
|
return csrf
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCokie (days,name,val) {
|
||||||
|
let date = new Date();
|
||||||
|
// let days = 182;
|
||||||
|
date.setTime(+ date + (days * 86400000));
|
||||||
|
window.document.cookie = `${name}=${val}` + "; expires=" + date.toGMTString() + "; path=/";
|
||||||
|
document.querySelector(".cookie_block").classList.remove("show")
|
||||||
|
// return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getInCookieTime (time) {
|
||||||
|
return time * 24 * 60 * 60
|
||||||
|
}
|
||||||
18239
static/js/moment-with-locales.js
Normal file
91
static/js/push/registerSw.js
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
const registerSw = async () => {
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
const reg = await navigator.serviceWorker.register('/sw.js');
|
||||||
|
initialiseState(reg)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
showNotAllowed("You can't send push notifications ☹️😢")
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const initialiseState = (reg) => {
|
||||||
|
if (!reg.showNotification) {
|
||||||
|
showNotAllowed('Showing notifications isn\'t supported ☹️😢');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (Notification.permission === 'denied') {
|
||||||
|
showNotAllowed('You prevented us from showing notifications ☹️🤔');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!'PushManager' in window) {
|
||||||
|
showNotAllowed("Push isn't allowed in your browser 🤔");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
subscribe(reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
const showNotAllowed = (message) => {
|
||||||
|
const button = document.querySelector('form>button');
|
||||||
|
button.innerHTML = `${message}`;
|
||||||
|
button.setAttribute('disabled', 'true');
|
||||||
|
};
|
||||||
|
|
||||||
|
function urlB64ToUint8Array(base64String) {
|
||||||
|
const padding = '='.repeat((4 - base64String.length % 4) % 4);
|
||||||
|
const base64 = (base64String + padding)
|
||||||
|
.replace(/\-/g, '+')
|
||||||
|
.replace(/_/g, '/');
|
||||||
|
|
||||||
|
const rawData = window.atob(base64);
|
||||||
|
const outputArray = new Uint8Array(rawData.length);
|
||||||
|
const outputData = outputArray.map((output, index) => rawData.charCodeAt(index));
|
||||||
|
|
||||||
|
return outputData;
|
||||||
|
}
|
||||||
|
|
||||||
|
const subscribe = async (reg) => {
|
||||||
|
const subscription = await reg.pushManager.getSubscription();
|
||||||
|
if (subscription) {
|
||||||
|
sendSubData(subscription);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const vapidMeta = document.querySelector('meta[name="vapid-key"]');
|
||||||
|
const key = vapidMeta.content;
|
||||||
|
const options = {
|
||||||
|
userVisibleOnly: true,
|
||||||
|
// if key exists, create applicationServerKey property
|
||||||
|
...(key && {applicationServerKey: urlB64ToUint8Array(key)})
|
||||||
|
};
|
||||||
|
|
||||||
|
const sub = await reg.pushManager.subscribe(options);
|
||||||
|
sendSubData(sub)
|
||||||
|
};
|
||||||
|
|
||||||
|
const sendSubData = async (subscription) => {
|
||||||
|
const browser = navigator.userAgent.match(/(firefox|msie|chrome|safari|trident)/ig)[0].toLowerCase();
|
||||||
|
const data = {
|
||||||
|
status_type: 'subscribe',
|
||||||
|
subscription: subscription.toJSON(),
|
||||||
|
browser: browser,
|
||||||
|
user_agent: browser,
|
||||||
|
};
|
||||||
|
|
||||||
|
const res = await fetch('/webpush/save_information', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(data),
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
|
||||||
|
},
|
||||||
|
credentials: "include"
|
||||||
|
});
|
||||||
|
|
||||||
|
handleResponse(res);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleResponse = (res) => {
|
||||||
|
console.log(res.status);
|
||||||
|
};
|
||||||
|
|
||||||
|
registerSw();
|
||||||
@@ -43,6 +43,52 @@
|
|||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
locale_ru = new Object({
|
||||||
|
direction: "ltr",
|
||||||
|
// format: t.localeData().longDateFormat("L"),
|
||||||
|
format: "DD.MM.YYYY",
|
||||||
|
separator: " - ",
|
||||||
|
applyLabel: "Принять",
|
||||||
|
cancelLabel: "Отменить",
|
||||||
|
weekLabel: "Н",
|
||||||
|
customRangeLabel: "Custom Range",
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
locale_en = new Object({
|
||||||
|
direction: "ltr",
|
||||||
|
// format: t.localeData().longDateFormat("L"),
|
||||||
|
format: "DD.MM.YYYY",
|
||||||
|
separator: " - ",
|
||||||
|
applyLabel: "Apply",
|
||||||
|
cancelLabel: "Cancel",
|
||||||
|
weekLabel: "W",
|
||||||
|
customRangeLabel: "Custom Range",
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
function changeLangForDateTimePicker() {
|
||||||
|
|
||||||
|
if (document.documentElement.lang === 'ru'){
|
||||||
|
locale_lang = locale_ru;
|
||||||
|
lang = 'ru';
|
||||||
|
} else {
|
||||||
|
locale_lang = locale_en;
|
||||||
|
lang ='en';
|
||||||
|
}
|
||||||
|
moment.locale(lang);
|
||||||
|
return locale_lang
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function init_arrival_DT (date=null,single=true,hour=true){
|
function init_arrival_DT (date=null,single=true,hour=true){
|
||||||
let minDate = null
|
let minDate = null
|
||||||
if (date){
|
if (date){
|
||||||
@@ -58,6 +104,9 @@ function init_arrival_DT (date=null,single=true,hour=true){
|
|||||||
}
|
}
|
||||||
let place_1 = document.querySelector("#id_arrival_DT")
|
let place_1 = document.querySelector("#id_arrival_DT")
|
||||||
if (place_1) {
|
if (place_1) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(place_1).daterangepicker({
|
$(place_1).daterangepicker({
|
||||||
"autoapply": true,
|
"autoapply": true,
|
||||||
"linkedCalendars": false,
|
"linkedCalendars": false,
|
||||||
@@ -65,6 +114,7 @@ function init_arrival_DT (date=null,single=true,hour=true){
|
|||||||
"timePicker":hour,
|
"timePicker":hour,
|
||||||
"timePicker24Hour":true,
|
"timePicker24Hour":true,
|
||||||
"minDate":minDate,
|
"minDate":minDate,
|
||||||
|
"locale": changeLangForDateTimePicker(),
|
||||||
},
|
},
|
||||||
function (start, end, label) {
|
function (start, end, label) {
|
||||||
|
|
||||||
@@ -77,6 +127,7 @@ function init_arrival_DT (date=null,single=true,hour=true){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$(`${place_1.id} .drp-calendar.right`).hide();
|
$(`${place_1.id} .drp-calendar.right`).hide();
|
||||||
$(`${place_1.id} .drp-calendar.left`).addClass('single');
|
$(`${place_1.id} .drp-calendar.left`).addClass('single');
|
||||||
|
|
||||||
@@ -108,6 +159,7 @@ function init_departure_DT (){
|
|||||||
"singleDatePicker":true,
|
"singleDatePicker":true,
|
||||||
"timePicker":true,
|
"timePicker":true,
|
||||||
"timePicker24Hour":true,
|
"timePicker24Hour":true,
|
||||||
|
"locale": changeLangForDateTimePicker(),
|
||||||
},
|
},
|
||||||
function(start, end, label) {
|
function(start, end, label) {
|
||||||
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
|
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
|
||||||
@@ -142,6 +194,7 @@ $(function () {
|
|||||||
$(place_1).daterangepicker({
|
$(place_1).daterangepicker({
|
||||||
"autoapply": true,
|
"autoapply": true,
|
||||||
"linkedCalendars": false,
|
"linkedCalendars": false,
|
||||||
|
"locale": changeLangForDateTimePicker(),
|
||||||
|
|
||||||
},
|
},
|
||||||
function (start, end, label) {
|
function (start, end, label) {
|
||||||
@@ -174,6 +227,7 @@ $(function() {
|
|||||||
$(place_1).daterangepicker({
|
$(place_1).daterangepicker({
|
||||||
"autoapply": true,
|
"autoapply": true,
|
||||||
"linkedCalendars": false,
|
"linkedCalendars": false,
|
||||||
|
"locale": changeLangForDateTimePicker(),
|
||||||
onl_param
|
onl_param
|
||||||
},
|
},
|
||||||
function(start, end, label) {
|
function(start, end, label) {
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ function SendRegistrationForm(el){
|
|||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
let form = el.form;
|
let form = el.form;
|
||||||
let formData = new FormData(form);
|
let formData = new FormData(form);
|
||||||
|
let msr = sessionStorage.getItem('mailingSubscribeRequired')
|
||||||
|
formData.set('mailingSubscribeRequired',msr)
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
@@ -15,7 +17,9 @@ function SendRegistrationForm(el){
|
|||||||
data: formData,
|
data: formData,
|
||||||
success: function(data){
|
success: function(data){
|
||||||
|
|
||||||
location.href = '/profile/page/dashboard/'
|
location.href = `/profile/page/dashboard/`
|
||||||
|
window.sessionStorage.removeItem('mailingSubscribeRequired')
|
||||||
|
window.sessionStorage.removeItem('email')
|
||||||
},
|
},
|
||||||
error: function (data, exception){
|
error: function (data, exception){
|
||||||
document.querySelector(".register").innerHTML = data.responseJSON.html
|
document.querySelector(".register").innerHTML = data.responseJSON.html
|
||||||
|
|||||||
@@ -146,9 +146,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function removeRoute(el) {
|
function removeRoute(el,route_id ) {
|
||||||
let data = el.currentTarget.closest('.carrier-card');
|
let remove_item = route_id
|
||||||
let remove_item = data.dataset.numberOfRoute
|
|
||||||
let remove_data = {}
|
let remove_data = {}
|
||||||
let name_route = 'route_id'
|
let name_route = 'route_id'
|
||||||
remove_data[name_route] = remove_item
|
remove_data[name_route] = remove_item
|
||||||
@@ -176,7 +175,7 @@ function removeRoute(el) {
|
|||||||
// el.classList.add('selected')
|
// el.classList.add('selected')
|
||||||
|
|
||||||
//updating the url without reloading
|
//updating the url without reloading
|
||||||
window.history.pushState(null, null, '/ru/profile/page/change_profile/')
|
window.history.pushState(null, null, '/ru/profile/page/my_routes/')
|
||||||
|
|
||||||
middleWareJS()
|
middleWareJS()
|
||||||
},
|
},
|
||||||
@@ -189,47 +188,66 @@ function removeRoute(el) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancelRemove() {
|
function cancelRemove(route_id) {
|
||||||
let parent_cancel_button = document.querySelector('.button_remove_route')
|
let confirm_remove = document.getElementById('confirm_remove_'+ route_id);
|
||||||
let cancel_button = document.querySelector('.cancel_remove')
|
let cancel_remove = document.getElementById('cancel_remove_'+ route_id);
|
||||||
parent_cancel_button.removeChild(cancel_button)
|
|
||||||
|
|
||||||
let remove_button = document.querySelector('.confirm_remove');
|
|
||||||
remove_button.classList.remove('confirm_remove');
|
|
||||||
remove_button.innerText = 'Удалить';
|
|
||||||
remove_button.setAttribute("id", "remove_route");
|
|
||||||
|
|
||||||
remove_button.removeEventListener('click', removeRoute);
|
|
||||||
|
|
||||||
|
confirm_remove.classList.remove('show');
|
||||||
|
cancel_remove.classList.remove('show');
|
||||||
|
|
||||||
|
let remove_btn = document.getElementById('remove_route_'+route_id);
|
||||||
|
remove_btn.classList.remove('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hideBlock(el) {
|
||||||
|
|
||||||
function confirmRemove(el) {
|
el.classList.add('hide')
|
||||||
|
|
||||||
el.setAttribute("id", "select-remove");
|
|
||||||
let btn = document.querySelector("#select-remove");
|
|
||||||
|
|
||||||
if (!btn.classList.contains('confirm_remove')) {
|
|
||||||
btn.classList.add('confirm_remove');
|
|
||||||
btn.innerText = 'Подтвердить удаление';
|
|
||||||
btn.addEventListener('click', removeRoute, { once: true });
|
|
||||||
|
|
||||||
let cancel_button = document.createElement('button');
|
|
||||||
cancel_button.className = "cancel_remove";
|
|
||||||
cancel_button.innerText = "Отменить удаление";
|
|
||||||
cancel_button.addEventListener('click', cancelRemove)
|
|
||||||
|
|
||||||
|
|
||||||
let place = btn.closest(".button_remove_route");
|
let clear_form = document.querySelector('.clear_form');
|
||||||
place.insertBefore(cancel_button, btn.nextSibling);
|
if(clear_form){
|
||||||
|
clear_form.reset();
|
||||||
|
}
|
||||||
|
|
||||||
btn.removeAttribute( "select-remove");
|
|
||||||
|
|
||||||
|
let clear_form_com = document.querySelector('.commercial_offer');
|
||||||
|
|
||||||
|
if(clear_form_com){
|
||||||
|
clear_form_com.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let disable_btn = document.getElementById('send_feedback_form');
|
||||||
|
|
||||||
|
if(disable_btn){
|
||||||
|
disable_btn.removeAttribute('disabled');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let disable_btn_r = document.getElementById('request_btn');
|
||||||
|
if(disable_btn_r){
|
||||||
|
disable_btn_r.removeAttribute('disabled');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function confirmRemove(el, route_id) {
|
||||||
|
|
||||||
|
let confirm_remove = document.getElementById('confirm_remove_'+ route_id);
|
||||||
|
let cancel_remove = document.getElementById('cancel_remove_'+ route_id);
|
||||||
|
confirm_remove.classList.add('show');
|
||||||
|
cancel_remove.classList.add('show');
|
||||||
|
|
||||||
|
let remove_btn = document.getElementById('remove_route_'+route_id);
|
||||||
|
remove_btn.classList.add('hide');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function loader_place_ins_boris (el,type=null){
|
function loader_place_ins_boris (el,type=null){
|
||||||
if (el && !window.location.href.includes("profile")){
|
if (el && !window.location.href.includes("profile")){
|
||||||
|
|
||||||
@@ -237,6 +255,7 @@ function loader_place_ins_boris (el,type=null){
|
|||||||
let cur_loader_place = el.nextElementSibling
|
let cur_loader_place = el.nextElementSibling
|
||||||
if (type){
|
if (type){
|
||||||
cur_loader_place.innerHTML = ""
|
cur_loader_place.innerHTML = ""
|
||||||
|
changeWidthEL(el)
|
||||||
} else {
|
} else {
|
||||||
if (loader_place){
|
if (loader_place){
|
||||||
|
|
||||||
@@ -295,9 +314,6 @@ function searchTown(el){
|
|||||||
success: function(data){
|
success: function(data){
|
||||||
el.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center';
|
el.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center';
|
||||||
loader_place_ins_boris(el,"el")
|
loader_place_ins_boris(el,"el")
|
||||||
if (document.querySelector(".container_form_search_carrier")){
|
|
||||||
document.querySelector(".container_form_search_carrier").style.zIndex = '10000000000'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -311,7 +327,7 @@ function searchTown(el){
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 1500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -332,13 +348,14 @@ function selectItemAddrPoint(id, name, ctrl_name,){
|
|||||||
tap_txt_cont.setAttribute('title',name)
|
tap_txt_cont.setAttribute('title',name)
|
||||||
let tap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4));
|
let tap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4));
|
||||||
tap_cont.value = id;
|
tap_cont.value = id;
|
||||||
|
if (tap_txt_cont.classList.contains('red_text')){
|
||||||
|
tap_txt_cont.classList.remove('red_text')
|
||||||
|
}
|
||||||
|
|
||||||
if (!window.location.href.includes("profile")){
|
if (!window.location.href.includes("profile")){
|
||||||
changeWidthEL(tap_txt_cont)
|
changeWidthEL(tap_txt_cont)
|
||||||
}
|
}
|
||||||
input_list.classList.remove('show');
|
input_list.classList.remove('show');
|
||||||
if (document.querySelector(".container_form_search_carrier")){
|
|
||||||
document.querySelector(".container_form_search_carrier").style.zIndex = 'unset'
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,14 +401,29 @@ function onblurInputField(event,el){
|
|||||||
if(!parent_event || parent_event[0] !== search_list){
|
if(!parent_event || parent_event[0] !== search_list){
|
||||||
|
|
||||||
search_list.classList.remove('show')
|
search_list.classList.remove('show')
|
||||||
if (document.querySelector(".container_form_search_carrier")){
|
|
||||||
document.querySelector(".container_form_search_carrier").style.zIndex = '10000000000'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearID(el) {
|
||||||
|
|
||||||
|
el.select();
|
||||||
|
|
||||||
|
if(el.value !== "" && el.id === 'id_from_address_point_txt' ){
|
||||||
|
document.getElementById('id_from_address_point').value = ''
|
||||||
|
el.value = ''
|
||||||
|
// el.classList.add('red_text')
|
||||||
|
} else if(el.value !== "" && el.id === 'id_to_address_point_txt'){
|
||||||
|
document.getElementById('id_to_address_point').value = ''
|
||||||
|
el.value = ''
|
||||||
|
|
||||||
|
|
||||||
|
// el.classList.add('red_text')
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// function hideErrorMsg(el) {
|
// function hideErrorMsg(el) {
|
||||||
// let hide_element = document.querySelector()
|
// let hide_element = document.querySelector()
|
||||||
@@ -454,58 +486,62 @@ function sendRoute(el, routeID = null){
|
|||||||
el.disabled = true
|
el.disabled = true
|
||||||
|
|
||||||
|
|
||||||
let list_of_elements_form = document.querySelectorAll(".el_form_b_new_route");
|
// let list_of_elements_form = document.querySelectorAll(".el_form_b_new_route");
|
||||||
let checked_cargo_type = document.querySelectorAll('.cargo_check');
|
// let checked_cargo_type = document.querySelectorAll('.cargo_check');
|
||||||
|
//
|
||||||
|
// let obj_w_el_form = {}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// for (let n = 0;n < checked_cargo_type.length; n++){
|
||||||
|
// let checked_cargo = checked_cargo_type[n]
|
||||||
|
// if(checked_cargo.checked === true){
|
||||||
|
// let name_cargo = checked_cargo.name
|
||||||
|
// let value_cargo = checked_cargo_type[n].value
|
||||||
|
// obj_w_el_form[name_cargo] = value_cargo
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// for (let i = 0; i < list_of_elements_form.length ;i++) {
|
||||||
|
// // let id_el = list_of_elements_form[i].id
|
||||||
|
// // if (id_el){
|
||||||
|
// // if (id_el === "")
|
||||||
|
// // }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// let name_attr = list_of_elements_form[i].attributes["name"]
|
||||||
|
// if (name_attr) {
|
||||||
|
// let name_el = name_attr.value
|
||||||
|
// let value_el = list_of_elements_form[i].value
|
||||||
|
// obj_w_el_form[name_el] = value_el
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// let selected_owner_type = document.querySelectorAll("#customer, #mover")
|
||||||
|
//
|
||||||
|
// selected_owner_type.forEach(function(item) {
|
||||||
|
// if (item.classList.contains('selected')) {
|
||||||
|
// let { id, innerText } = item
|
||||||
|
// obj_w_el_form['owner_type'] = id
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// if (selected_owner_type[0].classList.contains('selected')){
|
||||||
|
//
|
||||||
|
// }else{}
|
||||||
|
let owner_type_value = document.getElementById('hide_owner_type').value
|
||||||
|
|
||||||
|
let form = el.form
|
||||||
|
let formData = new FormData(form);
|
||||||
let obj_w_el_form = {}
|
let owner_type = owner_type_value
|
||||||
|
formData.set('owner_type', owner_type)
|
||||||
|
|
||||||
for (let n = 0;n < checked_cargo_type.length; n++){
|
|
||||||
let checked_cargo = checked_cargo_type[n]
|
|
||||||
if(checked_cargo.checked === true){
|
|
||||||
let name_cargo = checked_cargo.name
|
|
||||||
let value_cargo = checked_cargo_type[n].value
|
|
||||||
obj_w_el_form[name_cargo] = value_cargo
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (let i = 0; i < list_of_elements_form.length ;i++) {
|
|
||||||
// let id_el = list_of_elements_form[i].id
|
|
||||||
// if (id_el){
|
|
||||||
// if (id_el === "")
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let name_attr = list_of_elements_form[i].attributes["name"]
|
|
||||||
if (name_attr) {
|
|
||||||
let name_el = name_attr.value
|
|
||||||
let value_el = list_of_elements_form[i].value
|
|
||||||
obj_w_el_form[name_el] = value_el
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let selected_owner_type = document.querySelectorAll("#customer, #mover")
|
|
||||||
|
|
||||||
selected_owner_type.forEach(function(item) {
|
|
||||||
if (item.classList.contains('selected')) {
|
|
||||||
let { id, innerText } = item
|
|
||||||
obj_w_el_form['owner_type'] = id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (selected_owner_type[0].classList.contains('selected')){
|
|
||||||
|
|
||||||
}else{}
|
|
||||||
|
|
||||||
let url = '/routes/create_or_change_route/'
|
let url = '/routes/create_or_change_route/'
|
||||||
if (routeID !== null){
|
if (routeID !== null){
|
||||||
@@ -521,7 +557,8 @@ function sendRoute(el, routeID = null){
|
|||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
// enctype: 'json',
|
// enctype: 'json',
|
||||||
data: JSON.stringify(obj_w_el_form),
|
// data: JSON.stringify(obj_w_el_form),
|
||||||
|
data: formData,
|
||||||
success: function(data){
|
success: function(data){
|
||||||
|
|
||||||
let data_route_id = data.route_id
|
let data_route_id = data.route_id
|
||||||
@@ -543,6 +580,8 @@ function sendRoute(el, routeID = null){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'nearest',inline:'nearest'});
|
// document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'nearest',inline:'nearest'});
|
||||||
|
|
||||||
|
|
||||||
@@ -570,12 +609,20 @@ function sendRoute(el, routeID = null){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function validate(el) {
|
// function validate(el) {
|
||||||
if (el.checked) {
|
// if (el.checked) {
|
||||||
console.log('cheked', el.id);
|
// console.log('cheked', el.id);
|
||||||
} else {
|
// } else {
|
||||||
console.log("You didn't check it! Let me check it for you.", el.id);
|
// console.log("You didn't check it! Let me check it for you.", el.id);
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
function setIcon(el) {
|
||||||
|
if(el.id === 'id_departure_DT' ){
|
||||||
|
document.getElementById('id_departure_DT').style.background = 'url("/static/img/svg/IconCalendar.svg") white 98% no-repeat';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -584,9 +631,22 @@ function validate(el) {
|
|||||||
//cleaning route inputs after selection changes
|
//cleaning route inputs after selection changes
|
||||||
function OnSelectionChange(el) {
|
function OnSelectionChange(el) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
||||||
let form = el.form;
|
let form = el.form;
|
||||||
|
|
||||||
|
// if (customer.classList.contains('selected')) {
|
||||||
|
// owner_type = form.dataset['customer']
|
||||||
|
// } else if (mover.classList.contains('selected')) {
|
||||||
|
// owner_type = form.dataset['customer']
|
||||||
|
// }
|
||||||
|
let owner_type_value = document.getElementById('hide_owner_type').value
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let formData = new FormData(form);
|
let formData = new FormData(form);
|
||||||
|
let owner_type = owner_type_value
|
||||||
|
formData.set('owner_type', owner_type)
|
||||||
|
|
||||||
|
// formData.set('owner_type', owner_type)
|
||||||
|
|
||||||
// let data = {};
|
// let data = {};
|
||||||
// data['csrfmiddlewaretoken'] = $('input[name="csrfmiddlewaretoken"]')[0].value;
|
// data['csrfmiddlewaretoken'] = $('input[name="csrfmiddlewaretoken"]')[0].value;
|
||||||
@@ -737,6 +797,11 @@ function editRoute(id) {
|
|||||||
if(data.html){
|
if(data.html){
|
||||||
let changeTextButton = document.getElementById('registration')
|
let changeTextButton = document.getElementById('registration')
|
||||||
changeTextButton.innerText = 'Сохранить изменения'
|
changeTextButton.innerText = 'Сохранить изменения'
|
||||||
|
window.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
behavior: "smooth"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
init_departure_DT()
|
init_departure_DT()
|
||||||
@@ -794,11 +859,11 @@ function checkDate() {
|
|||||||
// alert("End date cannot be less than Start date.");
|
// alert("End date cannot be less than Start date.");
|
||||||
dateArrival.value = ""
|
dateArrival.value = ""
|
||||||
|
|
||||||
let arrivalDiv = document.getElementById('arrival_div')
|
// let arrivalDiv = document.getElementById('arrival_div')
|
||||||
let errorMessage = document.createElement('span');
|
// let errorMessage = document.createElement('span');
|
||||||
errorMessage.textContent = "Дата прибытия, не может быть установлена раньше даты отправки"
|
// // errorMessage.textContent = "Дата прибытия, не может быть установлена раньше даты отправки"
|
||||||
errorMessage.classList.add('errorlist')
|
// errorMessage.classList.add('errorlist')
|
||||||
arrivalDiv.appendChild(errorMessage);
|
// arrivalDiv.appendChild(errorMessage);
|
||||||
}
|
}
|
||||||
else if (DateEnd > DateStart){
|
else if (DateEnd > DateStart){
|
||||||
let arrivalDiv = document.getElementById('arrival_div');
|
let arrivalDiv = document.getElementById('arrival_div');
|
||||||
@@ -808,17 +873,48 @@ function checkDate() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// const form = document.querySelector('form');
|
||||||
|
// document.querySelector('[type="button"]').addEventListener('click', e => {
|
||||||
|
// if (!form.checkValidity()) {
|
||||||
|
// alert('Хьюстон, у нас проблемы!');
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
function RequestCommercialOffer (el){
|
function RequestCommercialOffer (el){
|
||||||
|
|
||||||
|
el.style.background = '#FF613A url("/static/img/svg/loader_white.svg") no-repeat center';
|
||||||
|
el.style.contentVisibility = 'hidden';
|
||||||
|
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
||||||
|
let disable_btn = document.getElementById('send_feedback_form');
|
||||||
|
let disable_btn_req = document.getElementById('request_btn');
|
||||||
|
let disable_btn_f = document.getElementById('footer_input_button');
|
||||||
|
|
||||||
|
if(el.id === 'footer_input_button'){
|
||||||
|
disable_btn_f.setAttribute('disabled', true);
|
||||||
|
} else {
|
||||||
|
if(disable_btn){
|
||||||
|
disable_btn.setAttribute('disabled', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(disable_btn_req){
|
||||||
|
disable_btn_req.setAttribute('disabled', true);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let form = el.form;
|
let form = el.form;
|
||||||
let formData = new FormData(form);
|
let formData = new FormData(form);
|
||||||
let form_name = form.dataset['name']
|
let form_name = form.dataset['name']
|
||||||
formData.set('form_name',form_name)
|
formData.set('form_name',form_name)
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
url: '/user_account/send_message/',
|
url: '/user_account/send_message/',
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@@ -830,30 +926,91 @@ function RequestCommercialOffer (el){
|
|||||||
data: formData,
|
data: formData,
|
||||||
success: function(data){
|
success: function(data){
|
||||||
|
|
||||||
alert("Сообщение отправлено")
|
// el.style.background = '#FF613A';
|
||||||
|
el.removeAttribute('style')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(el.id !== 'footer_input_button'){
|
||||||
|
let insert_text = document.querySelector(".clear_form")
|
||||||
|
if(insert_text){
|
||||||
|
$(data.html).insertBefore(insert_text)
|
||||||
|
}
|
||||||
|
|
||||||
|
let insert_text_2 = document.querySelector(".commercial_offer")
|
||||||
|
if(insert_text_2){
|
||||||
|
|
||||||
|
$(data.html).insertBefore(insert_text_2)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let disable_btn_f = document.getElementById('footer_input_button');
|
||||||
|
disable_btn_f.removeAttribute('disabled');
|
||||||
|
let clear_footer_form = document.getElementById('clear_input');
|
||||||
|
|
||||||
|
clear_footer_form.reset();
|
||||||
|
|
||||||
|
let hide_error_msg = document.getElementById('error_footer').classList.add('hide')
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function (data, exception){
|
error: function (data, exception){
|
||||||
// document.querySelector(".login").innerHTML = data.responseJSON.html
|
// document.querySelector(".login").innerHTML = data.responseJSON.html
|
||||||
|
|
||||||
|
if(el.id !== 'footer_input_button'){
|
||||||
|
let feedback_form = document.querySelector('.feedback_form')
|
||||||
|
if(feedback_form){
|
||||||
|
feedback_form.innerHTML = data.responseJSON.html;
|
||||||
|
// let incorrect_block = document.querySelectorAll('.inputs_l')
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
let commercial_offer = document.querySelector('.commercial_offer')
|
||||||
|
if(commercial_offer){
|
||||||
|
commercial_offer.innerHTML = data.responseJSON.html;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let footer_form = document.querySelector('.insert_form').innerHTML = data.responseJSON.html;
|
||||||
|
|
||||||
|
// $(data.responseJSON.html).insertBefore(footer_form)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// document.querySelector(".info_profile").innerHTML = data.html;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendFeedbackForm (el){
|
function subscribeNewsletter (el){
|
||||||
|
|
||||||
|
el.style.background = '#FF613A url("/static/img/svg/loader_white.svg") no-repeat center';
|
||||||
|
el.style.contentVisibility = 'hidden';
|
||||||
|
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
||||||
|
let disable_btn_f = document.getElementById('footer_input_button');
|
||||||
|
|
||||||
|
disable_btn_f.setAttribute('disabled', true);
|
||||||
|
|
||||||
|
|
||||||
let form = el.form;
|
let form = el.form;
|
||||||
let formData = new FormData(form);
|
let formData = new FormData(form);
|
||||||
let form_name = form.dataset['name']
|
let form_name = form.dataset['name']
|
||||||
formData.set('form_name',form_name)
|
formData.set('form_name',form_name)
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
// url: '/user_account/request_offer/',
|
url: '/user_account/mailing_subscribe/',
|
||||||
type: "POST",
|
type: "POST",
|
||||||
// async: true,
|
// async: true,
|
||||||
cache: false,
|
cache: false,
|
||||||
@@ -863,16 +1020,154 @@ function SendFeedbackForm (el){
|
|||||||
data: formData,
|
data: formData,
|
||||||
success: function(data){
|
success: function(data){
|
||||||
|
|
||||||
// location.href = '/profile'
|
// el.style.background = '#FF613A';
|
||||||
|
el.removeAttribute('style')
|
||||||
|
|
||||||
|
if(data.status === 'sended' && data.del_form === true){
|
||||||
|
|
||||||
|
document.querySelector('.footer_input_wrap').innerHTML = data.html;
|
||||||
|
|
||||||
|
} else if(data.redirect_url){
|
||||||
|
window.sessionStorage.setItem('email', data.email)
|
||||||
|
window.sessionStorage.setItem('mailingSubscribeRequired','true')
|
||||||
|
window.location.replace(data.redirect_url)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(el.id !== 'footer_input_button'){
|
||||||
|
let insert_text = document.querySelector(".clear_form")
|
||||||
|
if(insert_text){
|
||||||
|
$(data.html).insertBefore(insert_text)
|
||||||
|
}
|
||||||
|
|
||||||
|
let insert_text_2 = document.querySelector(".commercial_offer")
|
||||||
|
if(insert_text_2){
|
||||||
|
$(data.html).insertBefore(insert_text_2)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let disable_btn_f = document.getElementById('footer_input_button');
|
||||||
|
if(disable_btn_f){
|
||||||
|
disable_btn_f.removeAttribute('disabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
let clear_footer_form = document.getElementById('clear_input');
|
||||||
|
|
||||||
|
clear_footer_form.reset();
|
||||||
|
|
||||||
|
let hide_error_msg = document.getElementById('error_footer').classList.add('hide')
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function (data, exception){
|
error: function (data, exception){
|
||||||
// document.querySelector(".login").innerHTML = data.responseJSON.html
|
// document.querySelector(".login").innerHTML = data.responseJSON.html
|
||||||
|
|
||||||
|
if(el.id !== 'footer_input_button'){
|
||||||
|
let feedback_form = document.querySelector('.feedback_form')
|
||||||
|
if(feedback_form){
|
||||||
|
feedback_form.innerHTML = data.responseJSON.html;
|
||||||
|
// let incorrect_block = document.querySelectorAll('.inputs_l')
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
let commercial_offer = document.querySelector('.commercial_offer')
|
||||||
|
if(commercial_offer){
|
||||||
|
commercial_offer.innerHTML = data.responseJSON.html;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let footer_form = document.querySelector('.insert_form').innerHTML = data.responseJSON.html;
|
||||||
|
|
||||||
|
// $(data.responseJSON.html).insertBefore(footer_form)
|
||||||
|
}
|
||||||
|
|
||||||
|
// document.querySelector(".info_profile").innerHTML = data.html;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hideErrors(el) {
|
||||||
|
let error_feeedback_text = document.getElementById('error_feedback_text')
|
||||||
|
let error_feeedback = el.nextElementSibling
|
||||||
|
let counter_text = document.querySelector('.counter-text')
|
||||||
|
let footer_button = document.getElementById('footer_input_button')
|
||||||
|
let error_footer = document.getElementById('error_footer')
|
||||||
|
let agree_error = document.getElementById('reg_agree_error')
|
||||||
|
let error_departure_DT = document.getElementById('error_departure_DT')
|
||||||
|
let error_arrival_DT = document.getElementById('error_arrival_DT')
|
||||||
|
let error_from_address_point = document.getElementById('error_from_address_point')
|
||||||
|
let error_to_address_point = document.getElementById('error_to_address_point')
|
||||||
|
let error_cargo_type = document.getElementById('error_cargo_type')
|
||||||
|
let error_id_phone = document.getElementById('error_id_phone')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(error_feeedback === counter_text && error_feeedback !== null && error_feeedback_text !== null ){
|
||||||
|
error_feeedback_text.classList.add('hide')
|
||||||
|
} else if(error_feeedback === footer_button && error_footer !== null ){
|
||||||
|
error_footer.classList.add('hide')
|
||||||
|
} else if(el.id === 'agreement_check'){
|
||||||
|
agree_error.classList.add('hide')
|
||||||
|
} else if(el.id === 'id_arrival_DT' && error_arrival_DT !== null){
|
||||||
|
error_arrival_DT.classList.add('hide')
|
||||||
|
}else if(el.id === 'id_departure_DT' && error_departure_DT !== null){
|
||||||
|
error_departure_DT.classList.add('hide')
|
||||||
|
} else if(el.id === 'id_from_address_point_txt' && error_from_address_point !== null ){
|
||||||
|
error_from_address_point.classList.add('hide')
|
||||||
|
}else if(el.id === 'id_to_address_point_txt' && error_to_address_point !== null ){
|
||||||
|
error_to_address_point.classList.add('hide')
|
||||||
|
} else if(el.id === 'id_cargo_lable' && error_cargo_type !== null){
|
||||||
|
error_cargo_type.classList.add('hide')
|
||||||
|
} else if(el.id === 'id_phone' && error_id_phone !==null){
|
||||||
|
error_id_phone.classList.add('hide')
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(error_feeedback !== null) {
|
||||||
|
error_feeedback.classList.add('hide')
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// function SendFeedbackForm (el){
|
||||||
|
//
|
||||||
|
// event.preventDefault()
|
||||||
|
// let form = el.form;
|
||||||
|
// let formData = new FormData(form);
|
||||||
|
// let form_name = form.dataset['name']
|
||||||
|
// formData.set('form_name',form_name)
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// $.ajax({
|
||||||
|
// headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
|
// // url: '/user_account/request_offer/',
|
||||||
|
// type: "POST",
|
||||||
|
// // async: true,
|
||||||
|
// cache: false,
|
||||||
|
// processData: false,
|
||||||
|
// contentType: false,
|
||||||
|
// // enctype: 'json',
|
||||||
|
// data: formData,
|
||||||
|
// success: function(data){
|
||||||
|
//
|
||||||
|
// // location.href = '/profile'
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// },
|
||||||
|
// error: function (data, exception){
|
||||||
|
// // document.querySelector(".login").innerHTML = data.responseJSON.html
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function counterText(evt) {
|
function counterText(evt) {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ profile_tabs_f_static_map = new Map([
|
|||||||
['dashboard','dashboard']
|
['dashboard','dashboard']
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
function select_tab_profile (el,url,owner_type=null) {
|
function select_tab_profile (el,url,owner_type=null) {
|
||||||
let data = {}
|
let data = {}
|
||||||
let confirm_url = `/user_account/${url}/`
|
let confirm_url = `/user_account/${url}/`
|
||||||
@@ -26,6 +25,7 @@ function select_tab_profile (el,url,owner_type=null) {
|
|||||||
document.querySelector(".info_profile").innerHTML = '<img src="/static/img/svg/loader.svg" style="height: 30px;position: absolute;top: 47%;left: 45%;"/>'
|
document.querySelector(".info_profile").innerHTML = '<img src="/static/img/svg/loader.svg" style="height: 30px;position: absolute;top: 47%;left: 45%;"/>'
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
// headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
url: confirm_url,
|
url: confirm_url,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@@ -36,6 +36,7 @@ function select_tab_profile (el,url,owner_type=null) {
|
|||||||
// enctype: 'json',
|
// enctype: 'json',
|
||||||
data: JSON.stringify(data),
|
data: JSON.stringify(data),
|
||||||
success: function(data){
|
success: function(data){
|
||||||
|
let scroll_top = window.scrollY
|
||||||
document.querySelector(".info_profile").innerHTML = data.html;
|
document.querySelector(".info_profile").innerHTML = data.html;
|
||||||
let list_div = document.querySelectorAll('.menu_profile div');
|
let list_div = document.querySelectorAll('.menu_profile div');
|
||||||
list_div.forEach(el=>{ el.classList.remove('selected'); });
|
list_div.forEach(el=>{ el.classList.remove('selected'); });
|
||||||
@@ -45,22 +46,26 @@ function select_tab_profile (el,url,owner_type=null) {
|
|||||||
let confirm_url_f_lang_ru = ''
|
let confirm_url_f_lang_ru = ''
|
||||||
let confirm_url_f_lang_en = ''
|
let confirm_url_f_lang_en = ''
|
||||||
if (owner_type){
|
if (owner_type){
|
||||||
window.history.pushState(null, null, `/${document.documentElement.lang}/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/?mobile=${getInfoAboutUser() === 'mobile'}`)
|
window.history.pushState(null, null, `/${document.documentElement.lang}/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}`)
|
||||||
confirm_url_f_lang_ru = `/ru/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/?mobile=${getInfoAboutUser() === 'mobile'}`
|
confirm_url_f_lang_ru = `/ru/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/`
|
||||||
confirm_url_f_lang_en = `/en/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/?mobile=${getInfoAboutUser() === 'mobile'}`
|
confirm_url_f_lang_en = `/en/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/`
|
||||||
} else {
|
} else {
|
||||||
window.history.pushState(null, null, `/${document.documentElement.lang}/profile/page/${profile_tabs_f_static_map.get(url)}/?mobile=${getInfoAboutUser() === 'mobile'}`)
|
window.history.pushState(null, null, `/${document.documentElement.lang}/profile/page/${profile_tabs_f_static_map.get(url)}/`)
|
||||||
confirm_url_f_lang_ru = `/ru/profile/page/${profile_tabs_f_static_map.get(url)}/?mobile=${getInfoAboutUser() === 'mobile'}`
|
confirm_url_f_lang_ru = `/ru/profile/page/${profile_tabs_f_static_map.get(url)}/`
|
||||||
confirm_url_f_lang_en = `/en/profile/page/${profile_tabs_f_static_map.get(url)}/?mobile=${getInfoAboutUser() === 'mobile'}`
|
confirm_url_f_lang_en = `/en/profile/page/${profile_tabs_f_static_map.get(url)}/`
|
||||||
}
|
}
|
||||||
document.querySelector("#ru_lang").href = confirm_url_f_lang_ru
|
document.querySelector("#ru_lang").href = confirm_url_f_lang_ru
|
||||||
document.querySelector("#en_lang").href = confirm_url_f_lang_en
|
document.querySelector("#en_lang").href = confirm_url_f_lang_en
|
||||||
let header = document.querySelector("header")
|
// let header = document.querySelector("header")
|
||||||
header.scrollIntoView({
|
// header.scrollIntoView({
|
||||||
behavior: "smooth",
|
// behavior: "smooth",
|
||||||
block: "end",
|
// block: "end",
|
||||||
inline: "nearest"
|
// inline:'nearest'
|
||||||
})
|
// })
|
||||||
|
window.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
behavior: "smooth",
|
||||||
|
});
|
||||||
middleWareJS()
|
middleWareJS()
|
||||||
let user_type = getInfoAboutUser()
|
let user_type = getInfoAboutUser()
|
||||||
if (user_type === 'mobile') {
|
if (user_type === 'mobile') {
|
||||||
@@ -75,6 +80,22 @@ function select_tab_profile (el,url,owner_type=null) {
|
|||||||
setStandartSettingsToBlockOverlay()
|
setStandartSettingsToBlockOverlay()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.location.href.includes("profile")){
|
||||||
|
selectTabProfileIfHisNotSelected(url)
|
||||||
|
}
|
||||||
|
deleteMarkerMessages(el)
|
||||||
|
checkStatesAfterTransitionToAnotherTabProfile()
|
||||||
|
goToChatIfChat()
|
||||||
|
if (window.location.href.includes("chat") || window.location.href.includes("support")) {
|
||||||
|
if (getInfoAboutUser('screen_width') < 800) {
|
||||||
|
let marker_new_messages = document.querySelector(".marker_messages_mobile");
|
||||||
|
if (marker_new_messages.classList.contains('show')) {
|
||||||
|
marker_new_messages.classList.remove('show')
|
||||||
|
marker_new_messages.classList.add('hide')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setCokie(365,'twb_new_messages','false')
|
||||||
},
|
},
|
||||||
error: function (data){
|
error: function (data){
|
||||||
console.log(data)
|
console.log(data)
|
||||||
@@ -82,16 +103,54 @@ function select_tab_profile (el,url,owner_type=null) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkStatesAfterTransitionToAnotherTabProfile () {
|
||||||
|
// check which page if profile - do
|
||||||
|
if (window.location.href.includes('profile')){
|
||||||
|
// if curtain open we need to close, so we'il see content without curtain
|
||||||
|
if (document.querySelector(".menu_buttons.curtain.right.open")){
|
||||||
|
open_curtain_w_btn_profile()
|
||||||
|
}
|
||||||
|
// if overlay open we need to close, so we'il see content without overlay
|
||||||
|
if (document.querySelector('.block_overlay.show')){
|
||||||
|
setStandartSettingsToBlockOverlay()
|
||||||
|
}
|
||||||
|
// if page === chat - do or if page === support
|
||||||
|
if (window.location.href.includes("page/chat/") || window.location.href.includes("page/support/")){
|
||||||
|
// if curtain with contacts or curtain with clients close we need to open it,
|
||||||
|
// but if user === not admin, and user in page support we didn't need to do anything
|
||||||
|
if (document.querySelector(".menu_buttons.curtain.left.close")){
|
||||||
|
open_curtain_w_contacts()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteMarkerMessages (el) {
|
||||||
|
let marker = document.querySelectorAll(".icon_unread_messages")
|
||||||
|
if (marker.length > 0) {
|
||||||
|
marker[0].classList.remove("showed")
|
||||||
|
if (marker[1]) {
|
||||||
|
marker[1].classList.remove("showed")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function selectTabProfileIfHisNotSelected (url) {
|
||||||
|
if (url !== 'new_route_view') {
|
||||||
|
let el_f_select = document.querySelector(`[data-ajax-url=${url}]`)
|
||||||
|
el_f_select.classList.add('selected')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function clickONTHEAPROfileBTN (el) {
|
function clickONTHEAPROfileBTN (el) {
|
||||||
let parent = el.parentNode
|
let el_f_click = el.querySelector(".text_btn_profile")
|
||||||
let el_f_click = parent.querySelector(".text_btn_profile")
|
|
||||||
el_f_click.click()
|
el_f_click.click()
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeHrefCl (el) {
|
function changeHrefCl (el) {
|
||||||
let dataset = el.dataset
|
let dataset = el.dataset
|
||||||
let old_href = dataset['href']
|
let old_href = dataset['href']
|
||||||
let new_href = old_href + `?mobile=${getInfoAboutUser() === 'mobile'}`
|
let new_href = old_href
|
||||||
el.setAttribute('href',new_href)
|
el.setAttribute('href',new_href)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,25 +401,26 @@ async function attachFilemeassge (el,id_ticket=null,sender=null,receiver=null,ch
|
|||||||
function change_profile_confirm (el){
|
function change_profile_confirm (el){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
let form = el.form
|
let form = el.form
|
||||||
let changed_elements = {}
|
let formData = new FormData(form);
|
||||||
for (let i = 0;i < form.length;i++){
|
// let changed_elements = {}
|
||||||
let cur_el = form[i]
|
// for (let i = 0;i < form.length;i++){
|
||||||
if (cur_el.localName !== 'button'){
|
// let cur_el = form[i]
|
||||||
let new_val = cur_el.value
|
// if (cur_el.localName !== 'button'){
|
||||||
let dataset = cur_el.dataset
|
// let new_val = cur_el.value
|
||||||
let old_val = ''
|
// let dataset = cur_el.dataset
|
||||||
if (dataset){
|
// let old_val = ''
|
||||||
old_val = dataset['initialValue']
|
// if (dataset){
|
||||||
}
|
// old_val = dataset['initialValue']
|
||||||
// if (old_val){
|
// }
|
||||||
if (old_val === new_val){
|
// // if (old_val){
|
||||||
//
|
// if (old_val === new_val){
|
||||||
} else {
|
// //
|
||||||
changed_elements[cur_el.name] = cur_el.value
|
// } else {
|
||||||
}
|
// changed_elements[cur_el.name] = cur_el.value
|
||||||
}
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
// // }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -372,16 +432,23 @@ function change_profile_confirm (el){
|
|||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
// enctype: 'json',
|
// enctype: 'json',
|
||||||
data: JSON.stringify(changed_elements),
|
// data: JSON.stringify(changed_elements),
|
||||||
|
data: formData,
|
||||||
success: function(data){
|
success: function(data){
|
||||||
middleWareJS()
|
middleWareJS()
|
||||||
|
|
||||||
document.querySelector(".info_profile").innerHTML = data.html;
|
document.querySelector(".info_profile").innerHTML = data.html;
|
||||||
|
|
||||||
|
document.getElementById('save_changes_txt').classList.add('hide')
|
||||||
|
document.getElementById('changes_saved_txt').classList.add('show')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function (data){
|
error: function (data){
|
||||||
|
|
||||||
document.querySelector(".avatar_user_profile").innerHTML = data.responseJSON.html;
|
// document.querySelector(".avatar_user_profile").innerHTML = data.responseJSON.html;
|
||||||
|
document.querySelector(".info_profile").innerHTML = data.responseJSON.html;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -412,8 +479,8 @@ async function upload_photo_f_profile (el,files) {
|
|||||||
},
|
},
|
||||||
error: function (data){
|
error: function (data){
|
||||||
|
|
||||||
document.querySelector(".avatar_user_profile").innerHTML = data.responseJSON.html;
|
alert(data.responseJSON.error);
|
||||||
|
el.value = ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// }
|
// }
|
||||||
@@ -477,9 +544,9 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){
|
|||||||
url = 'show_chat_w_user/'
|
url = 'show_chat_w_user/'
|
||||||
}
|
}
|
||||||
let user_type = getInfoAboutUser()
|
let user_type = getInfoAboutUser()
|
||||||
if (user_type === 'mobile' || user_type === 'laptop') {
|
// if (user_type === 'mobile' || user_type === 'laptop') {
|
||||||
open_curtain_w_contacts()
|
// open_curtain_w_contacts()
|
||||||
}
|
// }
|
||||||
data['mobile'] = getInfoAboutUser() === 'mobile' || getInfoAboutUser() === 'laptop'
|
data['mobile'] = getInfoAboutUser() === 'mobile' || getInfoAboutUser() === 'laptop'
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
@@ -499,8 +566,27 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){
|
|||||||
// let left_curtain = document.querySelector('.curtain.left')
|
// let left_curtain = document.querySelector('.curtain.left')
|
||||||
document.querySelector(".info_profile").innerHTML = data.html;
|
document.querySelector(".info_profile").innerHTML = data.html;
|
||||||
document.querySelector(".enter-message-inp").focus()
|
document.querySelector(".enter-message-inp").focus()
|
||||||
|
goToChatIfChat()
|
||||||
|
// document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'center',inline: 'start'});
|
||||||
|
|
||||||
document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'end',inline:'end'});
|
if (document.querySelector(".menu_buttons.curtain.left.open")){
|
||||||
|
let top = document.querySelector(".tab_user_messanger.select").offsetTop
|
||||||
|
document.querySelector(".menu_buttons.curtain.left.open").scrollTo({top:top})
|
||||||
|
}
|
||||||
|
// second time beacause we need to close curtain
|
||||||
|
// if (user_type === 'mobile' || user_type === 'laptop') {
|
||||||
|
// open_curtain_w_contacts()
|
||||||
|
// }
|
||||||
|
|
||||||
|
// document.querySelector(".handler_curtain_left").classList.toggle("open")
|
||||||
|
// document.querySelector(".handler_curtain_left").classList.toggle("close")
|
||||||
|
// if (getInfoAboutUser() === 'mobile' || getInfoAboutUser() === 'laptop'){
|
||||||
|
// window.scrollTo({
|
||||||
|
// top: 0,
|
||||||
|
// left: 0
|
||||||
|
// // behavior: "smooth",
|
||||||
|
// });
|
||||||
|
// }
|
||||||
// if (window.location.host.includes('support') && user_type !== 'mobile' && user_type !== 'laptop'){
|
// if (window.location.host.includes('support') && user_type !== 'mobile' && user_type !== 'laptop'){
|
||||||
// let menu = document.querySelector(".menu_buttons.curtain.left")
|
// let menu = document.querySelector(".menu_buttons.curtain.left")
|
||||||
// let container_user_messenger = document.querySelector(".container-messenger")
|
// let container_user_messenger = document.querySelector(".container-messenger")
|
||||||
@@ -511,8 +597,8 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// check state
|
||||||
|
checkStateAfterChooseContact()
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function (data){
|
error: function (data){
|
||||||
@@ -524,6 +610,17 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function checkStateAfterChooseContact () {
|
||||||
|
if (document.querySelector('.menu_buttons.curtain.left.open')){
|
||||||
|
open_curtain_w_contacts()
|
||||||
|
}
|
||||||
|
if (document.querySelector('.block_overlay.show')){
|
||||||
|
setStandartSettingsToBlockOverlay()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function sendMessage(id_ticket=null,sender,receiver,files=null){
|
function sendMessage(id_ticket=null,sender,receiver,files=null){
|
||||||
// import {sendMessageSocket} from "./chat_sockets";
|
// import {sendMessageSocket} from "./chat_sockets";
|
||||||
if (!files){
|
if (!files){
|
||||||
@@ -695,6 +792,7 @@ function open_curtain_w_btn_profile () {
|
|||||||
last_open_curtain = curtain
|
last_open_curtain = curtain
|
||||||
set_curtain_z_index(curtain)
|
set_curtain_z_index(curtain)
|
||||||
close_first_curt(curtain)
|
close_first_curt(curtain)
|
||||||
|
checkStateCurtain(curtain)
|
||||||
// delete_margin_in_mobile()
|
// delete_margin_in_mobile()
|
||||||
} else if (!window.location.href.includes("profile")){
|
} else if (!window.location.href.includes("profile")){
|
||||||
curtain.classList.toggle("open")
|
curtain.classList.toggle("open")
|
||||||
@@ -706,15 +804,38 @@ function open_curtain_w_btn_profile () {
|
|||||||
last_open_curtain = curtain
|
last_open_curtain = curtain
|
||||||
set_curtain_z_index(curtain)
|
set_curtain_z_index(curtain)
|
||||||
close_first_curt(curtain)
|
close_first_curt(curtain)
|
||||||
|
|
||||||
// delete_margin_in_mobile()
|
// delete_margin_in_mobile()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkStateCurtain (curtain) {
|
||||||
|
if (curtain.classList.contains("open")){
|
||||||
|
if (!document.querySelector(".block_overlay.show")){
|
||||||
|
document.querySelector(".block_overlay").classList.add("show")
|
||||||
|
document.querySelector(".block_overlay").classList.remove("hidden")
|
||||||
|
}
|
||||||
|
if (!curtain.parentNode.classList.contains("open")) {
|
||||||
|
curtain.parentNode.classList.add("open")
|
||||||
|
curtain.parentNode.classList.remove("close")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function open_curtain_w_contacts () {
|
function open_curtain_w_contacts () {
|
||||||
let curtain = document.querySelector('.menu_buttons.left')
|
let curtain = document.querySelector('.menu_buttons.left')
|
||||||
|
let btn_handler_left_curtain = document.querySelector(".handler_curtain_left")
|
||||||
let user_type = getInfoAboutUser()
|
let user_type = getInfoAboutUser()
|
||||||
if (user_type === 'mobile' || user_type === 'laptop' && window.location.href.includes("profile")) {
|
if (user_type === 'mobile' && window.location.href.includes("profile") || user_type === 'laptop' && window.location.href.includes("profile")) {
|
||||||
open_overlay(curtain)
|
open_overlay(curtain)
|
||||||
|
if (!curtain.parentNode.classList.contains('open') && !curtain.parentNode.classList.contains('close')){
|
||||||
|
curtain.parentNode.classList.add("open")
|
||||||
|
} else if (curtain.parentNode.classList.contains('open') || curtain.parentNode.classList.contains('close')) {
|
||||||
|
curtain.parentNode.classList.toggle("open")
|
||||||
|
curtain.parentNode.classList.toggle("close")
|
||||||
|
}
|
||||||
|
btn_handler_left_curtain.classList.toggle("open")
|
||||||
|
btn_handler_left_curtain.classList.toggle("close")
|
||||||
curtain.classList.toggle('open')
|
curtain.classList.toggle('open')
|
||||||
curtain.classList.toggle('close')
|
curtain.classList.toggle('close')
|
||||||
if (curtain.classList.contains('first')) {
|
if (curtain.classList.contains('first')) {
|
||||||
@@ -728,6 +849,14 @@ function open_curtain_w_contacts () {
|
|||||||
close_first_curt(curtain)
|
close_first_curt(curtain)
|
||||||
// delete_margin_in_mobile()
|
// delete_margin_in_mobile()
|
||||||
} else if (!window.location.href.includes("profile")){
|
} else if (!window.location.href.includes("profile")){
|
||||||
|
if (!curtain.parentNode.classList.contains('open') && !curtain.parentNode.classList.contains('close')){
|
||||||
|
curtain.parentNode.classList.add("open")
|
||||||
|
} else if (curtain.parentNode.classList.contains('open') || curtain.parentNode.classList.contains('close')) {
|
||||||
|
curtain.parentNode.classList.toggle("open")
|
||||||
|
curtain.parentNode.classList.toggle("close")
|
||||||
|
}
|
||||||
|
btn_handler_left_curtain.classList.toggle("open")
|
||||||
|
btn_handler_left_curtain.classList.toggle("close")
|
||||||
open_overlay(curtain)
|
open_overlay(curtain)
|
||||||
curtain.classList.toggle('open')
|
curtain.classList.toggle('open')
|
||||||
curtain.classList.toggle('close')
|
curtain.classList.toggle('close')
|
||||||
@@ -740,6 +869,7 @@ function open_curtain_w_contacts () {
|
|||||||
set_curtain_z_index(curtain)
|
set_curtain_z_index(curtain)
|
||||||
last_open_curtain = curtain
|
last_open_curtain = curtain
|
||||||
close_first_curt(curtain)
|
close_first_curt(curtain)
|
||||||
|
checkStateCurtain(curtain)
|
||||||
// delete_margin_in_mobile()
|
// delete_margin_in_mobile()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -794,7 +924,13 @@ function close_first_curt (curtain) {
|
|||||||
if (cur_el !== curtain){
|
if (cur_el !== curtain){
|
||||||
cur_el.classList.toggle('open')
|
cur_el.classList.toggle('open')
|
||||||
cur_el.classList.toggle('close')
|
cur_el.classList.toggle('close')
|
||||||
|
if (cur_el.classList.contains('left')){
|
||||||
|
document.querySelector(".handler_curtain_left").classList.toggle("open")
|
||||||
|
document.querySelector(".handler_curtain_left").classList.toggle("close")
|
||||||
|
}
|
||||||
|
if (window.location.href.includes("route_search_results")){
|
||||||
|
scroll_ev(event,window)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
})
|
})
|
||||||
@@ -809,9 +945,17 @@ function set_curtain_z_index (curtain) {
|
|||||||
curtains.forEach(function (){
|
curtains.forEach(function (){
|
||||||
let cur_el = curtains[i]
|
let cur_el = curtains[i]
|
||||||
if (cur_el === curtain){
|
if (cur_el === curtain){
|
||||||
|
if (!cur_el.querySelector(".handler_menu") && cur_el.classList.contains("left")){
|
||||||
|
let switcher = document.querySelector(".handler_curtain_left")
|
||||||
|
switcher.style.zIndex = 101
|
||||||
|
}
|
||||||
cur_el.style.zIndex = 101
|
cur_el.style.zIndex = 101
|
||||||
cur_el.parentNode.style.zIndex = 101
|
cur_el.parentNode.style.zIndex = 101
|
||||||
} else {
|
} else {
|
||||||
|
if (!cur_el.querySelector(".handler_menu") && cur_el.classList.contains("left")){
|
||||||
|
let switcher = document.querySelector(".handler_curtain_left")
|
||||||
|
switcher.style.zIndex = 99
|
||||||
|
}
|
||||||
cur_el.style.zIndex = 99
|
cur_el.style.zIndex = 99
|
||||||
cur_el.parentNode.style.zIndex = 99
|
cur_el.parentNode.style.zIndex = 99
|
||||||
}
|
}
|
||||||
@@ -821,7 +965,14 @@ function set_curtain_z_index (curtain) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function close_open_curtain () {
|
function close_open_curtain () {
|
||||||
if (getInfoAboutUser() === 'mobile' || !window.location.href.includes("profile")){
|
if (getInfoAboutUser() === 'mobile' || getInfoAboutUser() === 'laptop' || !window.location.href.includes("profile")){
|
||||||
|
let btn_handler_left_curtain = document.querySelector(".handler_curtain_left")
|
||||||
|
if (last_open_curtain){
|
||||||
|
if (last_open_curtain.classList.contains("left")) {
|
||||||
|
btn_handler_left_curtain.classList.toggle("open")
|
||||||
|
btn_handler_left_curtain.classList.toggle("close")
|
||||||
|
}
|
||||||
|
}
|
||||||
let curtains = document.querySelectorAll('.curtain.open')
|
let curtains = document.querySelectorAll('.curtain.open')
|
||||||
if (curtains.length >= 2) {
|
if (curtains.length >= 2) {
|
||||||
if (last_open_curtain) {
|
if (last_open_curtain) {
|
||||||
@@ -868,13 +1019,13 @@ function setStandartSettingsToBlockOverlay () {
|
|||||||
block_overlay.classList.add("hidden")
|
block_overlay.classList.add("hidden")
|
||||||
}
|
}
|
||||||
|
|
||||||
// function show_header_list () {
|
function show_header_list () {
|
||||||
// let el = document.querySelector(".menu_profile_btn")
|
let el = document.querySelector(".menu_profile_btn")
|
||||||
// if (el) {
|
if (el) {
|
||||||
// el.classList.toggle("show")
|
el.classList.toggle("show")
|
||||||
// closeCurtain()
|
// closeCurtain()
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// function closeCurtain (left,right) {
|
// function closeCurtain (left,right) {
|
||||||
// if (left){
|
// if (left){
|
||||||
@@ -883,7 +1034,7 @@ function setStandartSettingsToBlockOverlay () {
|
|||||||
// } else if (right){
|
// } else if (right){
|
||||||
// let right = document.querySelector(".curtain.right")
|
// let right = document.querySelector(".curtain.right")
|
||||||
// open_curtain(null,right,null,'close')
|
// open_curtain(null,right,null,'close')
|
||||||
// } else {
|
// } else {`
|
||||||
// let curtain = getOpenCurtain()
|
// let curtain = getOpenCurtain()
|
||||||
// if (curtain) {
|
// if (curtain) {
|
||||||
// open_curtain(null, null, null, 'close')
|
// open_curtain(null, null, null, 'close')
|
||||||
|
|||||||
27
templates/404.html
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{% extends "tb_base.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class="not_found_wrap">
|
||||||
|
<div class="not_found_text">
|
||||||
|
<div
|
||||||
|
class="not_found_title">
|
||||||
|
404
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="not_found_sub_title">
|
||||||
|
{% translate "Страница не найдена" %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="button_container">
|
||||||
|
<a
|
||||||
|
class="a_btn_standart"
|
||||||
|
href="{% url 'main' %}">
|
||||||
|
{% translate "Вернуться на главную" %}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -10,9 +10,38 @@
|
|||||||
<div class="not_found_routes show">
|
<div class="not_found_routes show">
|
||||||
<div class="text-align-center fw-700 font-large c-txt-b2 m-a w-80 m-t-8p">
|
<div class="text-align-center fw-700 font-large c-txt-b2 m-a w-80 m-t-8p">
|
||||||
{% blocktranslate %}
|
{% blocktranslate %}
|
||||||
Упс... <span class="orange-text">Ничего не найдено</span>, попробуйте
|
Упс... <span class="orange-text">Ничего не найдено</span>, попробуйте
|
||||||
изменить параметры поиска
|
изменить параметры поиска <span class="orange-text"> или создайте своё собственное объявление </span>
|
||||||
{% endblocktranslate %}
|
{% endblocktranslate %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<a
|
||||||
|
id="create_route"
|
||||||
|
{% if owner_type == "mover" %}
|
||||||
|
href="{% url 'profile_page' 'create_route_for_customer' %}"
|
||||||
|
{% elif owner_type == "customer" %}
|
||||||
|
href="{% url 'profile_page' 'create_route_for_mover' %}"
|
||||||
|
{% endif %}
|
||||||
|
>
|
||||||
|
{% translate "Создать объявление" %}
|
||||||
|
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not user.is_authenticated %}
|
||||||
|
<a
|
||||||
|
id="create_route"
|
||||||
|
href="{% url "login_profile" %}"
|
||||||
|
>
|
||||||
|
{% translate " Войти и Создать объявление" %}
|
||||||
|
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<img class="boxes_not_fond_routes left" src="{% static "/img/boxes_for_not_found_routes/b_1.svg" %}">
|
<img class="boxes_not_fond_routes left" src="{% static "/img/boxes_for_not_found_routes/b_1.svg" %}">
|
||||||
<img class="boxes_not_fond_routes right" src="{% static "/img/boxes_for_not_found_routes/b_2.svg" %}">
|
<img class="boxes_not_fond_routes right" src="{% static "/img/boxes_for_not_found_routes/b_2.svg" %}">
|
||||||
|
|||||||
@@ -6,11 +6,15 @@
|
|||||||
<div class="first-column">
|
<div class="first-column">
|
||||||
<div class="footer_logo"><img class="svg" src="/static/img/svg/LogoWhite.svg"></div>
|
<div class="footer_logo"><img class="svg" src="/static/img/svg/LogoWhite.svg"></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="footer_text_sub">{% trans "Подпишись и будь в курсе всех событий, а также получай подарки и бонусы от Trip With Bonus" %}</div>
|
{% if not user.user_profile.mailing_on %}
|
||||||
<div class="footer_input_wrap"><input class="footer_input" type="text" placeholder="{% trans "Введите ваш e-mail" %}">
|
<div class="footer_text_sub">{% trans "Подпишись и будь в курсе всех событий, а также получай подарки и бонусы от Trip With Bonus" %}</div>
|
||||||
<div id="footer_input_button"><img class="svg" src="/static/img/svg/CaretCircleRight.svg"></div>
|
<div class="insert_form">
|
||||||
</div>
|
{% include "forms/f_one_field_form.html" %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="social_media_footer">
|
<div class="social_media_footer">
|
||||||
<a href=""><img class="svg" src="/static/img/svg/Instagram.svg"></a>
|
<a href=""><img class="svg" src="/static/img/svg/Instagram.svg"></a>
|
||||||
<a href=""><img class="svg" src="/static/img/svg/Telegram.svg"></a>
|
<a href=""><img class="svg" src="/static/img/svg/Telegram.svg"></a>
|
||||||
@@ -43,9 +47,9 @@
|
|||||||
<div class="four-column">
|
<div class="four-column">
|
||||||
<div class="footer_text_inform">{% trans "Свяжитесь с нами:" %}</div>
|
<div class="footer_text_inform">{% trans "Свяжитесь с нами:" %}</div>
|
||||||
<div class="footer_text_contact">
|
<div class="footer_text_contact">
|
||||||
<div>
|
{# <div>#}
|
||||||
<a href="tel:+77777777777">+ 7 (777) 777-77-77</a>
|
{# <a href="tel:+77777777777">+ 7 (777) 777-77-77</a>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div>
|
<div>
|
||||||
<a href="mailto:sales@tripwb.com">sales@tripwb.com</a>
|
<a href="mailto:sales@tripwb.com">sales@tripwb.com</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,10 +6,13 @@
|
|||||||
<div class="wrapper_header_content">
|
<div class="wrapper_header_content">
|
||||||
<div class="header-first">
|
<div class="header-first">
|
||||||
<div class="header_logo">
|
<div class="header_logo">
|
||||||
<a href="/"><img class="svg" src="/static/img/svg/Logo.svg"></a>
|
<a href="{% url 'main' %}">
|
||||||
|
<img class="svg" src="/static/img/svg/Logo.svg">
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="header_logo_mobile">
|
<div class="header_logo_mobile">
|
||||||
<a href="/"><img class="svg" src="/static/img/svg/LogoMobile.svg"></a>
|
{# <a href="/"><img class="svg" src="/static/img/svg/LogoMobile.svg"></a>#}
|
||||||
|
<a href="{% url 'main' %}"><img class="svg" src="/static/img/svg/LogoMobile.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
@@ -20,8 +23,8 @@
|
|||||||
>
|
>
|
||||||
|
|
||||||
<a href="/">{% trans "Главная" %}</a>
|
<a href="/">{% trans "Главная" %}</a>
|
||||||
<a href="{% url 'static_page' 'for_movers' %}">{% trans "Для отправителя" %}</a>
|
<a href="{% url 'static_page' 'for_customers' %}">{% trans "Для отправителя" %}</a>
|
||||||
<a href="{% url 'static_page' 'for_customers' %}">{% trans "Для перевозчика" %}</a>
|
<a href="{% url 'static_page' 'for_movers' %}">{% trans "Для перевозчика" %}</a>
|
||||||
<a href="{% url "static_page" "about_service" %}">{% trans "" %}О Trip With Bonus</a>
|
<a href="{% url "static_page" "about_service" %}">{% trans "" %}О Trip With Bonus</a>
|
||||||
<a href="{% url 'static_page' 'contacts' %}">{% trans "Контакты" %}</a>
|
<a href="{% url 'static_page' 'contacts' %}">{% trans "Контакты" %}</a>
|
||||||
<a href="{% url 'static_page' 'advertisement' %}">{% trans "Реклама" %}</a>
|
<a href="{% url 'static_page' 'advertisement' %}">{% trans "Реклама" %}</a>
|
||||||
@@ -52,7 +55,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-second-item">
|
<div class="header-second-item">
|
||||||
<img class="svg" src="/static/img/svg/Helpdesk_%20Icon.svg">
|
<img id="support_img" class="svg" src="/static/img/svg/Helpdesk_%20Icon.svg">
|
||||||
</div>
|
</div>
|
||||||
<div class="header-second-item">
|
<div class="header-second-item">
|
||||||
<a id="customer_service" href="{% url 'static_page' 'customer_service' %}">{% trans "Служба поддержки" %}</a>
|
<a id="customer_service" href="{% url 'static_page' 'customer_service' %}">{% trans "Служба поддержки" %}</a>
|
||||||
@@ -66,17 +69,22 @@
|
|||||||
{# <div class="button_profile_header" onclick="open_curtain(null,'right')" data-user-id="{{ user.id }}">#}
|
{# <div class="button_profile_header" onclick="open_curtain(null,'right')" data-user-id="{{ user.id }}">#}
|
||||||
|
|
||||||
<span class="btn_profile_name">
|
<span class="btn_profile_name">
|
||||||
{{ user.first_name }} {{ user.last_name }}
|
{{ user.first_name|truncatechars:6}} {{ user.last_name|truncatechars:5 }}
|
||||||
</span>
|
</span>
|
||||||
<span id="placeholder1"></span>
|
<span id="placeholder1"></span>
|
||||||
<div class="icon_unread_messages" style="padding-top: 2px;padding-right: 13px;">
|
<div class="icon_unread_messages" style="position:relative;top: 4px;padding-right: 13px;">
|
||||||
<div class="cost-messages-in-user-tab-messenger" style="background: #FFFFFF;">
|
<div class="cost-messages-in-user-tab-messenger" style="background: #FFFFFF;">
|
||||||
<span class="unredmessages_value_text" style="padding-top: 2px;padding-left: 0; color: #000000;"></span>
|
<span class="unredmessages_value_text" style="padding-top: 2px;padding-left: 0;position: relative;top: -8px;color: #FF613A;"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="button_profile_header_mobile" onclick="open_curtain_w_btn_profile()">
|
<div class="button_profile_header_mobile" onclick="open_curtain_w_btn_profile()">
|
||||||
|
<div class="marker_messages_mobile hide"></div>
|
||||||
<img src="/static/img/svg/userMobile.svg" alt="">
|
<img src="/static/img/svg/userMobile.svg" alt="">
|
||||||
|
{# <div class="icon_unread_messages" style="position:absolute;right: 5px;top: 0;">#}
|
||||||
|
{# <div class="cost-messages-in-user-tab-messenger" style="background: #ff0000;">#}
|
||||||
|
{# </div>#}
|
||||||
|
{# </div>#}
|
||||||
</div>
|
</div>
|
||||||
{# <div class="menu_profile_btn">#}
|
{# <div class="menu_profile_btn">#}
|
||||||
{# {% if user_subscribe %}<div class="subscribe_type_txt"><span class="f-l">Подписка:</span> <span class="f-r">{{ user_subscribe.subscribe.name }}</span><div class="clear_both"></div></div>{% endif %}#}
|
{# {% if user_subscribe %}<div class="subscribe_type_txt"><span class="f-l">Подписка:</span> <span class="f-r">{{ user_subscribe.subscribe.name }}</span><div class="clear_both"></div></div>{% endif %}#}
|
||||||
@@ -110,6 +118,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="button_profile_header_mobile" onclick="show_header_list()">
|
<div class="button_profile_header_mobile" onclick="show_header_list()">
|
||||||
|
<div class="marker_messages_mobile hide"></div>
|
||||||
<img src="/static/img/svg/userMobile.svg" alt="">
|
<img src="/static/img/svg/userMobile.svg" alt="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
{%trans "Написать сообщение" as t_chats %}
|
{%trans "Написать сообщение" as t_chats %}
|
||||||
{%trans "Тех. поддержка" as t_support %}
|
{%trans "Тех. поддержка" as t_support %}
|
||||||
{%trans "Моя подписка" as t_subscribe %}
|
{%trans "Моя подписка" as t_subscribe %}
|
||||||
{%trans "Мой профиль" as t_change_profile %}
|
{%trans "Изменить профиль" as t_change_profile %}
|
||||||
{%trans "Выход" as t_logout %}
|
{%trans "Выход" as t_logout %}
|
||||||
|
|
||||||
<div class="menu_profile {% if not page_type == 'profile' %}background{% endif %}">
|
<div class="menu_profile {% if not page_type == 'profile' %}background{% endif %}">
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
{# {% if page_name == 'change_profile' %}#}
|
{# {% if page_name == 'change_profile' %}#}
|
||||||
{# class="selected"#}
|
{# class="selected"#}
|
||||||
{# {% endif %}>#}
|
{# {% endif %}>#}
|
||||||
{# <img class="svg" src="/static/img/svg/User.svg">#}
|
{# <img class="svg" src="/static/img/svg/user_icon_standart.png">#}
|
||||||
{# <a href="{% url "profile_page" "change_profile" %}">Мой профиль</a>#}
|
{# <a href="{% url "profile_page" "change_profile" %}">Мой профиль</a>#}
|
||||||
{# </div>#}
|
{# </div>#}
|
||||||
{# <div>#}
|
{# <div>#}
|
||||||
|
|||||||
@@ -7,11 +7,18 @@
|
|||||||
<div class="container_block_list_of_users">
|
<div class="container_block_list_of_users">
|
||||||
{% include 'blocks/profile/b_list_of_users_messenger.html' %}
|
{% include 'blocks/profile/b_list_of_users_messenger.html' %}
|
||||||
</div>
|
</div>
|
||||||
<div class="handler_menu close" onclick="open_curtain_w_contacts()">
|
{# <div class="handler_menu close" onclick="open_curtain_w_contacts()">#}
|
||||||
<img class="btns_f_curtain close left" src="{% static 'img/svg/arrow_f_curtain.svg' %}">
|
{# <img class="btns_f_curtain close left" src="{% static 'img/svg/arrow_f_curtain.svg' %}">#}
|
||||||
<div class="text_f_curtain left"><img style='width: 25px;display: block;position: relative;bottom: 0;transform: rotate(270deg);' src='{% static "/img/svg/users-solid.svg" %}'></div>
|
{# <div class="text_f_curtain left"><img style='width: 25px;display: block;position: relative;bottom: 0;transform: rotate(270deg);' src='{% static "/img/svg/users-solid.svg" %}'></div>#}
|
||||||
<img class="btns_f_curtain close right" src="{% static 'img/svg/arrow_f_curtain.svg' %}">
|
{# <img class="btns_f_curtain close right" src="{% static 'img/svg/arrow_f_curtain.svg' %}">#}
|
||||||
<div class="clear_both"></div>
|
{# <div class="clear_both"></div>#}
|
||||||
|
{# </div>#}
|
||||||
|
</div>
|
||||||
|
<div class="handler_curtain_left {% if not cur_receiver %}open{% else %}close{% endif %}" onclick="open_curtain_w_contacts()">
|
||||||
|
<div class="container_content_handler_curtain_left">
|
||||||
|
<img class="arrows_handler_curtain_left" src="{% static 'img/svg/arrow_f_curtain.svg' %}">
|
||||||
|
<img class="filter_img" src='{% static "/img/svg/users-solid.svg" %}'>
|
||||||
|
<img class="arrows_handler_curtain_left" src="{% static 'img/svg/arrow_f_curtain.svg' %}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{#<div class="title-profile-cont">#}
|
{#<div class="title-profile-cont">#}
|
||||||
@@ -60,16 +67,18 @@
|
|||||||
|
|
||||||
<div class="container-header-chat">
|
<div class="container-header-chat">
|
||||||
<div class="header-chat-left-part">
|
<div class="header-chat-left-part">
|
||||||
<img class="chat-avatar" {% if cur_receiver.user_profile.avatar %}src="{{ cur_receiver.user_profile.avatar.url }}"{% else %}src="{% static "img/svg/User.svg" %}"{% endif %}>
|
<img class="chat-avatar" {% if cur_receiver.user_profile.avatar %}src="{{ cur_receiver.user_profile.avatar.url }}"{% else %}src="{% static "img/svg/user_icon_standart.png" %}"{% endif %}>
|
||||||
{# <span class="chat-username">{{ ticket.manager.last_name }} {{ ticket.manager.first_name }}</span>#}
|
{# <span class="chat-username">{{ ticket.manager.last_name }} {{ ticket.manager.first_name }}</span>#}
|
||||||
<span class="chat-username">{{ cur_receiver.last_name }} {{ cur_receiver.first_name }}</span>
|
<span class="chat-username">{{ cur_receiver.last_name }} {{ cur_receiver.first_name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-chat-right-part">
|
<div class="header-chat-right-part">
|
||||||
<img class="header-icons-right-part-padding" src="{% static "img/svg/phone.svg" %}">
|
<a href="tel:{{ cur_receiver.user_profile.phone }}">
|
||||||
<img class="header-icons-right-part-padding" src="{% static "img/svg/info.svg" %}">
|
<img class="header-icons-right-part-padding" src="{% static "img/svg/phone.svg" %}">
|
||||||
|
</a>
|
||||||
|
{# <img class="header-icons-right-part-padding" src="{% static "img/svg/info.svg" %}">#}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom_part_of_chats">
|
{# <div class="bottom_part_of_chats">#}
|
||||||
<div class="container-messages" data-user-id="{{ user.id }}" data-cur-receiver="{{ cur_receiver.id }}" data-ticket-id="null" >
|
<div class="container-messages" data-user-id="{{ user.id }}" data-cur-receiver="{{ cur_receiver.id }}" data-ticket-id="null" >
|
||||||
{% include "blocks/profile/b_messages_container.html" %}
|
{% include "blocks/profile/b_messages_container.html" %}
|
||||||
</div>
|
</div>
|
||||||
@@ -88,7 +97,7 @@
|
|||||||
{# <button class="send-message" onclick="send_ws_msg('message')"></button>#}
|
{# <button class="send-message" onclick="send_ws_msg('message')"></button>#}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{%trans "Тема запроса" as p_create_ticket %}
|
{%trans "Тема запроса" as p_create_ticket %}
|
||||||
<form class="form-create-ticket" name="create-ticket">
|
<form class="form-create-ticket" name="create-ticket">
|
||||||
|
|
||||||
{% if errors.all__ %}<div class="errors_all" style="margin-bottom: 12px;width: 100%;font-size: 16px;">{{ errors.all__ }}</div>{% endif %}
|
{% if form.errors.all__ %}<div class="errors_all" style="margin-bottom: 12px;width: 100%;font-size: 16px;">{{ form.errors.all__ }}</div>{% endif %}
|
||||||
|
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="container-input-form-create-ticket">
|
<div class="container-input-form-create-ticket">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load tz %}
|
||||||
|
|
||||||
{#{% include "widgets/w_file.html" %}#}
|
{#{% include "widgets/w_file.html" %}#}
|
||||||
{% if not messages and ticket %}
|
{% if not messages and ticket %}
|
||||||
@@ -8,7 +8,9 @@
|
|||||||
{% for msg in messages %}
|
{% for msg in messages %}
|
||||||
{% include "widgets/w_message.html" %}
|
{% include "widgets/w_message.html" %}
|
||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
<span style="display: none" class="date_n_time_last_message" data-modifiedDT="{{ msg.modifiedDT|date:"d.m.Y H:i:s:u" }}"></span>
|
{% timezone user_tz %}
|
||||||
|
<span style="display: none" class="date_n_time_last_message" data-modifiedDT="{{ msg.modifiedDT|date:"d.m.Y H:i:s:u" }}"></span>
|
||||||
|
{% endtimezone %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
{# </div>#}
|
{# </div>#}
|
||||||
|
|
||||||
|
|
||||||
|
{# <label for="id_type_transport">{% translate "Выберите способ перевозки" %}</label>#}
|
||||||
<select
|
<select
|
||||||
onchange="OnSelectionChange(this)"
|
onchange="OnSelectionChange(this)"
|
||||||
name="type_transport"
|
name="type_transport"
|
||||||
@@ -56,11 +56,32 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{# <input id="hide_owner_type" type="hidden" value="{{ form.initial.owner_type }}">#}
|
||||||
|
<input
|
||||||
|
id="hide_owner_type"
|
||||||
|
type="hidden"
|
||||||
|
{% if form.initial.owner_type %}
|
||||||
|
value="{{ form.initial.owner_type }}"
|
||||||
|
{% elif form.data.owner_type %}
|
||||||
|
value="{{ form.data.owner_type }}"
|
||||||
|
{% endif %}
|
||||||
|
>
|
||||||
|
|
||||||
{% if form.initial and form.initial.type_transport and form.initial.type_transport != '' %}
|
{% if form.initial and form.initial.type_transport and form.initial.type_transport != '' %}
|
||||||
<hr>
|
<hr>
|
||||||
<div class="departure_arrival">
|
<div class="departure_arrival">
|
||||||
<div class="wrap_left">
|
<div class="wrap_left">
|
||||||
<label for="id_departure_DT">{{ form.fields.departure_DT.label }}</label>
|
<label for="id_departure_DT">
|
||||||
|
|
||||||
|
{% if form.initial.owner_type == 'mover' and form.initial.type_transport == 'road' or form.data.owner_type == 'mover' and form.initial.type_transport == 'road' %}
|
||||||
|
{% translate "Дата и время выезда" %}
|
||||||
|
{% elif form.initial.owner_type == 'mover' and form.initial.type_transport == 'avia' or form.data.owner_type == 'mover' and form.initial.type_transport == 'avia' %}
|
||||||
|
{% translate "Дата и время вылета" %}
|
||||||
|
{% elif form.initial.owner_type == 'customer' or form.data.owner_type == 'customer' %}
|
||||||
|
{% translate "Дата и время отправки" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
{# <input#}
|
{# <input#}
|
||||||
@@ -75,16 +96,33 @@
|
|||||||
{# {% if form.initial.departure_DT %}value="{{ form.initial.departure_DT.date|date:"Y-m-d" }}T{{ form.initial.departure_DT.time|date:"H:i" }}"{% endif %}#}
|
{# {% if form.initial.departure_DT %}value="{{ form.initial.departure_DT.date|date:"Y-m-d" }}T{{ form.initial.departure_DT.time|date:"H:i" }}"{% endif %}#}
|
||||||
{# />#}
|
{# />#}
|
||||||
{# boris change input #}
|
{# boris change input #}
|
||||||
<input class="el_form_b_new_route" onchange="checkDate()" type="text" id="id_departure_DT" name="departure_DT" placeholder="{% translate "Выберите дату и время" %}" {% if form.initial.departure_DT %} value="{{ form.initial.departure_DT|date:"y.m.d H:m" }}"{% endif %}/>
|
<input
|
||||||
|
class="el_form_b_new_route"
|
||||||
|
{# onchange="checkDate()"#}
|
||||||
|
{# onclick="setIcon(this)"#}
|
||||||
|
onmouseup="hideErrors(this)"
|
||||||
|
type="text"
|
||||||
|
id="id_departure_DT"
|
||||||
|
name="departure_DT"
|
||||||
|
placeholder="{% translate "Выберите дату и время" %}" {% if form.initial.departure_DT %}
|
||||||
|
value="{{ form.initial.departure_DT|date:"d.m.Y H:m" }}"{% endif %}/>
|
||||||
<div id="displayRegervation"></div>
|
<div id="displayRegervation"></div>
|
||||||
|
|
||||||
{% if not errors_off and form.errors and form.errors.departure_DT %}
|
{% if not errors_off and form.errors and form.errors.departure_DT %}
|
||||||
<span>{{ form.errors.departure_DT }}</span>
|
<span id="error_departure_DT">{{ form.errors.departure_DT }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="arrival_div">
|
<div id="arrival_div">
|
||||||
<label for="id_arrival_DT">{{ form.fields.arrival_DT.label }}</label>
|
<label for="id_arrival_DT">
|
||||||
|
|
||||||
|
{% if form.initial.owner_type == 'mover' or form.data.owner_type == 'mover'%}
|
||||||
|
{% translate "Дата и время прибытия" %}
|
||||||
|
{% elif form.initial.owner_type == 'customer' or form.data.owner_type == 'customer' %}
|
||||||
|
{% translate "Дата и время доставки посылки" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</label>
|
||||||
{# <input#}
|
{# <input#}
|
||||||
{# type="datetime-local"#}
|
{# type="datetime-local"#}
|
||||||
{# min= {% now "Y-m-d" %}T{% now "H:i" %}#}
|
{# min= {% now "Y-m-d" %}T{% now "H:i" %}#}
|
||||||
@@ -96,12 +134,20 @@
|
|||||||
{# {% if form.initial.arrival_DT %}value="{{ form.initial.arrival_DT.date|date:"Y-m-d" }}T{{ form.initial.arrival_DT.time|date:"H:i" }}"{% endif %}#}
|
{# {% if form.initial.arrival_DT %}value="{{ form.initial.arrival_DT.date|date:"Y-m-d" }}T{{ form.initial.arrival_DT.time|date:"H:i" }}"{% endif %}#}
|
||||||
{# />#}
|
{# />#}
|
||||||
{# boris change input #}
|
{# boris change input #}
|
||||||
<input class="el_form_b_new_route" onchange="checkDate()" type="text" id="id_arrival_DT" name="arrival_DT" placeholder="{% translate "Выберите дату и время" %}" {% if form.initial.arrival_DT %} value="{{ form.initial.arrival_DT|date:"y.m.d H:m" }}"{% endif %}/>
|
<input
|
||||||
|
class="el_form_b_new_route"
|
||||||
|
onchange="checkDate()"
|
||||||
|
onmouseup="hideErrors(this)"
|
||||||
|
type="text"
|
||||||
|
id="id_arrival_DT"
|
||||||
|
name="arrival_DT"
|
||||||
|
placeholder="{% translate "Выберите дату и время" %}" {% if form.initial.arrival_DT %}
|
||||||
|
value="{{ form.initial.arrival_DT|date:"d.m.Y H:m" }}"{% endif %}/>
|
||||||
|
|
||||||
<div id="displayRegervation"></div>
|
<div id="displayRegervation"></div>
|
||||||
{# end #}
|
{# end #}
|
||||||
{% if not errors_off and form.errors and form.errors.arrival_DT %}
|
{% if not errors_off and form.errors and form.errors.arrival_DT %}
|
||||||
<span>{{ form.errors.arrival_DT }}</span>
|
<span id="error_arrival_DT">{{ form.errors.arrival_DT }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="clear_both"></div>
|
<div class="clear_both"></div>
|
||||||
@@ -109,7 +155,15 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="from_to_country">
|
<div class="from_to_country">
|
||||||
<div class="from_country_container">
|
<div class="from_country_container">
|
||||||
<label for="id_from_address_point_txt">{{ form.fields.from_address_point.label }}</label>
|
<label for="id_from_address_point_txt">
|
||||||
|
{% if form.initial.owner_type == 'mover' and form.initial.type_transport == 'avia' or form.data.owner_type == 'mover' and form.initial.type_transport == 'avia' %}
|
||||||
|
{% translate "Пункт вылета" %}
|
||||||
|
{% elif form.initial.owner_type == 'mover' and form.initial.type_transport == 'road' or form.data.owner_type == 'mover' and form.initial.type_transport == 'road' %}
|
||||||
|
{% translate "Пункт выезда" %}
|
||||||
|
{% elif form.initial.owner_type == 'customer' or form.data.owner_type == 'customer' %}
|
||||||
|
{% translate "Пункт отправки" %}
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
name="from_address_point"
|
name="from_address_point"
|
||||||
@@ -122,15 +176,16 @@
|
|||||||
oninput="searchTown(this)"
|
oninput="searchTown(this)"
|
||||||
onclick="showSearchList(this)"
|
onclick="showSearchList(this)"
|
||||||
onblur="onblurInputField(event, this)"
|
onblur="onblurInputField(event, this)"
|
||||||
onFocus="this.select()"
|
onfocus="clearID(this)"
|
||||||
|
onkeydown = "hideErrors(this)"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
type="text"
|
type="text"
|
||||||
minlength="3"
|
minlength="3"
|
||||||
|
|
||||||
name="from_address_point_txt"
|
name="from_address_point_txt"
|
||||||
class="from_address_point_txt post_route el_form_b_new_route"
|
class="from_address_point_txt post_route el_form_b_new_route"
|
||||||
{% if form.fields.from_address_point.required %} required{% endif %}
|
{% if form.fields.from_address_point.required %} required{% endif %}
|
||||||
id="id_from_address_point_txt"
|
id="id_from_address_point_txt"
|
||||||
|
placeholder="{% translate "Выберите страну и город" %}"
|
||||||
{% if form.initial.from_address_point_txt %}value="{{ form.initial.from_address_point_txt }}"{% endif %}
|
{% if form.initial.from_address_point_txt %}value="{{ form.initial.from_address_point_txt }}"{% endif %}
|
||||||
/>
|
/>
|
||||||
<datalist id="from_address_point">
|
<datalist id="from_address_point">
|
||||||
@@ -141,11 +196,19 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% if not errors_off and form.errors and form.errors.from_address_point %}
|
{% if not errors_off and form.errors and form.errors.from_address_point %}
|
||||||
<span>{{ form.errors.from_address_point}}</span>
|
<span id="error_from_address_point">{{ form.errors.from_address_point}}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap_right">
|
<div class="wrap_right">
|
||||||
<label for="id_to_address_point_txt">{{ form.fields.to_address_point.label }}</label>
|
<label for="id_to_address_point_txt">
|
||||||
|
{% if form.initial.owner_type == 'mover' and form.initial.type_transport == 'avia' or form.data.owner_type == 'mover' and form.initial.type_transport == 'avia' %}
|
||||||
|
{% translate "Пункт прилета" %}
|
||||||
|
{% elif form.initial.owner_type == 'mover' and form.initial.type_transport == 'road' or form.data.owner_type == 'mover' and form.initial.type_transport == 'road' %}
|
||||||
|
{% translate "Пункт приезда" %}
|
||||||
|
{% elif form.initial.owner_type == 'customer' or form.data.owner_type == 'customer'%}
|
||||||
|
{% translate "Пункт прибытия" %}
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
name="to_address_point"
|
name="to_address_point"
|
||||||
@@ -158,14 +221,15 @@
|
|||||||
oninput="searchTown(this)"
|
oninput="searchTown(this)"
|
||||||
onclick="showSearchList(this)"
|
onclick="showSearchList(this)"
|
||||||
onblur="onblurInputField(event, this)"
|
onblur="onblurInputField(event, this)"
|
||||||
|
onkeydown = "hideErrors(this)"
|
||||||
onFocus="this.select()"
|
onfocus="clearID(this)"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
type="text"
|
type="text"
|
||||||
name="to_address_point_txt"
|
name="to_address_point_txt"
|
||||||
{% if form.fields.to_address_point.required %} required{% endif %}
|
{% if form.fields.to_address_point.required %} required{% endif %}
|
||||||
id="id_to_address_point_txt"
|
id="id_to_address_point_txt"
|
||||||
class="to_address_point_txt post_route el_form_b_new_route"
|
class="to_address_point_txt post_route el_form_b_new_route"
|
||||||
|
placeholder="{% translate "Выберите страну и город" %}"
|
||||||
{% if form.initial.to_address_point_txt %}value="{{ form.initial.to_address_point_txt}}"{% endif %}
|
{% if form.initial.to_address_point_txt %}value="{{ form.initial.to_address_point_txt}}"{% endif %}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
@@ -173,7 +237,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% if not errors_off and form.errors and form.errors.to_address_point %}
|
{% if not errors_off and form.errors and form.errors.to_address_point %}
|
||||||
<span>{{ form.errors.to_address_point }}</span>
|
<span id="error_to_address_point">{{ form.errors.to_address_point }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="clear_both"></div>
|
<div class="clear_both"></div>
|
||||||
@@ -189,7 +253,13 @@
|
|||||||
{# </div>#}
|
{# </div>#}
|
||||||
<div class="from_to_place">
|
<div class="from_to_place">
|
||||||
<div class="wrap_left">
|
<div class="wrap_left">
|
||||||
<label for="id_from_place">{{ form.fields.from_place.label }}</label>
|
<label for="id_from_place">
|
||||||
|
{% if form.initial.owner_type == 'mover' or form.data.owner_type == 'mover' %}
|
||||||
|
{% translate "Откуда можете забрать?" %}
|
||||||
|
{% elif form.initial.owner_type == 'customer' or form.data.owner_type == 'customer' %}
|
||||||
|
{% translate "Откуда нужно забрать посылку?" %}
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
<select
|
<select
|
||||||
class="custom_select el_form_b_new_route"
|
class="custom_select el_form_b_new_route"
|
||||||
name="from_place"
|
name="from_place"
|
||||||
@@ -208,7 +278,13 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap_right">
|
<div class="wrap_right">
|
||||||
<label for="id_to_place">{{ form.fields.to_place.label }}</label>
|
<label for="id_to_place">
|
||||||
|
{% if form.initial.owner_type == 'mover' or form.data.owner_type == 'mover' %}
|
||||||
|
{% translate "Куда можете доставить?" %}
|
||||||
|
{% elif form.initial.owner_type == 'customer' or form.data.owner_type == 'customer' %}
|
||||||
|
{% translate "Куда нужно доставить посылку?" %}
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
<select
|
<select
|
||||||
name="to_place"
|
name="to_place"
|
||||||
id="id_to_place"
|
id="id_to_place"
|
||||||
@@ -231,7 +307,12 @@
|
|||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label>{{ form.fields.cargo_type.label }}</label>
|
<label>{% if form.initial.owner_type == 'mover' or form.data.owner_type == 'mover' %}
|
||||||
|
{% translate "Могу перевезти:" %}
|
||||||
|
{% elif form.initial.owner_type == 'customer' or form.data.owner_type == 'customer' %}
|
||||||
|
{% translate "Что нужно перевезти?" %}
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -246,6 +327,7 @@
|
|||||||
class="custom-checkbox cargo_check"
|
class="custom-checkbox cargo_check"
|
||||||
type="radio"
|
type="radio"
|
||||||
name="cargo_type"
|
name="cargo_type"
|
||||||
|
|
||||||
id="id_cargo_type_{{ forloop.counter }}"
|
id="id_cargo_type_{{ forloop.counter }}"
|
||||||
{% if form.fields.cargo_type.required %} required{% endif %}
|
{% if form.fields.cargo_type.required %} required{% endif %}
|
||||||
value="{{ item.0 }}"
|
value="{{ item.0 }}"
|
||||||
@@ -255,7 +337,8 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<label
|
<label
|
||||||
|
onmousedown="hideErrors(this)"
|
||||||
|
id="id_cargo_lable"
|
||||||
for="id_cargo_type_{{ forloop.counter }}" >
|
for="id_cargo_type_{{ forloop.counter }}" >
|
||||||
<span>{{ item.1 }}</span>
|
<span>{{ item.1 }}</span>
|
||||||
</label>
|
</label>
|
||||||
@@ -264,7 +347,7 @@
|
|||||||
|
|
||||||
|
|
||||||
{% if not errors_off and form.errors and form.errors.cargo_type %}
|
{% if not errors_off and form.errors and form.errors.cargo_type %}
|
||||||
<span>{{ form.errors.cargo_type }}</span>
|
<span id="error_cargo_type">{{ form.errors.cargo_type }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -314,6 +397,7 @@
|
|||||||
<input
|
<input
|
||||||
type="phone"
|
type="phone"
|
||||||
name="phone"
|
name="phone"
|
||||||
|
onkeydown="hideErrors(this)"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
maxlength="13"
|
maxlength="13"
|
||||||
minlength="11"
|
minlength="11"
|
||||||
@@ -325,7 +409,7 @@
|
|||||||
|
|
||||||
/>
|
/>
|
||||||
{% if not errors_off and form.errors and form.errors.phone %}
|
{% if not errors_off and form.errors and form.errors.phone %}
|
||||||
<span>{{ form.errors.phone }}</span>
|
<span id="error_id_phone">{{ form.errors.phone|safe }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -355,7 +439,13 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<input type="checkbox" name="receive_msg_by_email" class="custom-checkbox" id="id_receive_msg_by_email">
|
<input type="checkbox"
|
||||||
|
name="receive_msg_by_email"
|
||||||
|
class="custom-checkbox"
|
||||||
|
{% if form.initial.receive_msg_by_email == True %}
|
||||||
|
checked="checked"
|
||||||
|
{% endif %}
|
||||||
|
id="id_receive_msg_by_email">
|
||||||
<label for="id_receive_msg_by_email">
|
<label for="id_receive_msg_by_email">
|
||||||
<div class="receive_msg_by_email">{{ form.fields.receive_msg_by_email.label }}</div>
|
<div class="receive_msg_by_email">{{ form.fields.receive_msg_by_email.label }}</div>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="upload_photo_container">
|
<div class="upload_photo_container">
|
||||||
<img class="avatar_user_profile" {% if user.user_profile.avatar %}
|
<img class="avatar_user_profile" {% if user.user_profile.avatar %}
|
||||||
src="{{ user.user_profile.avatar.url }}"
|
src="{{ user.user_profile.avatar.url }}"
|
||||||
{% else %}src="{% static "img/svg/User.svg" %}"{% endif %} >
|
{% else %}src="{% static "img/svg/user_icon_standart.png" %}"{% endif %} >
|
||||||
<input type="file" onchange="upload_photo_f_profile(this)" class="btn_f_upload_photo" id="id_btn_f_upload_photo">
|
<input type="file" onchange="upload_photo_f_profile(this)" class="btn_f_upload_photo" id="id_btn_f_upload_photo">
|
||||||
<label class="upload_photo_label" for="id_btn_f_upload_photo">{% translate "Загрузить фото" %}</label>
|
<label class="upload_photo_label" for="id_btn_f_upload_photo">{% translate "Загрузить фото" %}</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -35,13 +35,13 @@
|
|||||||
{% if profileForm.errors.lastname %}<div class="error_form_profile">{{ profileForm.errors.lastname }}</div>{% endif %}
|
{% if profileForm.errors.lastname %}<div class="error_form_profile">{{ profileForm.errors.lastname }}</div>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="container_el_form_profile">
|
<div class="container_el_form_profile">
|
||||||
<label class="label_f_profile" for="id_tel">{% if profileForm.fields.tel.required %}<span class="orange-text">*</span>{% endif %}{% translate "Номер телефона" %} </label>
|
<label class="label_f_profile" for="id_tel">{% translate "Номер телефона" %} </label>
|
||||||
<input class="input_f_profile" type="text" id="id_tel" name="tel" {% if profileForm.initial.tel %}value="{{ profileForm.initial.tel }}" {% endif %} {% if profileForm.initial.tel %}data-initial-value="{{ profileForm.initial.tel }}"{% else %}data-initial-value=""{% endif %}>
|
<input class="input_f_profile" type="text" id="id_tel" name="tel" {% if profileForm.initial.tel %}value="{{ profileForm.initial.tel }}" {% endif %} {% if profileForm.initial.tel %}data-initial-value="{{ profileForm.initial.tel }}"{% else %}data-initial-value=""{% endif %}>
|
||||||
{% if profileForm.errors.tel %}<div class="error_form_profile">{{ profileForm.errors.tel }}</div>{% endif %}
|
{% if profileForm.errors.tel %}<div class="error_form_profile">{{ profileForm.errors.tel|safe }}</div>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="container_el_form_profile">
|
<div class="container_el_form_profile">
|
||||||
<label class="label_f_profile" for="id_email">{% if profileForm.fields.email.required %}<span class="orange-text">*</span>{% endif %} E-mail</label>
|
<label class="label_f_profile" for="id_email">E-mail</label>
|
||||||
<input class="input_f_profile" type="text" id="id_email" name="email" {% if profileForm.initial.email %}value="{{ profileForm.initial.email }}" {% endif %} {% if profileForm.initial.email %}data-initial-value="{{ profileForm.initial.email }}"{% else %}data-initial-value=""{% endif %}>
|
<input class="input_f_profile grey" type="text" id="id_email" name="email" readonly {% if profileForm.initial.email %}value="{{ profileForm.initial.email }}" {% endif %} {% if profileForm.initial.email %}data-initial-value="{{ profileForm.initial.email }}"{% else %}data-initial-value=""{% endif %}>
|
||||||
{% if profileForm.errors.email %}<div class="error_form_profile">{{ profileForm.errors.email }}</div>{% endif %}
|
{% if profileForm.errors.email %}<div class="error_form_profile">{{ profileForm.errors.email }}</div>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="container_el_form_profile">
|
<div class="container_el_form_profile">
|
||||||
@@ -58,14 +58,23 @@
|
|||||||
<div class="line_f_form_profile"></div>
|
<div class="line_f_form_profile"></div>
|
||||||
|
|
||||||
<div class="container_el_form_profile">
|
<div class="container_el_form_profile">
|
||||||
<label class="label_f_profile" for="id_password">{% if profileForm.fields.password.required %}<span class="orange-text">*</span>{% endif %}{% translate "Новый пароль" %} </label>
|
<label class="label_f_profile" for="id_password">{% translate "Новый пароль" %} </label>
|
||||||
<input class="input_f_profile" type="text" id="id_password" name="password" {% if profileForm.initial.password %}value="{{ profileForm.initial.password }}" {% endif %} {% if profileForm.initial.password %}data-initial-value="{{ profileForm.initial.password }}"{% else %}data-initial-value=""{% endif %}>
|
<input class="input_f_profile" type="text" id="id_password" name="password" {% if profileForm.initial.password %}value="{{ profileForm.initial.password }}" {% endif %} {% if profileForm.initial.password %}data-initial-value="{{ profileForm.initial.password }}"{% else %}data-initial-value=""{% endif %}>
|
||||||
</div>
|
</div>
|
||||||
<div class="container_el_form_profile">
|
<div class="container_el_form_profile">
|
||||||
<label class="label_f_profile" for="id_confirm_password">{% if profileForm.fields.confirm_password.required %}<span class="orange-text">*</span>{% endif %}{% translate "Подтвердить пароль" %} </label>
|
<label class="label_f_profile" for="id_confirm_password">{% translate "Подтвердить пароль" %} </label>
|
||||||
<input class="input_f_profile" type="text" id="id_confirm_password" name="confirm_password" {% if profileForm.initial.confirm_password %}value="{{ profileForm.initial.confirm_password }}" {% endif %} {% if profileForm.initial.confirm_password %}data-initial-value="{{ profileForm.initial.confirm_password }}"{% else %}data-initial-value=""{% endif %}>
|
<input class="input_f_profile" type="text" id="id_confirm_password" name="confirm_password" {% if profileForm.initial.confirm_password %}value="{{ profileForm.initial.confirm_password }}" {% endif %} {% if profileForm.initial.confirm_password %}data-initial-value="{{ profileForm.initial.confirm_password }}"{% else %}data-initial-value=""{% endif %}>
|
||||||
</div>
|
</div>
|
||||||
<button class="confirm_profile_btn" onclick="change_profile_confirm(this)">{% translate "Сохарнить" %}</button>
|
<button class="confirm_profile_btn" onclick="change_profile_confirm(this)">
|
||||||
|
<p id="save_changes_txt">
|
||||||
|
{% translate "Сохарнить" %}
|
||||||
|
</p>
|
||||||
|
<p id="changes_saved_txt">
|
||||||
|
{% translate "Изменения сохранены" %}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
<h1>{% translate "Добро пожаловать:" %} <span class="user_first_name">{{ user.first_name }} {{ user.last_name }}</span> <span class="user_username" >({{ user.username }})</span></h1>
|
<h1 class="title_b_first_page">{% translate "Добро пожаловать:" %} <span class="user_first_name">{{ user.first_name }} {{ user.last_name }}</span> <span class="user_username" >({{ user.username }})</span></h1>
|
||||||
<div class="profile_prof"><img class="avatar_user_profile" {% if user.user_profile.avatar %}
|
<div class="profile_prof"><img class="avatar_user_profile" {% if user.user_profile.avatar %}
|
||||||
src="{{ user.user_profile.avatar.url }}"
|
src="{{ user.user_profile.avatar.url }}"
|
||||||
{% else %}src="{% static "img/svg/User.svg" %}"{% endif %} alt="">
|
{% else %}src="{% static "img/svg/user_icon_standart.png" %}"{% endif %} alt="">
|
||||||
<div>
|
<div>
|
||||||
{# <div class="avatar_block">#}
|
{# <div class="avatar_block">#}
|
||||||
{# <img class="avatar_user_profile" {% if user.user_profile.avatar %}#}
|
{# <img class="avatar_user_profile" {% if user.user_profile.avatar %}#}
|
||||||
{# src="{{ user.user_profile.avatar.url }}"#}
|
{# src="{{ user.user_profile.avatar.url }}"#}
|
||||||
{# {% else %}src="{% static "img/svg/User.svg" %}"{% endif %} >#}
|
{# {% else %}src="{% static "img/svg/user_icon_standart.png" %}"{% endif %} >#}
|
||||||
{# </div>#}
|
{# </div>#}
|
||||||
{# <div>{% translate "Статус:" %} {{ user.user_profile.get_account_type_display }}</div>#}
|
{# <div>{% translate "Статус:" %} {{ user.user_profile.get_account_type_display }}</div>#}
|
||||||
{# <div>#}
|
{# <div>#}
|
||||||
@@ -21,5 +21,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{# <div class="advice_text">{% translate "Если хотите отправить посылку - зарегистрируйтесь, как отправитель" %}</div>#}
|
{# <div class="advice_text">{% translate "Если хотите отправить посылку - зарегистрируйтесь, как отправитель" %}</div>#}
|
||||||
<div class="prof_first_line">{% translate "Если у Вас возникнут вопросы Вы можете связаться с нами:" %} <a href="mailto:support@twb.com">support@twb.com</a></div>
|
<div class="prof_first_line">{% translate "Если у Вас возникнут вопросы Вы можете связаться с нами:" %} <a href="mailto:support@twb.com">support@twb.com</a></div>
|
||||||
{# <div class="prof_second_line">{% translate "У Вас" %} <a href="#">{% translate "три " %}</a>{% translate "новых сообщения." %} <a href="#">{% translate "Посмотреть" %}</a></div>#}
|
<div class="prof_second_line">
|
||||||
|
{% blocktrans %}У Вас {{ unanswered_msgs_count }} новых сообщений{% endblocktrans %}
|
||||||
|
<a onclick="select_tab_profile(this,'chats'{% if owner_type %},'{{ owner_type }}'{% endif %})"onclick="clickONTHEAPROfileBTN(this)">{% translate "Посмотреть" %}</a>
|
||||||
|
</div>
|
||||||
{# <div class="prof_third_line">{% translate "Хотите получать уведомление о появлении посылок?" %} <a href="#">{% translate "Заполните форму" %}</a></div>#}
|
{# <div class="prof_third_line">{% translate "Хотите получать уведомление о появлении посылок?" %} <a href="#">{% translate "Заполните форму" %}</a></div>#}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
<div class="title-profile-cont">
|
{#<div class="title-profile-cont">#}
|
||||||
{% translate "Подписка" %}
|
{# {% translate "Подписка" %}#}
|
||||||
</div>
|
{#</div>#}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
|||||||