Commit 9c0abf24 authored by Zosman's avatar Zosman
Browse files

this commit should be the final draft. once the bugs are worked through i think it will be ready

parent 9a8657b2
Pipeline #439 passed with stage
in 7 minutes and 37 seconds
...@@ -67,7 +67,7 @@ SRCT Go • Administration Panel ...@@ -67,7 +67,7 @@ SRCT Go • Administration Panel
<input type="submit" name="_approve" value="Approve" class="btn btn-primary btn-sm"> <input type="submit" name="_approve" value="Approve" class="btn btn-primary btn-sm">
<input type="submit" name="_deny" value="Deny" class="btn btn-danger btn-sm"> <input type="submit" name="_deny" value="Deny" class="btn btn-danger btn-sm">
<input type="submit" name="_block" value="Block" class="btn btn-default btn-sm" style="background-color: black; color: white;"> <input type="submit" name="_block" value="Block" class="btn btn-default btn-sm btn-blockUsr" style="background-color: black; color: white;">
</div> </div>
...@@ -178,7 +178,7 @@ SRCT Go &bull; Administration Panel ...@@ -178,7 +178,7 @@ SRCT Go &bull; Administration Panel
<!-- <input type="submit" name="_approve" value="Approve" class="btn btn-primary btn-sm"> --> <!-- <input type="submit" name="_approve" value="Approve" class="btn btn-primary btn-sm"> -->
<input type="submit" name="_remove" value="Remove" class="btn btn-danger btn-sm"> <input type="submit" name="_remove" value="Remove" class="btn btn-danger btn-sm">
<input type="submit" name="_block" value="Block" class="btn btn-default btn-sm" style="background-color: black; color: white;"> <input type="submit" name="_block" value="Block" class="btn btn-default btn-sm btn-blockUsr" style="background-color: black; color: white;">
<!-- <input type="submit" name="_unblock" value="Un-Block" class="btn btn-default btn-sm"> --> <!-- <input type="submit" name="_unblock" value="Un-Block" class="btn btn-default btn-sm"> -->
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% block title %} {% block title %}
SRCT Go &bull; Account Not Approved SRCT Go &bull; Account Blocked
{% endblock %} {% endblock %}
...@@ -33,7 +33,7 @@ SRCT Go &bull; Account Not Approved ...@@ -33,7 +33,7 @@ SRCT Go &bull; Account Not Approved
If you belive this is in error please contact Go Admins. If you belive this is in error please contact Go Admins.
<br /> <br />
<br/> <br/>
Thank you, And have a nice day! Thank you, and have a nice day!
</p> </p>
<br/><br/> <br/><br/>
</div> </div>
......
...@@ -31,14 +31,15 @@ def index(request): ...@@ -31,14 +31,15 @@ def index(request):
""" """
# If the user is blocked, redirect them to the blocked page. # If the user is blocked, redirect them to the blocked page.
if request.user.registereduser.blocked:
return render(request, 'blocked.html')
# If the user is not authenticated, show them a public landing page. # If the user is not authenticated, show them a public landing page.
elif not request.user.is_authenticated(): if not request.user.is_authenticated():
return render(request, 'public_landing.html') return render(request, 'public_landing.html')
# If the user isn't approved, don't give them any leeway. # If the user isn't approved, don't give them any leeway.
elif not request.user.registereduser.approved: elif not request.user.registereduser.approved:
return render(request, 'not_registered.html') if request.user.registereduser.blocked:
return render(request, 'blocked.html')
else:
return render(request, 'not_registered.html')
url_form = URLForm(host=request.META.get('HTTP_HOST')) # unbound form url_form = URLForm(host=request.META.get('HTTP_HOST')) # unbound form
...@@ -350,6 +351,7 @@ def useradmin(request): ...@@ -350,6 +351,7 @@ def useradmin(request):
# toblock.user.delete() # toblock.user.delete()
toblock.blocked = True toblock.blocked = True
toblock.approved = False toblock.approved = False
toblock.registered = False
toblock.save() toblock.save()
elif '_unblock' in request.POST: elif '_unblock' in request.POST:
for name in userlist: for name in userlist:
...@@ -369,10 +371,10 @@ def useradmin(request): ...@@ -369,10 +371,10 @@ def useradmin(request):
settings.EMAIL_FROM, settings.EMAIL_FROM,
[user_mail] [user_mail]
) )
# toblock.user.delete() toUNblock.user.delete()
toUNblock.blocked = False # toUNblock.blocked = False
toUNblock.approved = True # toUNblock.approved = False
toUNblock.save() # toUNblock.save()
elif '_remove' in request.POST: elif '_remove' in request.POST:
for name in userlist: for name in userlist:
toremove = RegisteredUser.objects.get(user__username__exact=name) toremove = RegisteredUser.objects.get(user__username__exact=name)
......
...@@ -34,3 +34,6 @@ body { ...@@ -34,3 +34,6 @@ body {
.navbar-brand { .navbar-brand {
padding: 10px 15px; padding: 10px 15px;
} }
.btn-blockUsr {
font-weight: 600;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment