This commit is contained in:
Jędrzej Klepacki 2021-01-16 13:21:27 +01:00
parent c6ab9a54de
commit 95db3d0961
19 changed files with 233 additions and 22 deletions

View File

@ -0,0 +1,55 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>SocialHelper</title>
<link rel="stylesheet" href="{% static 'css/font-awesome.min.css' %}">
<link rel="stylesheet" href="{% static 'vendors/line-icon/css/simple-line-icons.css' %}">
<link rel="stylesheet" href="{% static 'vendors/elegant-icon/style.css' %}">
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'vendors/revolution/css/settings.css' %}">
<link rel="stylesheet" href="{% static 'vendors/revolution/css/layers.css' %}">
<link rel="stylesheet" href="{% static 'vendors/revolution/css/navigation.css' %}">
<link rel="stylesheet" href="{% static 'vendors/owl-carousel/owl.carousel.min.css" rel="stylesheet' %}">
<link rel="stylesheet" href="{% static 'vendors/bootstrap-selector/css/bootstrap-select.min.css' %}">
<link rel="stylesheet" href="{% static 'css/style.css' %}">
<link rel="stylesheet" href="{% static 'css/responsive.css' %}">
</head>
<body>
{% include 'navbar2.html' %}
{% include 'alerts.html' %}
{% block content %} {% endblock %}
{% include 'footer2.html' %}
<script src="{% static 'js/jquery-3.2.1.min.js' %} "></script>
<script src="{% static 'js/popper.min.js' %} "></script>
<script src="{% static 'js/bootstrap.min.js' %} "></script>
<script src="{% static 'vendors/revolution/js/jquery.themepunch.tools.min.js' %} "></script>
<script src="{% static 'vendors/revolution/js/jquery.themepunch.revolution.min.js' %} "></script>
<script src="{% static 'vendors/revolution/js/extensions/revolution.extension.actions.min.js' %} "></script>
<script src="{% static 'vendors/revolution/js/extensions/revolution.extension.video.min.js' %} "></script>
<script src="{% static 'vendors/revolution/js/extensions/revolution.extension.slideanims.min.js' %} "></script>
<script src="{% static 'vendors/revolution/js/extensions/revolution.extension.layeranimation.min.js' %} "></script>
<script src="{% static 'vendors/revolution/js/extensions/revolution.extension.navigation.min.js' %} "></script>
<script src="{% static 'vendors/revolution/js/extensions/revolution.extension.slideanims.min.js' %} "></script>
<script src="{% static 'vendors/counterup/jquery.waypoints.min.js' %} "></script>
<script src="{% static 'vendors/counterup/jquery.counterup.min.js' %} "></script>
<script src="{% static 'vendors/owl-carousel/owl.carousel.min.js' %} "></script>
<script src="{% static 'vendors/bootstrap-selector/js/bootstrap-select.min.js' %} "></script>
<script src="{% static 'vendors/image-dropdown/jquery.dd.min.js' %} "></script>
<script src="{% static 'js/smoothscroll.js' %} "></script>
<script src="{% static 'vendors/isotope/imagesloaded.pkgd.min.js' %} "></script>
<script src="{% static 'vendors/isotope/isotope.pkgd.min.js' %} "></script>
<script src="{% static 'vendors/magnify-popup/jquery.magnific-popup.min.js' %} "></script>
<script src="{% static 'vendors/vertical-slider/js/jQuery.verticalCarousel.js' %} "></script>
<script src="{% static 'vendors/jquery-ui/jquery-ui.js' %} "></script>
<script src="{% static 'js/theme.js' %} "></script>
</body>
</html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends isVIP|yesno:"base.html,base2.html" %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<!DOCTYPE html> <!DOCTYPE html>
@ -23,6 +23,9 @@
<section class="solid_banner_area"> <section class="solid_banner_area">
<div class="container"> <div class="container">
<div class="solid_banner_inner"> <div class="solid_banner_inner">
{% if not user_prof %}
<h3><strong><span style="color:red">Konto Skasowane</span></strong></h3>
{% endif %}
<h3>Profil użytkownika</h3> <h3>Profil użytkownika</h3>
<h5>{{ name }}</h5><p><br></p> <h5>{{ name }}</h5><p><br></p>
<p><SPAN STYLE="font-size:16.0pt">Średnia Ocena: <strong>{{ocena_2}}</SPAN></strong></p> <p><SPAN STYLE="font-size:16.0pt">Średnia Ocena: <strong>{{ocena_2}}</SPAN></strong></p>

View File

@ -18,6 +18,14 @@ import datetime
def index(request): def index(request):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
all_product = Product.objects.filter(active = True) all_product = Product.objects.filter(active = True)
template = loader.get_template('homepage/index.html') template = loader.get_template('homepage/index.html')
types = TYPE_T types = TYPE_T
@ -36,10 +44,19 @@ def index(request):
'types_o': types_o, 'types_o': types_o,
'usluga_local': usluga_local, 'usluga_local': usluga_local,
'przedmiot_local': przedmiot_local, 'przedmiot_local': przedmiot_local,
'isVIP': isVIP,
} }
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def index_product(request): def index_product(request):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
all_product = Product.objects.filter(active = True, offer=2) all_product = Product.objects.filter(active = True, offer=2)
template = loader.get_template('homepage/index.html') template = loader.get_template('homepage/index.html')
types = TYPE_T types = TYPE_T
@ -58,10 +75,19 @@ def index_product(request):
'types_o': types_o, 'types_o': types_o,
'usluga_local': usluga_local, 'usluga_local': usluga_local,
'przedmiot_local': przedmiot_local, 'przedmiot_local': przedmiot_local,
'isVIP': isVIP,
} }
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def index_offer(request): def index_offer(request):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
all_product = Product.objects.filter(active = True, offer=1) all_product = Product.objects.filter(active = True, offer=1)
template = loader.get_template('homepage/index.html') template = loader.get_template('homepage/index.html')
types = TYPE_T types = TYPE_T
@ -80,10 +106,19 @@ def index_offer(request):
'types_o': types_o, 'types_o': types_o,
'usluga_local': usluga_local, 'usluga_local': usluga_local,
'przedmiot_local': przedmiot_local, 'przedmiot_local': przedmiot_local,
'isVIP': isVIP,
} }
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def contact(request): def contact(request):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
if request.method == 'POST': if request.method == 'POST':
name = request.POST['name'] name = request.POST['name']
email = request.POST['email'] email = request.POST['email']
@ -100,16 +135,46 @@ def contact(request):
) )
mess.save() mess.save()
messages.success(request, 'Wysłano wiadomość, dziękujemy!') messages.success(request, 'Wysłano wiadomość, dziękujemy!')
return render(request , 'homepage/contact.html') template = loader.get_template('homepage/contact.html')
context = {
'isVIP': isVIP,
}
return HttpResponse(template.render(context, request))
def about(request): def about(request):
return render(request , 'homepage/about.html') if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
template = loader.get_template('homepage/about.html')
context = {
'isVIP': isVIP,
}
return HttpResponse(template.render(context, request))
def regulamin(request): def regulamin(request):
return render(request, 'homepage/regulamin.html') if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
template = loader.get_template('homepage/regulamin.html')
context = {
'isVIP': isVIP,
}
return HttpResponse(template.render(context, request))
def my_offer(request): def my_offer(request):
if request.user.is_authenticated: if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
all_product = Product.objects.filter(user_iden = request.user.id, active = True).order_by('create_date') all_product = Product.objects.filter(user_iden = request.user.id, active = True).order_by('create_date')
username = request.user.email username = request.user.email
template = loader.get_template('homepage/my_offer.html') template = loader.get_template('homepage/my_offer.html')
@ -129,13 +194,21 @@ def my_offer(request):
'types_o': types_o, 'types_o': types_o,
'usluga_local': usluga_local, 'usluga_local': usluga_local,
'przedmiot_local': przedmiot_local, 'przedmiot_local': przedmiot_local,
'username': username 'username': username,
'isVIP': isVIP,
} }
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
else: else:
return redirect(login) return redirect(login)
def filter(request): def filter(request):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
all_product = Product.objects.filter(active = True) all_product = Product.objects.filter(active = True)
template = loader.get_template('homepage/index.html') template = loader.get_template('homepage/index.html')
@ -184,12 +257,18 @@ def filter(request):
'usluga_local': usluga_local, 'usluga_local': usluga_local,
'przedmiot_local': przedmiot_local, 'przedmiot_local': przedmiot_local,
'wol_local': wol_local, 'wol_local': wol_local,
'isVIP': isVIP,
} }
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def add_offer(request): def add_offer(request):
if request.user.is_authenticated: if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
place_list = Places.objects.all() place_list = Places.objects.all()
if request.method == 'POST': if request.method == 'POST':
place_local = request.POST['browser'] place_local = request.POST['browser']
@ -238,6 +317,7 @@ def add_offer(request):
return redirect(my_offer) return redirect(my_offer)
context = { context = {
'place_list': place_list, 'place_list': place_list,
'isVIP': isVIP,
} }
return render(request , 'homepage/add_offer.html', context) return render(request , 'homepage/add_offer.html', context)
else: else:
@ -245,6 +325,10 @@ def add_offer(request):
def delete_offer(request, offer_id): def delete_offer(request, offer_id):
if request.user.is_authenticated: if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
if Product.objects.filter(user_iden=request.user , id = offer_id).exists(): if Product.objects.filter(user_iden=request.user , id = offer_id).exists():
instance = Product.objects.get(id=offer_id) instance = Product.objects.get(id=offer_id)
instance.active = False instance.active = False
@ -257,9 +341,12 @@ def delete_offer(request, offer_id):
else: else:
return redirect(login) return redirect(login)
def edit_offer(request, offer_id): def edit_offer(request, offer_id):
if request.user.is_authenticated: if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
if Product.objects.filter(user_iden=request.user , id = offer_id).exists(): if Product.objects.filter(user_iden=request.user , id = offer_id).exists():
instance = Product.objects.get(id=offer_id) instance = Product.objects.get(id=offer_id)
types = TYPE_T types = TYPE_T
@ -270,6 +357,7 @@ def edit_offer(request, offer_id):
'place_list': place_list, 'place_list': place_list,
'types': types, 'types': types,
'types_o': types_o, 'types_o': types_o,
'isVIP': isVIP,
} }
if request.method == 'POST': if request.method == 'POST':
place_local = request.POST['browser'] place_local = request.POST['browser']
@ -318,6 +406,14 @@ def edit_offer(request, offer_id):
return redirect(login) return redirect(login)
def create_user(request): def create_user(request):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
if request.method == 'POST': if request.method == 'POST':
User = get_user_model() User = get_user_model()
email = request.POST['email'] email = request.POST['email']
@ -390,6 +486,11 @@ def create_user(request):
def delete_user(request): def delete_user(request):
if request.user.is_authenticated: if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
User = get_user_model() User = get_user_model()
instant = User.objects.filter(id=request.user.id).first() instant = User.objects.filter(id=request.user.id).first()
instant.is_active = False instant.is_active = False
@ -408,6 +509,11 @@ def delete_user(request):
def edit_user(request): def edit_user(request):
if request.user.is_authenticated: if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
User = get_user_model() User = get_user_model()
instant = User.objects.filter(id=request.user.id).first() instant = User.objects.filter(id=request.user.id).first()
if request.method == 'POST': if request.method == 'POST':
@ -474,6 +580,14 @@ def logout_user(request):
return redirect( index) return redirect( index)
def user_profile(request, user_name): def user_profile(request, user_name):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
User = get_user_model() User = get_user_model()
if User.objects.filter(username=user_name).exists(): if User.objects.filter(username=user_name).exists():
user_prof = User.objects.filter(username=user_name).first() user_prof = User.objects.filter(username=user_name).first()
@ -509,11 +623,17 @@ def user_profile(request, user_name):
'ocena_2': ocena_2, 'ocena_2': ocena_2,
'suma_oc': suma, #suma wszystkich ocen uzytkownika 'suma_oc': suma, #suma wszystkich ocen uzytkownika
'suma_prod': suma_prod, 'suma_prod': suma_prod,
'user_prof': user_prof.is_active,
'isVIP': isVIP,
} }
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def add_comment(request, user_name): def add_comment(request, user_name):
if request.user.is_authenticated: if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
User = get_user_model() User = get_user_model()
user_prof = User.objects.filter(email=user_name).first() user_prof = User.objects.filter(email=user_name).first()
if request.method == 'POST': if request.method == 'POST':
@ -530,6 +650,7 @@ def add_comment(request, user_name):
context = { context = {
'user_name': user_name, 'user_name': user_name,
'isVIP': isVIP,
} }
template = loader.get_template('homepage/add_comment.html') template = loader.get_template('homepage/add_comment.html')
@ -538,6 +659,13 @@ def add_comment(request, user_name):
return redirect(login) return redirect(login)
def offer(request, offer_id): def offer(request, offer_id):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
user_get_id = request.user.id user_get_id = request.user.id
offer = Product.objects.filter(id = offer_id, active = True).first() offer = Product.objects.filter(id = offer_id, active = True).first()
mess = 0 mess = 0
@ -579,11 +707,16 @@ def offer(request, offer_id):
'user_list': user_list, 'user_list': user_list,
'email_list': email_list, 'email_list': email_list,
'user_get_id': user_get_id, 'user_get_id': user_get_id,
'isVIP': isVIP,
} }
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def send_message(request): def send_message(request):
if request.user.is_authenticated: if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
if request.method == 'POST': if request.method == 'POST':
author_id = request.POST['author_id'] author_id = request.POST['author_id']
sec_user_id = request.POST['sec_user_id'] sec_user_id = request.POST['sec_user_id']
@ -634,7 +767,7 @@ def chating(request, offer_id, au_id, ad_id):
'mess': mess, 'mess': mess,
'user_get_id': user_get_id, 'user_get_id': user_get_id,
'scd_user_get_id': scd_user_get_id, 'scd_user_get_id': scd_user_get_id,
'last_date': last_date 'last_date': last_date,
} }
template = loader.get_template('homepage/chating.html') template = loader.get_template('homepage/chating.html')
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
@ -642,6 +775,14 @@ def chating(request, offer_id, au_id, ad_id):
return redirect(login) return redirect(login)
def offer_note(request, offer_id): def offer_note(request, offer_id):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
offer = Product.objects.get(id = offer_id) offer = Product.objects.get(id = offer_id)
if request.method == 'POST': if request.method == 'POST':
text = request.POST['script'] text = request.POST['script']
@ -659,11 +800,20 @@ def offer_note(request, offer_id):
return redirect('offer', offer_id) return redirect('offer', offer_id)
context = { context = {
'offer': offer, 'offer': offer,
'isVIP': isVIP,
} }
template = loader.get_template('homepage/offer_note.html') template = loader.get_template('homepage/offer_note.html')
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def user_note(request, user_id): def user_note(request, user_id):
if request.user.is_authenticated:
if Vipuser.objects.filter(user_iden = request.user, active = True ).exists():
isVIP = True
else:
isVIP = False
else:
isVIP = False
User = get_user_model() User = get_user_model()
get_user = User.objects.get(email = user_id) get_user = User.objects.get(email = user_id)
if request.method == 'POST': if request.method == 'POST':
@ -682,6 +832,7 @@ def user_note(request, user_id):
return redirect('user_profile', user_id) return redirect('user_profile', user_id)
context = { context = {
'User_prof': get_user, 'User_prof': get_user,
'isVIP': isVIP,
} }
template = loader.get_template('homepage/user_note.html') template = loader.get_template('homepage/user_note.html')
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))