Compare commits
4 Commits
ec495fd2f0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d5ef92f91d | |||
| c4d788bc9f | |||
| 07127e3672 | |||
| 62adc75161 |
@@ -1,12 +1,12 @@
|
||||
# coding=utf-8
|
||||
from django.conf.urls import url
|
||||
from django.urls import path
|
||||
# from AuthApp.js_views import *
|
||||
# from AuthApp.import_funcs import *
|
||||
from AuthApp.views import *
|
||||
from .views import *
|
||||
from django.contrib.auth import views
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
path('login', login_View, name='login')
|
||||
# ajax ----------------
|
||||
# url(r'^login$', user_login_View_ajax, name='user_login_View_ajax'),
|
||||
# url(r'^login_confirm$', user_login_confirm_ajax, name='user_login_confirm_ajax'),
|
||||
|
||||
527
AuthApp/views.py
527
AuthApp/views.py
@@ -9,284 +9,293 @@ from django.http import HttpResponse, Http404
|
||||
from django.template import loader, RequestContext
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from BaseModels.mailSender import techSendMail
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import gettext as _
|
||||
from datetime import datetime
|
||||
|
||||
def login_View(request):
|
||||
|
||||
def create_personal_user(data, creator):
|
||||
Dict = {}
|
||||
|
||||
try:
|
||||
|
||||
user_id = str(uuid1().hex)[:10]
|
||||
user_name = data['email']
|
||||
mail = user_name
|
||||
user = User.objects.create_user(username=user_name, email=mail, password=user_id)
|
||||
|
||||
if 'first_name' in data and data['first_name']:
|
||||
user.first_name = data['first_name']
|
||||
if 'last_name' in data and data['last_name']:
|
||||
user.last_name = data['last_name']
|
||||
user.is_staff = False
|
||||
user.is_active = False
|
||||
user.is_superuser = False
|
||||
# user.set_password(user_id)
|
||||
user.save()
|
||||
|
||||
user_communications_ads_list = []
|
||||
|
||||
if 'office__name' in data['user_profile']:
|
||||
del data['user_profile']['office__name']
|
||||
if 'communications' in data['user_profile']:
|
||||
|
||||
user_communications_ads_list.extend(data['user_profile']['communications'])
|
||||
del data['user_profile']['communications']
|
||||
|
||||
if not 'creator' in data['user_profile'] and creator:
|
||||
data['user_profile']['creator'] = creator
|
||||
|
||||
profiles = UserProfile.objects.filter(user=user).update(**data['user_profile'])
|
||||
|
||||
if user_communications_ads_list:
|
||||
from GeneralApp.funcs import create_communications_items_by_list
|
||||
comm_objs = create_communications_items_by_list(user.user_profile, user_communications_ads_list)
|
||||
|
||||
user.refresh_from_db()
|
||||
|
||||
return {
|
||||
'name' : mail,
|
||||
'pass' : user_id,
|
||||
'user' : user
|
||||
}
|
||||
except Exception as e:
|
||||
return {
|
||||
'error': 'Ошибка добавление нового пользователя = {0}'.format(str(e)),
|
||||
}
|
||||
|
||||
|
||||
|
||||
def decode_get_param(data):
|
||||
import base64
|
||||
import json
|
||||
|
||||
d = data['data'].encode()
|
||||
token_data = base64.b64decode(d)
|
||||
|
||||
try:
|
||||
request_data = token_data.decode('utf8')
|
||||
except:
|
||||
request_data = token_data
|
||||
|
||||
data = json.loads(request_data)
|
||||
|
||||
return data
|
||||
|
||||
def check_user_key(data):
|
||||
# print(u'check_user_key')
|
||||
|
||||
|
||||
# try:
|
||||
# user_id = int(data[0])
|
||||
# except:
|
||||
# user_id = None
|
||||
# try:
|
||||
# user1S_id = int(data[1])
|
||||
#
|
||||
# company_id = data[2]
|
||||
# user_key = data[3]
|
||||
|
||||
res = u'Key Broken'
|
||||
# user_id = data[u'userId']
|
||||
# user_key = data[u'userKey']
|
||||
# user1S_id = data['user1S_id']
|
||||
# company_id = data[u'companyId']
|
||||
|
||||
data = decode_get_param(data)
|
||||
|
||||
try:
|
||||
token = UserTokens.objects.get(
|
||||
user_id=data['pk'],
|
||||
user_key=data['code'],
|
||||
user1S_id=data['1S_pk'],
|
||||
company_id = data['comp_pk']
|
||||
)
|
||||
res = u'Accept'
|
||||
# print(u'try1 ok')
|
||||
except UserTokens.DoesNotExist:
|
||||
# если не найден id и ключ
|
||||
try:
|
||||
token = UserTokens.objects.get(
|
||||
user_id=data['pk']
|
||||
)
|
||||
# techSendMail(
|
||||
# u'user try access by id={0}, key={1}, c_id={2}'.format(
|
||||
# str(user_id),
|
||||
# str(user_key),
|
||||
# str(company_id)
|
||||
# )
|
||||
# )
|
||||
|
||||
res = u'Key Broken'
|
||||
# print(u'try2 ok')
|
||||
except UserTokens.DoesNotExist:
|
||||
# если не найден id
|
||||
token = UserTokens.objects.create(
|
||||
user_id=data['pk'],
|
||||
user_key=data['code'],
|
||||
company_id=data['comp_pk']
|
||||
)
|
||||
res = u'Accept'
|
||||
# print(u'except ok')
|
||||
t = loader.get_template('pages/p_authorization.html')
|
||||
|
||||
res = HttpResponse(t.render(Dict, request))
|
||||
return res
|
||||
|
||||
|
||||
|
||||
def recovery_password_user(request, uidb64=None, token=None):
|
||||
from django.contrib.auth.views import PasswordResetConfirmView
|
||||
|
||||
return PasswordResetConfirmView(request=request, uidb64=uidb64, token=token
|
||||
)
|
||||
|
||||
|
||||
# def recovery_password_user_complete(request, user_id, authCode):
|
||||
# from django.contrib.auth.forms import SetPasswordForm
|
||||
# from AuthApp.funcs import sendActivationMail
|
||||
#
|
||||
# def create_personal_user(data, creator):
|
||||
#
|
||||
# try:
|
||||
# user = User.objects.get(id=user_id, mipp_user__authMailCode=authCode)
|
||||
#
|
||||
# except:
|
||||
# user = None
|
||||
# user_id = str(uuid1().hex)[:10]
|
||||
# user_name = data['email']
|
||||
# mail = user_name
|
||||
# user = User.objects.create_user(username=user_name, email=mail, password=user_id)
|
||||
#
|
||||
# if user:
|
||||
# if 'first_name' in data and data['first_name']:
|
||||
# user.first_name = data['first_name']
|
||||
# if 'last_name' in data and data['last_name']:
|
||||
# user.last_name = data['last_name']
|
||||
# user.is_staff = False
|
||||
# user.is_active = False
|
||||
# user.is_superuser = False
|
||||
# # user.set_password(user_id)
|
||||
# user.save()
|
||||
#
|
||||
# user.set_password()
|
||||
# user_communications_ads_list = []
|
||||
#
|
||||
# if reg_user.is_active:
|
||||
# activated_early = True
|
||||
# else:
|
||||
# reg_user.backend = 'AuthApp.backends.BaldeniniAuthBackend'
|
||||
# login(request, reg_user)
|
||||
# if 'office__name' in data['user_profile']:
|
||||
# del data['user_profile']['office__name']
|
||||
# if 'communications' in data['user_profile']:
|
||||
#
|
||||
# reg_user.is_active = True
|
||||
# reg_user.save()
|
||||
# sendActivationMail(reg_user)
|
||||
# user_communications_ads_list.extend(data['user_profile']['communications'])
|
||||
# del data['user_profile']['communications']
|
||||
#
|
||||
# else:
|
||||
# raise Http404
|
||||
# # print(reg_user)
|
||||
# if not 'creator' in data['user_profile'] and creator:
|
||||
# data['user_profile']['creator'] = creator
|
||||
#
|
||||
# context = {
|
||||
# 'user': user,
|
||||
# 'activated_early' : activated_early,
|
||||
# profiles = UserProfile.objects.filter(user=user).update(**data['user_profile'])
|
||||
#
|
||||
# if user_communications_ads_list:
|
||||
# from GeneralApp.funcs import create_communications_items_by_list
|
||||
# comm_objs = create_communications_items_by_list(user.user_profile, user_communications_ads_list)
|
||||
#
|
||||
# user.refresh_from_db()
|
||||
#
|
||||
# return {
|
||||
# 'name' : mail,
|
||||
# 'pass' : user_id,
|
||||
# 'user' : user
|
||||
# }
|
||||
#
|
||||
# t = loader.get_template('pages/profile.html')
|
||||
#
|
||||
# rContext = RequestContext(request, context)
|
||||
# return HttpResponse(t.render(rContext))
|
||||
|
||||
|
||||
|
||||
# def check_user_registration_and_activate(request, user_id, authCode):
|
||||
# from django.contrib.auth import authenticate, login
|
||||
# from AuthApp.funcs import sendActivationMail
|
||||
#
|
||||
# try:
|
||||
# reg_user = User.objects.get(id=user_id, mipp_user__authMailCode=authCode)
|
||||
#
|
||||
# except:
|
||||
# reg_user = None
|
||||
#
|
||||
# activated_early = False
|
||||
#
|
||||
# if reg_user:
|
||||
#
|
||||
# if reg_user.is_active:
|
||||
# activated_early = True
|
||||
# else:
|
||||
# reg_user.backend = 'AuthApp.backends.BaldeniniAuthBackend'
|
||||
# login(request, reg_user)
|
||||
#
|
||||
# reg_user.is_active = True
|
||||
# reg_user.save()
|
||||
# sendActivationMail(reg_user)
|
||||
#
|
||||
# else:
|
||||
# raise Http404
|
||||
# # print(reg_user)
|
||||
#
|
||||
# context = {
|
||||
# 'reg_user': reg_user,
|
||||
# 'activated_early' : activated_early,
|
||||
# except Exception as e:
|
||||
# return {
|
||||
# 'error': 'Ошибка добавление нового пользователя = {0}'.format(str(e)),
|
||||
# }
|
||||
#
|
||||
#
|
||||
#
|
||||
# t = loader.get_template('admin_pages/pages/Profile/profile.html')
|
||||
# def decode_get_param(data):
|
||||
# import base64
|
||||
# import json
|
||||
#
|
||||
# # rContext = RequestContext(request, context)
|
||||
# # return HttpResponse(t.render(rContext))
|
||||
# return HttpResponse(t.render(context, request))
|
||||
|
||||
|
||||
|
||||
def create_temporary_user():
|
||||
from django.utils.translation import ugettext as _
|
||||
user_id = str(uuid1().hex)[:10]
|
||||
user_name = u'user'+user_id
|
||||
mail = user_id+u'@truenergy.by'
|
||||
user = User.objects.create_user(mail, mail,user_id)
|
||||
user.first_name = _(u'незарег. пользователь')
|
||||
user.last_name = u''
|
||||
user.is_staff = False
|
||||
user.is_active = True
|
||||
user.is_superuser = False
|
||||
user.set_password(user_id)
|
||||
# print(u'user_create_pass', user.password)
|
||||
# p = user.get_profile()
|
||||
# p.address = ''
|
||||
# p.phone = ''
|
||||
# p.group = None
|
||||
# p.discount = 0
|
||||
# p.pay_balance = 0
|
||||
# p.authMailCode = uuid1().hex
|
||||
# p.save()
|
||||
|
||||
user.save()
|
||||
user.mipp_user.temporary_user = True
|
||||
user.mipp_user.save()
|
||||
# print('user',user)
|
||||
# print('created profile',p)
|
||||
# print('user created', user)
|
||||
return {
|
||||
'name' : mail,
|
||||
'pass' : user_id,
|
||||
'user' : user
|
||||
}
|
||||
|
||||
|
||||
def get_active_user(request):
|
||||
if request.user.is_anonymous:
|
||||
return None
|
||||
else:
|
||||
user = request.user
|
||||
# try:
|
||||
# bd = user.mipp_user.birthdate
|
||||
# except MIPPUser.DoesNotExist:
|
||||
# MIPPUser.objects.create(user=user)
|
||||
|
||||
return user
|
||||
|
||||
|
||||
def get_active_user_if_anonymous_create_temporary(request):
|
||||
|
||||
user = get_active_user(request)
|
||||
|
||||
if not user:
|
||||
new_user_Dict = create_temporary_user()
|
||||
user = auth.authenticate(username=new_user_Dict['name'], password=new_user_Dict['pass'])
|
||||
if user:
|
||||
auth.login(request, user)
|
||||
|
||||
return user
|
||||
# d = data['data'].encode()
|
||||
# token_data = base64.b64decode(d)
|
||||
#
|
||||
# try:
|
||||
# request_data = token_data.decode('utf8')
|
||||
# except:
|
||||
# request_data = token_data
|
||||
#
|
||||
# data = json.loads(request_data)
|
||||
#
|
||||
# return data
|
||||
#
|
||||
# def check_user_key(data):
|
||||
# # print(u'check_user_key')
|
||||
#
|
||||
#
|
||||
# # try:
|
||||
# # user_id = int(data[0])
|
||||
# # except:
|
||||
# # user_id = None
|
||||
# # try:
|
||||
# # user1S_id = int(data[1])
|
||||
# #
|
||||
# # company_id = data[2]
|
||||
# # user_key = data[3]
|
||||
#
|
||||
# res = u'Key Broken'
|
||||
# # user_id = data[u'userId']
|
||||
# # user_key = data[u'userKey']
|
||||
# # user1S_id = data['user1S_id']
|
||||
# # company_id = data[u'companyId']
|
||||
#
|
||||
# data = decode_get_param(data)
|
||||
#
|
||||
# try:
|
||||
# token = UserTokens.objects.get(
|
||||
# user_id=data['pk'],
|
||||
# user_key=data['code'],
|
||||
# user1S_id=data['1S_pk'],
|
||||
# company_id = data['comp_pk']
|
||||
# )
|
||||
# res = u'Accept'
|
||||
# # print(u'try1 ok')
|
||||
# except UserTokens.DoesNotExist:
|
||||
# # если не найден id и ключ
|
||||
# try:
|
||||
# token = UserTokens.objects.get(
|
||||
# user_id=data['pk']
|
||||
# )
|
||||
# # techSendMail(
|
||||
# # u'user try access by id={0}, key={1}, c_id={2}'.format(
|
||||
# # str(user_id),
|
||||
# # str(user_key),
|
||||
# # str(company_id)
|
||||
# # )
|
||||
# # )
|
||||
#
|
||||
# res = u'Key Broken'
|
||||
# # print(u'try2 ok')
|
||||
# except UserTokens.DoesNotExist:
|
||||
# # если не найден id
|
||||
# token = UserTokens.objects.create(
|
||||
# user_id=data['pk'],
|
||||
# user_key=data['code'],
|
||||
# company_id=data['comp_pk']
|
||||
# )
|
||||
# res = u'Accept'
|
||||
# # print(u'except ok')
|
||||
#
|
||||
# return res
|
||||
#
|
||||
#
|
||||
#
|
||||
# def recovery_password_user(request, uidb64=None, token=None):
|
||||
# from django.contrib.auth.views import PasswordResetConfirmView
|
||||
#
|
||||
# return PasswordResetConfirmView(request=request, uidb64=uidb64, token=token
|
||||
# )
|
||||
#
|
||||
#
|
||||
# # def recovery_password_user_complete(request, user_id, authCode):
|
||||
# # from django.contrib.auth.forms import SetPasswordForm
|
||||
# # from AuthApp.funcs import sendActivationMail
|
||||
# #
|
||||
# # try:
|
||||
# # user = User.objects.get(id=user_id, mipp_user__authMailCode=authCode)
|
||||
# #
|
||||
# # except:
|
||||
# # user = None
|
||||
# #
|
||||
# # if user:
|
||||
# #
|
||||
# # user.set_password()
|
||||
# #
|
||||
# # if reg_user.is_active:
|
||||
# # activated_early = True
|
||||
# # else:
|
||||
# # reg_user.backend = 'AuthApp.backends.BaldeniniAuthBackend'
|
||||
# # login(request, reg_user)
|
||||
# #
|
||||
# # reg_user.is_active = True
|
||||
# # reg_user.save()
|
||||
# # sendActivationMail(reg_user)
|
||||
# #
|
||||
# # else:
|
||||
# # raise Http404
|
||||
# # # print(reg_user)
|
||||
# #
|
||||
# # context = {
|
||||
# # 'user': user,
|
||||
# # 'activated_early' : activated_early,
|
||||
# # }
|
||||
# #
|
||||
# # t = loader.get_template('pages/profile.html')
|
||||
# #
|
||||
# # rContext = RequestContext(request, context)
|
||||
# # return HttpResponse(t.render(rContext))
|
||||
#
|
||||
#
|
||||
#
|
||||
# # def check_user_registration_and_activate(request, user_id, authCode):
|
||||
# # from django.contrib.auth import authenticate, login
|
||||
# # from AuthApp.funcs import sendActivationMail
|
||||
# #
|
||||
# # try:
|
||||
# # reg_user = User.objects.get(id=user_id, mipp_user__authMailCode=authCode)
|
||||
# #
|
||||
# # except:
|
||||
# # reg_user = None
|
||||
# #
|
||||
# # activated_early = False
|
||||
# #
|
||||
# # if reg_user:
|
||||
# #
|
||||
# # if reg_user.is_active:
|
||||
# # activated_early = True
|
||||
# # else:
|
||||
# # reg_user.backend = 'AuthApp.backends.BaldeniniAuthBackend'
|
||||
# # login(request, reg_user)
|
||||
# #
|
||||
# # reg_user.is_active = True
|
||||
# # reg_user.save()
|
||||
# # sendActivationMail(reg_user)
|
||||
# #
|
||||
# # else:
|
||||
# # raise Http404
|
||||
# # # print(reg_user)
|
||||
# #
|
||||
# # context = {
|
||||
# # 'reg_user': reg_user,
|
||||
# # 'activated_early' : activated_early,
|
||||
# # }
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# # t = loader.get_template('admin_pages/pages/Profile/profile.html')
|
||||
# #
|
||||
# # # rContext = RequestContext(request, context)
|
||||
# # # return HttpResponse(t.render(rContext))
|
||||
# # return HttpResponse(t.render(context, request))
|
||||
#
|
||||
#
|
||||
#
|
||||
# def create_temporary_user():
|
||||
# from django.utils.translation import ugettext as _
|
||||
# user_id = str(uuid1().hex)[:10]
|
||||
# user_name = u'user'+user_id
|
||||
# mail = user_id+u'@truenergy.by'
|
||||
# user = User.objects.create_user(mail, mail,user_id)
|
||||
# user.first_name = _(u'незарег. пользователь')
|
||||
# user.last_name = u''
|
||||
# user.is_staff = False
|
||||
# user.is_active = True
|
||||
# user.is_superuser = False
|
||||
# user.set_password(user_id)
|
||||
# # print(u'user_create_pass', user.password)
|
||||
# # p = user.get_profile()
|
||||
# # p.address = ''
|
||||
# # p.phone = ''
|
||||
# # p.group = None
|
||||
# # p.discount = 0
|
||||
# # p.pay_balance = 0
|
||||
# # p.authMailCode = uuid1().hex
|
||||
# # p.save()
|
||||
#
|
||||
# user.save()
|
||||
# user.mipp_user.temporary_user = True
|
||||
# user.mipp_user.save()
|
||||
# # print('user',user)
|
||||
# # print('created profile',p)
|
||||
# # print('user created', user)
|
||||
# return {
|
||||
# 'name' : mail,
|
||||
# 'pass' : user_id,
|
||||
# 'user' : user
|
||||
# }
|
||||
#
|
||||
#
|
||||
# def get_active_user(request):
|
||||
# if request.user.is_anonymous:
|
||||
# return None
|
||||
# else:
|
||||
# user = request.user
|
||||
# # try:
|
||||
# # bd = user.mipp_user.birthdate
|
||||
# # except MIPPUser.DoesNotExist:
|
||||
# # MIPPUser.objects.create(user=user)
|
||||
#
|
||||
# return user
|
||||
#
|
||||
#
|
||||
# def get_active_user_if_anonymous_create_temporary(request):
|
||||
#
|
||||
# user = get_active_user(request)
|
||||
#
|
||||
# if not user:
|
||||
# new_user_Dict = create_temporary_user()
|
||||
# user = auth.authenticate(username=new_user_Dict['name'], password=new_user_Dict['pass'])
|
||||
# if user:
|
||||
# auth.login(request, user)
|
||||
#
|
||||
# return user
|
||||
@@ -5,7 +5,7 @@ __author__ = 'SDE'
|
||||
from django.core.mail import EmailMultiAlternatives
|
||||
# from AuthApp.models import UserProfileModel
|
||||
import smtplib
|
||||
from tEDataProj.settings import prod_server
|
||||
# from tEDataProj.settings import prod_server
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from email.mime.application import MIMEApplication
|
||||
@@ -16,7 +16,6 @@ from email import encoders
|
||||
import ssl
|
||||
import time
|
||||
import random
|
||||
from tEDataProj import settings
|
||||
|
||||
|
||||
# tech@truenergy.by
|
||||
|
||||
@@ -44,7 +44,7 @@ def send_request(msg):
|
||||
time.sleep(60)
|
||||
# send_request(msg)
|
||||
|
||||
if res and 'OpenAI account' in res['choices'][0]['message']['content']:
|
||||
if res and ('OpenAI account' in res['choices'][0]['message']['content'] or 'help.openai.com' in res['choices'][0]['message']['content']):
|
||||
msg = f"!!! --- OpenAI send_request fail = {str(res['choices'][0]['message']['content'])} > sleep 60sec"
|
||||
print(msg)
|
||||
res = None
|
||||
|
||||
@@ -25,6 +25,7 @@ urlpatterns = [
|
||||
path('', view_main, name='table_view'),
|
||||
path('admin/', admin.site.urls),
|
||||
path('ckeditor/', include('ckeditor_uploader.urls')),
|
||||
path('', include('QuestionsApp.urls'))
|
||||
path('', include('QuestionsApp.urls')),
|
||||
path('', include('AuthApp.urls')),
|
||||
]
|
||||
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
0
templates/p_authorization.html
Normal file
0
templates/p_authorization.html
Normal file
7
templates/pages/p_authorization.html
Normal file
7
templates/pages/p_authorization.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends "tb_base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block CONTENT %}
|
||||
|
||||
{% include "widgets/w_authorization.html" %}
|
||||
{% endblock %}
|
||||
387
templates/widgets/w_authorization.html
Normal file
387
templates/widgets/w_authorization.html
Normal file
@@ -0,0 +1,387 @@
|
||||
{% load static %}
|
||||
<head>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<style>
|
||||
|
||||
.commonmargin {
|
||||
margin-top: 193px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.loginbtn {
|
||||
position: relative;
|
||||
padding-top: 25px;
|
||||
border: 3px solid #FFF ;
|
||||
|
||||
}
|
||||
.registrbtn {
|
||||
padding-top: 25px;
|
||||
border: 3px solid #FFF ;
|
||||
|
||||
}
|
||||
|
||||
.chspan {
|
||||
position: relative;
|
||||
z-index: 22;
|
||||
}
|
||||
|
||||
.chbtn {
|
||||
margin: 0 -30px 0 -30px;
|
||||
width: 370px;
|
||||
height: 38px;
|
||||
border-radius: 60px 60px 0px 0px;
|
||||
display: inline-block;
|
||||
line-height: normal;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: normal;
|
||||
letter-spacing: 1.8px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.loginpole {
|
||||
margin: auto;
|
||||
width: 691px;
|
||||
height: 530px;
|
||||
border-radius: 0 0 60px 60px;
|
||||
border: 3px solid #FFF;
|
||||
border-top: none;
|
||||
background: linear-gradient(135deg, #6BFFFF -15.56%, rgba(18, 67, 191, 0.92) 40%, rgba(191, 18, 174, 0.92) 95%);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.lines {
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
.inputdata {
|
||||
display: block;
|
||||
width: 489px;
|
||||
height: 45px;
|
||||
border-radius: 40px;
|
||||
border: 3px solid #FFF;
|
||||
background: transparent;
|
||||
margin: 0 67px 21px 66px;
|
||||
padding-left: 68px;
|
||||
color: #fff;
|
||||
color: #FFF;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.inputdata:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.inputdata::placeholder {
|
||||
color: #FFF;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.forpassword {
|
||||
float: right;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: normal;
|
||||
text-decoration-line: underline;
|
||||
margin: 5px 66px 46px 0;
|
||||
}
|
||||
|
||||
.login {
|
||||
border-radius: 40px;
|
||||
border: 1.5px solid #FBC1C8;
|
||||
background: linear-gradient(92deg, #EE3145 0%, #630762 100%);
|
||||
box-shadow: -4px -4px 25px 0px #F8576C, 4px 4px 25px 0px #74286C;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 27px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: normal;
|
||||
margin: 0 226px 25px 236px;
|
||||
width: 228.712px;
|
||||
height: 48.301px;
|
||||
}
|
||||
|
||||
.registrate {
|
||||
width: 423px;
|
||||
height: 48px;
|
||||
border-radius: 40px;
|
||||
border: 1.5px solid #FFF;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 27px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: normal;
|
||||
background: transparent;
|
||||
filter: drop-shadow(5px 5px 30px #030303) drop-shadow(-5px -5px 30px #33333A);
|
||||
margin: 0 129px 32px 139px;
|
||||
}
|
||||
|
||||
.logwith {
|
||||
width: 293.602px;
|
||||
height: 27.465px;
|
||||
color: #FFF;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
margin: 0 194px 20px 203px;
|
||||
|
||||
}
|
||||
.social {
|
||||
width: 33px;
|
||||
height: 34px;
|
||||
margin: 0 12px 35px 12px;
|
||||
}
|
||||
.socialimg {
|
||||
margin-right: 95px;
|
||||
}
|
||||
.chbtn:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.langchange {
|
||||
float: left;
|
||||
margin: -28px 0 0 19px;
|
||||
}
|
||||
.ru {
|
||||
height: 50px;
|
||||
background-image: url("{% static "images/icons/rus.svg" %}");
|
||||
background-repeat: no-repeat;
|
||||
padding-top: 10px;
|
||||
color: #FFF;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: normal;
|
||||
padding-left: 53px;
|
||||
}
|
||||
.en {
|
||||
height: 50px;
|
||||
background-image: url("{% static "images/icons/usa.svg" %}");
|
||||
background-repeat: no-repeat;
|
||||
padding-top: 10px;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: normal;
|
||||
padding-left: 53px;
|
||||
|
||||
}
|
||||
.langchange a {
|
||||
text-decoration: none;
|
||||
color: #FFF;
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.registration:target {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.loginpole:target {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.registration, .loginpole{
|
||||
display: none;
|
||||
}
|
||||
.registration {
|
||||
width: 691px;
|
||||
height: 543px;
|
||||
border-radius: 60px;
|
||||
border: 3px solid #FFF;
|
||||
background: linear-gradient(135deg, #6BFFFF -15.56%, rgba(18, 67, 191, 0.92) 40%, rgba(191, 18, 174, 0.92) 95%);
|
||||
border-top: none;
|
||||
border-radius: 0 0 60px 60px;
|
||||
margin: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.regtg {
|
||||
display: inline;
|
||||
margin: 19px 0 10px 327px;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
|
||||
}
|
||||
|
||||
.addtg {
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: normal;
|
||||
text-decoration-line: underline;
|
||||
margin-bottom: 46px;
|
||||
}
|
||||
|
||||
.registrate2 {
|
||||
border-radius: 40px;
|
||||
border: 1.5px solid #FBC1C8;
|
||||
background: linear-gradient(92deg, #EE3145 0%, #630762 100%);
|
||||
box-shadow: -4px -4px 25px 0px #F8576C, 4px 4px 25px 0px #74286C;
|
||||
width: 451px;
|
||||
height: 60px;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-family: Montserrat, sans-serif, Inter;
|
||||
font-size: 27px;
|
||||
font-weight: 700;
|
||||
margin: -20px 0 0 126px;
|
||||
}
|
||||
input[type=text] {
|
||||
background-image: url("{% static "images/icons/log.svg" %}");
|
||||
background-repeat: no-repeat;
|
||||
background-position-y: 12px;
|
||||
background-position-x: 31px;
|
||||
}
|
||||
input[type=email] {
|
||||
background-image: url("{% static "images/icons/email.svg" %}");
|
||||
background-repeat: no-repeat;
|
||||
background-position-y: 15px;
|
||||
background-position-x: 30px;
|
||||
}
|
||||
|
||||
input[type=tel] {
|
||||
background-image: url("{% static "images/icons/tel.svg" %}");
|
||||
background-repeat: no-repeat;
|
||||
background-position-y: 12px;
|
||||
background-position-x: 34px;
|
||||
}
|
||||
input[type=password] {
|
||||
background-image: url("{% static "images/icons/pass.svg" %}");
|
||||
background-repeat: no-repeat;
|
||||
background-position-y: 14px;
|
||||
background-position-x: 33px;
|
||||
}
|
||||
|
||||
.registration:before {
|
||||
content: "";
|
||||
width: 370px;
|
||||
height: 67px;
|
||||
position: absolute;
|
||||
background: linear-gradient(135deg, #6BFFFF -95%, rgba(18, 67, 191, 1) 50%, rgba(191, 18, 174, 1) 220%);
|
||||
top: -70px;
|
||||
right: -3px;
|
||||
border-radius: 60px 60px 0 0;
|
||||
border: 3px solid #fff;
|
||||
border-bottom: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.loginpole:before {
|
||||
content: "";
|
||||
width: 370px;
|
||||
height: 66px;
|
||||
position: absolute;
|
||||
background: linear-gradient(135deg, #6BFFFF -25%, rgba(18, 67, 191, 1) 122%);
|
||||
top: -69px;
|
||||
right: 318px;
|
||||
border-radius: 60px 60px 0 0;
|
||||
border: 3px solid #fff;
|
||||
border-bottom: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="commonmargin">
|
||||
<div class="checks">
|
||||
<a href="#1" id="defaultOpen" class="loginbtn chbtn" ><span class="chspan">вход</span></a>
|
||||
<a href="#2" class="registrbtn chbtn" ><span class="chspan">регистрация</span></a>
|
||||
</div>
|
||||
<div class="loginpole" id="1">
|
||||
<div class="lines">
|
||||
<input autocomplete="off" class="inputdata" type="text" name="login" placeholder="ЛОГИН" >
|
||||
<input autocomplete="off" class="inputdata" type="password" name="password" placeholder="ПАРОЛЬ" >
|
||||
<a href="#" class="forpassword">забыли пароль?</a>
|
||||
</br>
|
||||
<input type="submit" class="login" value="войти">
|
||||
</div>
|
||||
<button id="1" class="registrate">зарегистрироваться</button>
|
||||
<div>
|
||||
<div class="langchange">
|
||||
<a href="#"><div class="ru">RU</div></a>
|
||||
|
||||
<a href="#"><div class="en">EN</div></a>
|
||||
</div>
|
||||
|
||||
<div class="logwith">войти с помощью</div>
|
||||
<div class="socialimg">
|
||||
<img class="social" src="{% static "images/icons/inst.svg" %}">
|
||||
<img class="social" src="{% static "images/icons/tg.svg" %}">
|
||||
<img class="social" src="{% static "images/icons/vk.svg" %}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="registration" id="2">
|
||||
<div class="lines">
|
||||
<form id="reg">
|
||||
<input type="text" name="login" placeholder="ЛОГИН" class="inputdata">
|
||||
<input type="email" name="email" placeholder="EMAIL" class="inputdata">
|
||||
<input type="tel" name="tel" placeholder="ТЕЛЕФОН" class="inputdata">
|
||||
<input type="password" name="password" placeholder="ПАРОЛЬ" class="inputdata">
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<img class="regtg" src="{% static "images/icons/tg.svg" %}">
|
||||
<div class="addtg"><a>добавить телеграмм</a></div>
|
||||
</div>
|
||||
<input class="registrate2" type="submit" form="reg" value="ЗАРЕГИСТРИРОВАТЬСЯ">
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById("defaultOpen").click();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Обнаружение ссылки якоря для таба
|
||||
let url = location.href.split('#')[1], el = $('#'+url);
|
||||
if(el.length > 0 && el.closest('.tabs-block').length > 0) {
|
||||
let parent = el.closest('.tabs-block');
|
||||
//
|
||||
parent.find('.item.--active').removeClass('--active');
|
||||
parent.find('.tabs .item[href="'+url+'"]').addClass('--active');
|
||||
parent.find('.content #'+url).addClass('--active');
|
||||
}
|
||||
|
||||
// Переключение табов
|
||||
$('.tabs-block .tabs').on('click', '.item', function(e){
|
||||
e.preventDefault()
|
||||
if(!$(this).hasClass('--active')) {
|
||||
let parent = $(this).closest('.tabs-block'),
|
||||
id = $(this).attr('href').split('#')[1];
|
||||
//
|
||||
parent.find('.item.--active').removeClass('--active');
|
||||
parent.find('.content #'+id).addClass('--active');
|
||||
$(this).addClass('--active');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
Reference in New Issue
Block a user