New static links
This commit is contained in:
parent
9ed7ff6e69
commit
ae2085d474
@ -8,31 +8,7 @@ from .models import *
|
||||
|
||||
def index(request):
|
||||
if request.method == 'GET':
|
||||
user = 'not logged in'
|
||||
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)
|
||||
|
||||
return render(request, 'index.html')
|
||||
|
||||
@csrf_protect
|
||||
def register(request):
|
||||
|
@ -7,8 +7,8 @@
|
||||
<title>K-space</title>
|
||||
<link href="https://fonts.googleapis.com/css?family=Orbitron" 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="./app.css">
|
||||
<link rel="stylesheet" href="static/css/materialize.min.css">
|
||||
<link rel="stylesheet" href="static/css/app.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -304,7 +304,7 @@
|
||||
|
||||
<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="./app.js"></script>
|
||||
<script src="static/js/app.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user