added the 2 points photo, 3 points video thing

This commit is contained in:
Yamozha 2021-06-04 11:16:14 +03:00
parent d43a2d4cf2
commit 5eab487307
16 changed files with 17 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -53,7 +53,7 @@
<source src="/media/{{ image }}" type="video/mp4"> <source src="/media/{{ image }}" type="video/mp4">
</video> </video>
{% else %} {% else %}
<img src="/media/{{ image }}" width="500" width="500" ><br> <img src="/media/{{ image }}" style="max-width:500px; max-height: 500px;"><br>
{% endif %} {% endif %}
</div><br> </div><br>
<p style="text-shadow: 0 0 2px #28a745; float: left;">{{time}} <p style="text-shadow: 0 0 2px #28a745; float: right;">{{date}}</p></p> <p style="text-shadow: 0 0 2px #28a745; float: left;">{{time}} <p style="text-shadow: 0 0 2px #28a745; float: right;">{{date}}</p></p>

View File

@ -25,7 +25,9 @@
</head> </head>
<body> <body>
{% block aboveNav %} {% endblock %} {% block aboveNav %} {% endblock %}
<nav class="navbar navbar-expand-lg bg-success"> <a style="color: white; font-size: 200%;" class="navbar-brand mb-0 h1" href="/"> reValuate | </a> <div>
<nav class="navbar navbar-expand-lg fixed-top bg-success">
<a style="color: white; font-size: 200%;" class="navbar-brand mb-0 h1" href="/"> reValuate | </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#target" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#target" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-bars" style="color:#000; font-size:28px;"></i> <i class="fas fa-bars" style="color:#000; font-size:28px;"></i>
@ -71,6 +73,7 @@
</div> </div>
</ul> </ul>
</nav> </nav>
</div>
{% block content %} {% block content %}
{% endblock %} {% endblock %}

View File

@ -19,7 +19,8 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if user.is_authenticated %} {% if user.is_authenticated %}
<div class="centered">
<div class="mx-auto">
{% for i in get_status reversed %} {% for i in get_status reversed %}

View File

@ -83,17 +83,23 @@ def adminView(request):
if request.method == "POST": if request.method == "POST":
if request.POST['isValid'] == "Valid": if request.POST['isValid'] == "Valid":
imageObj = Media.objects.get(image=latestPicture, user_id=userId)
if imageObj.is_video:
token_count = 3
else:
token_count = 2
try: try:
user_instance = Balance.objects.get(user=userId) user_instance = Balance.objects.get(user=userId)
sum_balance = 5 + user_instance.balanceValue sum_balance = token_count + user_instance.balanceValue
balAdd = Balance(balanceValue=sum_balance, user_id=user_instance) balAdd = Balance(balanceValue=sum_balance, user_id=user_instance)
balAdd.save() balAdd.save()
print(balAdd) print(balAdd)
except Balance.DoesNotExist: except Balance.DoesNotExist:
balAdd = Balance(balanceValue=5, user_id=userId) balAdd = Balance(balanceValue=token_count, user_id=userId)
balAdd.save() balAdd.save()
imageObj = Media.objects.get(image=latestPicture, user_id=userId)
imageObj.tokenized = True imageObj.tokenized = True
imageObj.managed_by = request.user.username imageObj.managed_by = request.user.username