fuck this dumbass site

This commit is contained in:
Yamozha 2021-09-10 19:28:50 +03:00
parent d36405c0a8
commit fe7d2101e2
29 changed files with 652 additions and 269 deletions

View File

@ -1 +0,0 @@
232

Binary file not shown.

View File

@ -2,6 +2,7 @@
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
padding: 0; padding: 0;
scroll-behavior: smooth;
} }
#page-wrap { #page-wrap {
@ -130,7 +131,7 @@ header {
} }
} }
@media only screen and (max-width: 800px) { @media only screen and (max-width: 1024px) {
.nav__links, .nav__links,
.cta { .cta {
display: none; display: none;
@ -257,3 +258,66 @@ footer{
margin: 4px 2px; margin: 4px 2px;
cursor: pointer; cursor: pointer;
} }
@-webkit-keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
@keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
.tracking-in-expand {
-webkit-animation: tracking-in-expand 0.7s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation: tracking-in-expand 0.7s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation-delay: .3s;
}
@-webkit-keyframes fade-in-bck {
0% {
-webkit-transform: translateZ(80px);
transform: translateZ(80px);
opacity: 0;
}
100% {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
}
}
@keyframes fade-in-bck {
0% {
-webkit-transform: translateZ(80px);
transform: translateZ(80px);
opacity: 0;
}
100% {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
}
}
.fade-in-bck {
-webkit-animation: fade-in-bck 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
animation: fade-in-bck 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -33,10 +33,13 @@ def homePage(request):
else: else:
userQR=None userQR=None
for user in a: # Use aggregation that can be calculated in database (fast)
all_balance.append(user.balanceValue) all_balance = Balance.objects.all().aggregate(s=Sum("balanceValue"))['s']
print(f"{all_balance}") # print(f"{all_balance}")
limited_coins = settings.ALL_COINS - sum(all_balance) try:
limited_coins = settings.ALL_COINS - all_balance
except TypeError:
limited_coins = settings.ALL_COINS
github = requests.get("https://api.github.com/user/36108495").json() github = requests.get("https://api.github.com/user/36108495").json()
@ -45,9 +48,9 @@ def homePage(request):
"isProcessor": Processor, "isProcessor": Processor,
"userQR":userQR, "userQR":userQR,
"fullbalance": limited_coins, "fullbalance": limited_coins,
"currencyTotal": sum(all_balance), "currencyTotal": all_balance,
"userBalance": userBalance, "userBalance": userBalance,
"github": f"https://github.com/{github['login']}", "github": f"https://github.com/podput",
} }
@ -87,7 +90,6 @@ def leaderboard(request):
user_media = dict(sorted(user_media.items(), key=operator.itemgetter(0))) user_media = dict(sorted(user_media.items(), key=operator.itemgetter(0)))
user_media = dict(reversed(list(user_media.items()))) user_media = dict(reversed(list(user_media.items())))
print(user_media)
users = {} users = {}
for i in user_media.keys(): for i in user_media.keys():
iter_user = User.objects.get(username=i) iter_user = User.objects.get(username=i)
@ -97,7 +99,6 @@ def leaderboard(request):
"Images":len(iter_user_media.filter(is_video=False))}} "Images":len(iter_user_media.filter(is_video=False))}}
else: else:
user_data = {i:{"Images":len(iter_user_media.filter(is_video=False))}} user_data = {i:{"Images":len(iter_user_media.filter(is_video=False))}}
print(user_data)
while len(user_media) > 5: while len(user_media) > 5:
user_media.pop() user_media.pop()
@ -120,3 +121,7 @@ def leaderboard(request):
return render(request, 'leaderboard.html', context) return render(request, 'leaderboard.html', context)
def about(request):
return render(request, "about.html")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

View File

@ -1,25 +0,0 @@
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: Password reset on 127.0.0.1:8000
From: webmaster@localhost
To: pederas@pederasov.pl
Date: Mon, 08 Feb 2021 22:19:44 -0000
Message-ID: <161282278468.9046.5088568393660450551@Spudnik>
You're receiving this email because you requested a password reset for your user account at 127.0.0.1:8000.
Please go to the following page and choose a new password:
http://127.0.0.1:8000/users/reset/Mg/ahs0ww-f913be8dd50f0a6adf4815cf32e8183a/
Your username, in case youve forgotten: bobi
Thanks for using our site!
The 127.0.0.1:8000 team
-------------------------------------------------------------------------------

View File

@ -1,25 +0,0 @@
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: Password reset on 127.0.0.1:8000
From: webmaster@localhost
To: pederas@pederasov.pl
Date: Mon, 08 Feb 2021 22:20:07 -0000
Message-ID: <161282280735.9109.220494091957288379@Spudnik>
You're receiving this email because you requested a password reset for your user account at 127.0.0.1:8000.
Please go to the following page and choose a new password:
http://127.0.0.1:8000/users/reset/Mg/ahs0xj-30b0b07164a6b8b220b0e9cbbb048aa0/
Your username, in case youve forgotten: bobi
Thanks for using our site!
The 127.0.0.1:8000 team
-------------------------------------------------------------------------------

View File

@ -1,17 +1,20 @@
.popup { .popup {
width: 900px; width: 900px;
margin: auto; margin: auto;
text-align: center text-align: center;
} }
.popup img { .popup img {
width: 200px; width: 200px;
height: 200px; height: 200px;
cursor: pointer cursor: pointer;
} }
.show { .show {
z-index: 999; z-index: 999;
display: none; display: none;
} }
.show .overlay { .show .overlay {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -20,6 +23,7 @@
top: 0; top: 0;
left: 0; left: 0;
} }
.show .img-show { .show .img-show {
width: 600px; width: 600px;
height: 400px; height: 400px;
@ -28,8 +32,9 @@
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
overflow: hidden overflow: hidden;
} }
.img-show span { .img-show span {
position: absolute; position: absolute;
top: 10px; top: 10px;
@ -37,6 +42,7 @@
z-index: 99; z-index: 99;
cursor: pointer; cursor: pointer;
} }
.img-show img { .img-show img {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -108,27 +114,14 @@
transition: background-color 0.3s ease; transition: background-color 0.3s ease;
} }
.img-box:hover img { .img-box:hover img { transform: scale(1.1); }
transform: scale(1.1); .img-box:hover .transparent-box { background-color: rgba(0, 0, 0, 0.5); }
}
.img-box:hover .transparent-box {
background-color:rgba(0, 0, 0, 0.5);
}
.img-box:hover .caption { .img-box:hover .caption {
transform: translateY(-20px); transform: translateY(-20px);
opacity: 1.0; opacity: 1.0;
} }
.img-box:hover { .img-box:hover { cursor: pointer; }
cursor: pointer; .caption > p:nth-child(2) { font-size: 0.8em; }
} .opacity-low { opacity: 0.5; }
.caption > p:nth-child(2) {
font-size: 0.8em;
}
.opacity-low {
opacity: 0.5;
}

View File

@ -2,6 +2,7 @@
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
padding: 0; padding: 0;
scroll-behavior: smooth;
} }
#page-wrap { #page-wrap {
@ -138,17 +139,12 @@ header {
.menu { .menu {
display: initial; display: initial;
} }
} }
html{ html{
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
} }
p { p {
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
@ -262,3 +258,66 @@ footer{
margin: 4px 2px; margin: 4px 2px;
cursor: pointer; cursor: pointer;
} }
@-webkit-keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
@keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
.tracking-in-expand {
-webkit-animation: tracking-in-expand 0.7s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation: tracking-in-expand 0.7s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation-delay: .3s;
}
@-webkit-keyframes fade-in-bck {
0% {
-webkit-transform: translateZ(80px);
transform: translateZ(80px);
opacity: 0;
}
100% {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
}
}
@keyframes fade-in-bck {
0% {
-webkit-transform: translateZ(80px);
transform: translateZ(80px);
opacity: 0;
}
100% {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
}
}
.fade-in-bck {
-webkit-animation: fade-in-bck 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
animation: fade-in-bck 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -0,0 +1,138 @@
{% extends 'base.html' %}
{% load static %}
{% block optionalParams %}
<style>
html{
background: linear-gradient(180deg, rgba(70,147,48,1) 33%, rgba(109,126,107,1) 100%) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-family: Arial, Helvetica, sans-serif;
}
#page-wrap{
padding: 10vh;
}
@media only screen and (max-width: 600px) {
#page-wrap{
display: block;
}
}
h1{
font-size: xx-large;
}
p{
text-align: left;
}
@-webkit-keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
@keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
.tracking-in-expand {
-webkit-animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation-delay: .3s;
}
@-webkit-keyframes fade-in-bck {
0% {
-webkit-transform: translateZ(80px);
transform: translateZ(80px);
opacity: 0;
}
100% {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
}
}
@keyframes fade-in-bck {
0% {
-webkit-transform: translateZ(80px);
transform: translateZ(80px);
opacity: 0;
}
100% {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
}
}
.fade-in-bck {
-webkit-animation: fade-in-bck 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
animation: fade-in-bck 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}
</style>
{% endblock %}
{% block content %}
<div id="page-wrap" >
<section>
<h1 class="tracking-in-expand">Нашата цел и основни дейности</h1><br><br>
<p class="fade-in-bck" style="animation-delay: 0.6s;">
Основната цел на проекта е запознаване с ползите от рециклирането на учениците и подтикването им да започнат да събират разделно боклук.
Това е сайт, в който може да се качват видеа и снимки как ученици изхвърлят разделно боклуци.<br><br> За всеки материал получават конкретен брой точки (ел.валута), която обменят в училище за награди.
За една снимка получават 2 точки, а за едно видео 3 точки.
</p>
</section>
<hr><br>
<h1 class="tracking-in-expand" style="animation-delay: 0.6s;">Защо да участвам?</h1>
<p>
<ul class="tracking-in-expand" class="emoji" style="text-align: left; padding-left: 5%; margin: auto; animation-delay: 0.9s;">
<li class="tracking-in-expand" style="animation-delay: 1s"> Награден фонд за участие в проекта.</li><br>
<li class="tracking-in-expand" style="animation-delay: 1.1s"> Наградите се разпределят спрямо натрупаните точки в сайта.</li><br>
<li class="tracking-in-expand" style="animation-delay: 1.2s;"> Сертификат за участие в извънкласни дейности от името на училището при натрупани минимум 30 точки.</li><br>
</p>
</ul>
<!-- <br>
<hr>
<br>
<h1>Често задавани въпроси</h1><br>
<ul class="nothing" style="text-align: left; padding-left: 5%; margin: auto;">
<li class="question"></li>
<p>test</p>
</ul> -->
<br>
<hr>
<br>
<section id="contact" class="fade-in-bck" style="animation-delay: 1.5s;">
<h1>Имате въпроси?<br><h2>Свържете се с нас!</h2></h1><br>
<a href="https://discord.gg/twDtbKeVXV"><img src="{% static 'home/img/Discord-Logo.png' %}" style="max-width:100px;"></a>
<a href="mailto://boyan+revaluate@bobokara.com"><img src="{% static 'home/img/mail.png' %}" style="max-width:100px;"></a>
<a href="https://www.youtube.com/channel/UCIWblGtjXAxwbTMUbhZ_PDQ"><img src="{% static 'home/img/youtube.png' %}" style="max-width:100px;" ></a>
</section>
</div>
<footer style="bottom: 0; font-size: medium;">Frontend, backend and planning:<br> <a class="footer" href="{{ github }}" style="color:darkgreen">Boyan</a></footer>
{% endblock %}

View File

@ -11,6 +11,18 @@
<link rel="stylesheet" href="{% static 'home/css/style.css' %}"> <link rel="stylesheet" href="{% static 'home/css/style.css' %}">
<link rel="shortcut icon" type="image/png" href="{% static 'home/img/logo.png' %}"/> <link rel="shortcut icon" type="image/png" href="{% static 'home/img/logo.png' %}"/>
{% block optionalParams %}{% endblock %} {% block optionalParams %}{% endblock %}
<style>
@media only screen and (max-width: 1024px) {
.nav__links,
.cta {
display: none;
}
.menu {
display: initial;
}
}
</style>
</head> </head>
<body> <body>
{% block aboveNav %}{% endblock %} {% block aboveNav %}{% endblock %}
@ -25,7 +37,7 @@
{% endif %} {% endif %}
<li><a href="{% url 'leaderboard' %}"><u>Класация</u></a></li> <li><a href="{% url 'leaderboard' %}"><u>Класация</u></a></li>
<li><a href="#"><u>За нас</u></a></li> <li><a href="{% url 'About' %}"><u>За нас</u></a></li>
{% if isProcessor %} {% if isProcessor %}

View File

@ -12,58 +12,95 @@
-o-background-size: cover; -o-background-size: cover;
background-size: cover; background-size: cover;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
scroll-behavior: smooth;
}
@-webkit-keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
@keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
.tracking-in-expand {
-webkit-animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation-delay: .3s;
}
@-webkit-keyframes fade-in-bck {
0% {
-webkit-transform: translateZ(80px);
transform: translateZ(80px);
opacity: 0;
}
100% {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
}
}
@keyframes fade-in-bck {
0% {
-webkit-transform: translateZ(80px);
transform: translateZ(80px);
opacity: 0;
}
100% {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
}
}
.fade-in-bck {
-webkit-animation: fade-in-bck 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
animation: fade-in-bck 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}
#page-wrap{
padding: 10vh;
width: 25%;
}
@media only screen and (max-width: 1400px) {
#page-wrap{
width:100%;
}
} }
</style> </style>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div id="page-wrap"> <div id="page-wrap" style="display: flex; flex-direction: column; align-items: center;">
<h1 class="heading">reValuate</h1> <h1 class="heading tracking-in-expand">reValuate</h1>
<h3>Остават ни още:<br>{{ fullbalance }} reCoins</h3><br> <h3 class="tracking-in-expand" style="animation-delay: .6s;">Остават ни още:<br><span class="tracking-in-expand" style="animation-delay: .9s;">{{ fullbalance }} reCoins</span></h3><br>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<h3> Ти притежаваш <u>{{ userBalance }}</u> от тях.</h3> {% if userBalance %}
<h3 class="tracking-in-expand" style="animation-delay: 1s;"> Ти притежаваш <u>{{ userBalance }}</u> от тях.</h3>
<br> <br>
<h3>Твоят QR код:</h3>
<div id="qr" >{% qr_from_text userQR size="M" %} </div>
{% endif %} {% endif %}
<br> <h3 class="tracking-in-expand" style="animation-delay: 1.2s;">Твоят QR код:</h3>
<hr> <div id="qr" class="fade-in-bck" style="animation-delay: 1.5s; " >{% qr_from_text userQR size="M" %} </div>
<br> {% endif %}
<h1>Нашата цел и основни дейности</h1><br>
<p>
Основната цел на проекта е запознаване с ползите от рециклирането на учениците и подтикването им да започнат да събират разделно боклук.
Това е сайт, в който може да се качват видеа и снимки как ученици изхвърлят разделно боклуци.<br><br> За всеки материал получават конкретен брой точки (ел.валута), която обменят в училище за награди.
За една снимка получават 2 точки, а за едно видео 3 точки.
</p>
<hr><br>
<h1>Защо да участвам?</h1>
<p>
<ul class="emoji" style="text-align: left; padding-left: 5%; margin: auto;">
<li> Награден фонд за участие в проекта.</li><br>
<li> Наградите се разпределят спрямо натрупаните точки в сайта.</li><br>
<li> Сертификат за участие в извънкласни дейности от името на училището при натрупани минимум 30 точки.</li><br>
</p>
</ul>
<!-- <br>
<hr>
<br>
<h1>Често задавани въпроси</h1><br>
<ul class="nothing" style="text-align: left; padding-left: 5%; margin: auto;">
<li class="question"></li>
<p>test</p>
</ul> -->
<br>
<hr>
<br>
<h1>Имате въпроси?<br><h2>Свържете се с нас!</h2></h1><br>
<p id="contact">
<a href="https://discord.gg/twDtbKeVXV"><img src="{% static 'home/img/Discord-Logo.png' %}" style="max-width:100px;"></a>
<a href="mailto://boyan+revaluate@bobokara.com"><img src="{% static 'home/img/mail.png' %}" style="max-width:100px;"></a>
<a href="https://www.youtube.com/channel/UCIWblGtjXAxwbTMUbhZ_PDQ"><img src="{% static 'home/img/youtube.png' %}" style="max-width:100px;" ></a>
</p>
</div> </div>
<footer style="padding-bottom: 20px; font-size: medium;">Frontend, backend and planning:<br> <a class="footer" href="{{ github }}">Boyan</a></footer>
{% endblock %} {% endblock %}

View File

@ -42,31 +42,75 @@ html{
ul{ ul{
list-style-type:none; list-style-type:none;
} }
@-webkit-keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
@keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
.tracking-in-expand {
-webkit-animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation-delay: .3s;
}
.content{
border: cyan 5px solid;
}
@media screen and (max-width: 120px) {
#text{ #text{
overflow: hidden;
}
}
#page-wrap{
padding: 20vh; padding: 20vh;
} }
</style> </style>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="content">
<div id="page-wrap"> <div id="page-wrap">
<div id="text"> <div id="text">
<h1 style="font-size: 84px">reCoins Класация</h1><hr><br> <h1 style="vertical-align: top;" class="tracking-in-expand">reCoins Класация</h1><hr><br>
<ul>
{% for i, z in leaderboard.items %} {% for i, z in leaderboard.items %}
{% if forloop.counter == 1 %} {% if forloop.counter == 1 %}
<li id="one" class="scale-in-center">{{ forloop.counter }}. {{ i }} има {{ z }} </li><br> <li id="one" class="tracking-in-expand" style="animation-delay: .6s;">{{ forloop.counter }}. {{ i }} има {{ z }} </li><br>
{% elif forloop.counter == 2 %} {% elif forloop.counter == 2 %}
<li id="two" class="scale-in-center">{{ forloop.counter }}. {{ i }} има {{ z }} </li><br> <li id="two" class="tracking-in-expand" style="animation-delay: .9s;">{{ forloop.counter }}. {{ i }} има {{ z }} </li><br>
{% elif forloop.counter == 3 %} {% elif forloop.counter == 3 %}
<li id="three" class="scale-in-center">{{ forloop.counter }}. {{ i }} has {{ z }} </li> <br> <li id="three" class="tracking-in-expand" style="animation-delay: 1.2s;">{{ forloop.counter }}. {{ i }} has {{ z }} </li> <br>
{% else %} {% else %}
<li class="place">{{ forloop.counter }}. {{ i }} has {{ z }} </li> <br> <li class="place tracking-in-expand" style="animation-delay: 1.5s;">{{ forloop.counter }}. {{ i }} has {{ z }} </li> <br>
</ul> </ul>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -35,13 +35,46 @@ html{
display: block; display: block;
} }
} }
@-webkit-keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
@keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
.tracking-in-expand {
-webkit-animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation-delay: .3s;
}
</style> </style>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if user.is_authenticated %} {% if user.is_authenticated %}
<div id="page-wrap"> <div id="page-wrap" class="tracking-in-expand">
{% if approved %} {% if approved %}
<div id="approved"> <div id="approved">
@ -54,7 +87,7 @@ html{
{% if processing %} {% if processing %}
<div id="processing"> <div id="processing">
<img src="{% static 'home/img/loading.png' %}" width="128px"><br><br><br> <img src="{% static 'home/img/loading.png' %}" width="128px"><br><br><br>
<h2>Имаш <span style="color:yellow">{{ processing }}</span> медия, очакваща одобрение!</h2><br><br> <h2 >Имаш медия, очакваща одобрение!</h2><br><br>
</div> </div>
{% endif %} {% endif %}
@ -62,8 +95,16 @@ html{
<div id="declined"> <div id="declined">
<img src="{% static 'home/img/cross.png' %}" width="128px"><br><br><br> <img src="{% static 'home/img/cross.png' %}" width="128px"><br><br><br>
<h2 >Имаш <span style="color:red">{{ declined }}</span> отказана медия, ако мислиш, че това е грешка, <a href="/#contact"> свържи се с нас</a>!</h2> <h2 >Имаш <span style="color:red">{{ declined }}</span> отказана медия, ако мислиш, че това е грешка, <a href="/#contact"> свържи се с нас</a>!</h2>
{% endif %}
</div> </div>
{% endif %}
{% if no_media %}
<div style = "flex:1;">
<img src="{% static 'home/img/question.png' %}" width="128px"><br><br><br>
<h2>Нямаш качена медия! <a href="{% url 'Image' %}">Започни тук!</a></h2>
</div>
{% endif %}
</div> </div>
{% else %} {% else %}
<p>You are not logged in</p> <p>You are not logged in</p>

View File

@ -97,7 +97,39 @@
} }
#page-wrap{ #page-wrap{
padding: 20vh; padding:10vh;
width: 25%;
}
@-webkit-keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
@keyframes tracking-in-expand {
0% {
letter-spacing: -0.5em;
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
.tracking-in-expand {
-webkit-animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation: tracking-in-expand 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
animation-delay: .3s;
} }
</style> </style>
@ -112,7 +144,7 @@
{% endif %} {% endif %}
<div class="centered" id="page-wrap" style="text-align: center;"> <div class="centered tracking-in-expand" id="page-wrap" style="text-align: center;">
{% if user.is_authenticated %} {% if user.is_authenticated %}
{% if img_obj %} {% if img_obj %}
<h1 style="color:#7ac142;">Снимката ти е качена успешно!</h1> <h1 style="color:#7ac142;">Снимката ти е качена успешно!</h1>

View File

@ -30,10 +30,13 @@ def imageUpload(request):
else: else:
warning = False warning = False
try:
media = Media.objects.filter(user_id=request.user.id).last() media = Media.objects.filter(user_id=request.user.id).last()
print(media.tokenized) print(media.tokenized)
if media.tokenized is None: if media.tokenized is None:
return render(request, "wait.html") return render(request, "wait.html")
except AttributeError:
pass
print(request.user.id) print(request.user.id)
if request.method == 'POST': if request.method == 'POST':
@ -87,19 +90,25 @@ def viewMedia(request):
approved = [] approved = []
declined = [] declined = []
processing = [] processing = []
no_media=True
for i in get_status: for i in get_status:
if i.tokenized: if i.tokenized:
approved.append(i) approved.append(i)
if not i.tokenized: no_media = False
declined.append(i)
if i.tokenized is None:
processing.append(i)
if i.tokenized is False:
declined.append(i)
no_media = False
if i.tokenized is None:
no_media = False
processing.append(i)
context={ context={
"approved":len(approved), "approved":len(approved),
"declined":len(declined), "declined":len(declined),
"processing":len(processing), "processing":len(processing),
"no_media":no_media,
} }
return render (request, 'showAllImage.html', context) return render (request, 'showAllImage.html', context)

View File

@ -15,7 +15,7 @@ Including another URLconf
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path, include from django.urls import path, include
from home.views import homePage, leaderboard from home.views import homePage, leaderboard, about
from rest_framework import routers, urls from rest_framework import routers, urls
from api.views import BalanceView, ImageView, AllBalance from api.views import BalanceView, ImageView, AllBalance
from django.conf import settings from django.conf import settings
@ -25,7 +25,6 @@ from django.views.generic.base import TemplateView
from upload.views import uploadContent, imageUpload, viewMedia from upload.views import uploadContent, imageUpload, viewMedia
from users.views import getBalance, addToBalance, adminView, removeBalance from users.views import getBalance, addToBalance, adminView, removeBalance
router = routers.DefaultRouter() router = routers.DefaultRouter()
router.register("balance", BalanceView, basename="balance") router.register("balance", BalanceView, basename="balance")
router.register("images", ImageView, basename="image") router.register("images", ImageView, basename="image")
@ -45,7 +44,8 @@ urlpatterns = [
path("admin/", adminView, name="admin"), path("admin/", adminView, name="admin"),
path('administrator/', admin.site.urls), path('administrator/', admin.site.urls),
path('api/', include(router.urls)), path('api/', include(router.urls)),
path("leaderboard/", leaderboard, name="leaderboard") path("leaderboard/", leaderboard, name="leaderboard"),
path("about/", about, name="About")
] ]
if settings.DEBUG: if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, urlpatterns += static(settings.MEDIA_URL,