New static links
This commit is contained in:
@@ -8,31 +8,7 @@ from .models import *
|
|||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
user = 'not logged in'
|
return render(request, 'index.html')
|
||||||
if request.user.is_authenticated:
|
|
||||||
user = request.user.username
|
|
||||||
|
|
||||||
challenges = Challenge.objects.all()
|
|
||||||
challenge_pair = UserChallenge.objects.all()
|
|
||||||
users = User.objects.all()
|
|
||||||
user_data = []
|
|
||||||
|
|
||||||
for u in users:
|
|
||||||
data = {
|
|
||||||
'user': u,
|
|
||||||
'total_challenges': len(UserChallenge.objects.filter(user=u))
|
|
||||||
}
|
|
||||||
user_data.append(data)
|
|
||||||
|
|
||||||
template_dict = {
|
|
||||||
'logged_in': user,
|
|
||||||
'challenges': challenges,
|
|
||||||
'challenge_pair': challenge_pair,
|
|
||||||
'users': user_data
|
|
||||||
}
|
|
||||||
|
|
||||||
return render(request, 'landing.html', template_dict)
|
|
||||||
|
|
||||||
|
|
||||||
@csrf_protect
|
@csrf_protect
|
||||||
def register(request):
|
def register(request):
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
<title>K-space</title>
|
<title>K-space</title>
|
||||||
<link href="https://fonts.googleapis.com/css?family=Orbitron" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Orbitron" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="./materialize.min.css">
|
<link rel="stylesheet" href="static/css/materialize.min.css">
|
||||||
<link rel="stylesheet" href="./app.css">
|
<link rel="stylesheet" href="static/css/app.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -304,7 +304,7 @@
|
|||||||
|
|
||||||
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js"></script>
|
||||||
<script src="./app.js"></script>
|
<script src="static/js/app.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user