Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
9c0abf24
Commit
9c0abf24
authored
Nov 13, 2016
by
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
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
go/go/templates/admin/useradmin.html
View file @
9c0abf24
...
...
@@ -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=
"_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>
...
...
@@ -178,7 +178,7 @@ SRCT Go • Administration Panel
<!-- <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=
"_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"> -->
...
...
go/go/templates/blocked.html
View file @
9c0abf24
...
...
@@ -2,7 +2,7 @@
{% block title %}
SRCT Go
•
Account
Not Approv
ed
SRCT Go
•
Account
Block
ed
{% endblock %}
...
...
@@ -33,7 +33,7 @@ SRCT Go • Account Not Approved
If you belive this is in error please contact Go Admins.
<br
/>
<br/>
Thank you,
A
nd have a nice day!
Thank you,
a
nd have a nice day!
</p>
<br/><br/>
</div>
...
...
go/go/views.py
View file @
9c0abf24
...
...
@@ -31,14 +31,15 @@ def index(request):
"""
# 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.
el
if
not
request
.
user
.
is_authenticated
():
return
render
(
request
,
'public_landing.html'
)
if
not
request
.
user
.
is_authenticated
():
return
render
(
request
,
'public_landing.html'
)
# If the user isn't approved, don't give them any leeway.
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
...
...
@@ -350,6 +351,7 @@ def useradmin(request):
# toblock.user.delete()
toblock
.
blocked
=
True
toblock
.
approved
=
False
toblock
.
registered
=
False
toblock
.
save
()
elif
'_unblock'
in
request
.
POST
:
for
name
in
userlist
:
...
...
@@ -369,10 +371,10 @@ def useradmin(request):
settings
.
EMAIL_FROM
,
[
user_mail
]
)
#
toblock.user.delete()
toUNblock
.
blocked
=
False
toUNblock
.
approved
=
Tru
e
toUNblock
.
save
()
to
UN
block
.
user
.
delete
()
#
toUNblock.blocked = False
#
toUNblock.approved =
Fals
e
#
toUNblock.save()
elif
'_remove'
in
request
.
POST
:
for
name
in
userlist
:
toremove
=
RegisteredUser
.
objects
.
get
(
user__username__exact
=
name
)
...
...
go/static/css/styles.css
View file @
9c0abf24
...
...
@@ -34,3 +34,6 @@ body {
.navbar-brand
{
padding
:
10px
15px
;
}
.btn-blockUsr
{
font-weight
:
600
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment