Fixed index

This commit is contained in:
teras 2017-10-07 22:56:51 +03:00
parent 663d8bb415
commit ea64f528dc
7 changed files with 266 additions and 35 deletions

View File

@ -25,6 +25,9 @@ urlpatterns = [
url(r'^login/', views.login_view),
url(r'^logout/', views.logout_view),
url(r'^register/', views.register),
url(r'^dashboard/', views.dashboard)
url(r'^challenge/', views.challenge),
url(r'^challenges/', views.dashboard),
url(r'^halloffame/', views.hall_of_fame),
url(r'^profile/(?P<username>[\w-]+)', views.profile)
] + static(settings.STATIC_URL, document_root=settings.STATICFILES_DIRS) + \
static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -60,7 +60,9 @@ def logout_view(request):
def challenge(request):
if request.method == 'POST':
if request.method == 'GET':
return render(request, 'challenge.html')
elif request.method == 'POST':
if not request.user.is_authenticated:
return HttpResponse('not logged in')
challenge_name = request.POST['challenge_name']
@ -72,4 +74,19 @@ def challenge(request):
def dashboard(request):
if request.method == 'GET':
return render(request, 'dashboard.html')
data = {'challenges': Challenge.objects.all()}
return render(request, 'dashboard.html', data)
def hall_of_fame(request):
if request.method == 'GET':
data = {
'users': User.objects.all()
}
return render(request, 'hall_of_fame.html', data)
def profile(request, username):
if request.method == 'GET':
return render(request, 'profile.html')

View File

@ -1,4 +1,4 @@
xxxh1, h2 {
h1, h2 {
font-family: 'Orbitron', cursive;
}
@ -51,3 +51,19 @@ xxxh1, h2 {
footer, .map {
background-color: #34495e !important;
}
.card{
width: 800px;
margin: 0 auto;
}
.progress{
height:10px;
}
.profile{
width:300px;
}
ul {
font-size: 20px;
line-height: 38px;
}

View File

@ -26,11 +26,13 @@
<div class="row container challenges">
<div class="col s12 m6">
{% for challenge in challenges %}
<div class="col s12 m6">
<div class="card small">
<div class="card-content">
<div class="card-title">Linnar Viigi muruniiduk lahti muukida</div>
<div class="card-title">{{ challenge.name }}</div>
<p>Immo peal, muru on pikk</p>
</br>
<div>
@ -40,31 +42,13 @@
</div>
</br>
<div class="center-align">
<a href="./challenge.html" class="btn-large">I can do it</a>
<a href="/challenge" class="btn-large">I can do it</a>
</div>
</div>
</div>
</div>
<div class="col s12 m6">
<div class="card small">
<div class="card-content">
<div class="card-title">Mälupulgalt andmete taastamine</div>
<p>K-spaces käidi vargil, maha jäi mälupulk. Kas sa saad selle põhjal kindlaks teha kellega oli tegu?</p>
</br>
<div>
<div class="chip">Electronics</div>
<div class="chip">Security</div>
</div>
</br>
<div class="center-align">
<a href="./challenge.html" class="btn-large">I can do it</a>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<!-- dashboard custom -->

115
templates/hall_of_fame.html Normal file
View File

@ -0,0 +1,115 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0" />
<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="/static/css/materialize.min.css">
<link rel="stylesheet" href="/static/css/app.css">
</head>
<body>
<div id="container" class="grey lighten-4">
<div class="header section center-align">
<h1 class="section z-depth-1 white-text">k-space.ee</h1>
</div>
<br><br><br>
<!-- landing page custom -->
<div class="row container">
<div class="section slogan">
<h2 class="center-align" style="font-weight:bold">HALL OF FAME<br></h2>
</div>
</div>
<!-- ideas solution success -->
<div class="row container section">
{% for user in users %}
<div class="col s12 m4">
<div class="section center-align">
<div class="card">
<div class="card-content white-text">
<div class="card-image">
<a href="/profile/{{ user.username }}"><img src='/media/{{ user.profile.icon }}'></a>
</div>
<h5 class="card-title" style="padding-top: 10px;color:black;"><a href="/profile/{{ user.username }}"><b>{{ user.username }}</b></a></h5>
<div class="col s12 m1">
<a href="#"><img src="https://images.vexels.com/media/users/3/143424/isolated/preview/2aa6cd7edd894a7cefa4eaf0f5916ee9-lightning-bolt-small-by-vexels.png" width="15" height="15" alt=""></a>
</div>
<div class="col s12 m10">
<div class="progress" style="background-color: #f1f1f1">
<div class="determinate" style="width: 70%; background-color:#ffc107;"></div>
</div>
</div>
<br>
<div class="col s12 m1">
<a href="#"><img src="https://www.chowan.edu/sites/chowan.edu/files/www/info-areas/sidebar-images/it-help-desk-logo.png" width="15" height="15" alt=""></a>
</div>
<div class="col s12 m10">
<div class="progress" style="background-color: #f1f1f1">
<div class="determinate" style="width: 70%; background-color:#3498db;"></div>
</div>
</div>
<div class="progress" style="background-color:#fff">
<div class="determinate" style="width: 70%; background-color:#ffffff;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
<footer class="page-footer">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">Contact</h5>
<p class="grey-text text-lighten-4">
<i class="material-icons">phone</i>&nbsp;Call Lauri 55 55 5555
</p>
<h5 class="white-text">Sponsors</h5>
<p class="grey-text text-lighten-4">
We have more than 10 companies supporting us financially and by equipment
</br>
<a href="#">I want to become a sponsor</a>
</p>
</div>
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Links</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="#!">Location</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Mission</a></li>
<li><a class="grey-text text-lighten-3" href="#!">People</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2017 k-space
<!-- <a class="grey-text text-lighten-4 right" href="#!">More Links</a> -->
</div>
</div>
</footer>
</div>
<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="/static/js/app.js"></script>
</body>
</html>

View File

@ -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="static/css/materialize.min.css">
<link rel="stylesheet" href="static/css/app.css">
<link rel="stylesheet" href="/static/css/materialize.min.css">
<link rel="stylesheet" href="/static/css/app.css">
</head>
<body>
@ -61,10 +61,9 @@
</div>
</div>
<a href="#" class="btn-large blue hide-on-med-and-up">to ideas</a>
<a href="/challenges" class="btn-large blue hide-on-med-and-up">to ideas</a>
</div>
</div>
<div class="col s12 m4">
@ -97,7 +96,7 @@
</p>
</div>
</div>
<a href="#" class="btn-large green hide-on-med-and-up">to success</a>
<a href="/halloffame" class="btn-large green hide-on-med-and-up">to success</a>
</div>
</div>
@ -105,13 +104,13 @@
<div class="row container center-align hide-on-small-only">
<div class="col s12 m4">
<a class="btn-large blue" href="/dashboard">to ideas</a>
<a class="btn-large blue" href="/challenges">to ideas</a>
</div>
<div class="col s12 m4">
<a href="#" class="btn-large amber ">to equipment</a>
</div>
<div class="col s12 m4">
<a href="#" class="btn-large green ">to success</a>
<a href="/halloffame" class="btn-large green ">to success</a>
</div>
</div>
@ -289,10 +288,10 @@
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Links</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="#!">Location</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Mission</a></li>
<li><a class="grey-text text-lighten-3" href="#!">People</a></li>
</ul>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1015.5421689053422!2d24.659768056865254!3d59.39830538168295!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x469295abf80677bd%3A0x89a6e8a5671f608b!2sAkadeemia+tee+21%2F1%2C+12618+Tallinn!5e0!3m2!1set!2see!4v1507405326247" width="350" height="200" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
</div>
</div>
@ -308,7 +307,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="static/js/app.js"></script>
<script src="/static/js/app.js"></script>
</body>
</html>

97
templates/profile.html Normal file
View File

@ -0,0 +1,97 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0" />
<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="/static/css/materialize.min.css">
<link rel="stylesheet" href="/static/css/app.css">
</head>
<body>
<div id="container" class="grey lighten-4">
<div class="header section center-align">
<h1 class="section z-depth-1 white-text">k-space.ee</h1>
</div>
<br><br><br>
<!-- landing page custom -->
<!-- ideas solution success -->
<div class="row container section">
<div class="col s12 m5" style="height:600px;padding-top: 10px;">
<div>
<div class="image">
<img style="height: 450px;" src="https://image.freepik.com/free-icon/profile-image-square-of-facebook_318-37395.jpg">
</div>
</div>
</div>
<div class="col s12 m3 l3" >
<h2 class="center-align" style="font-weight:bold;font-size: 50px;">Username<br></h2>
<div class="card" style="width:700px;background-color: #34495e;border-radius: 5px;margin: auto 0">
<div class="card-content white-text">
<span class="card-title" style="font-weight: normal">Description</span>
<p style="font-size: 18px;">I am a very simple man. I am good at processing small bits of information.
I am convenient because I require little food to function effectively.</p><br>
<span class="card-title" style="font-weight: normal">Achievements</span>
<ul>
<li><a class="grey-text text-lighten-3" href="#!">Achievement 1</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Achievement 2</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Achievement 3</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Achievement 4</a></li>
</ul>
</div>
</div>
</div>
</div>
<footer class="page-footer">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">Contact</h5>
<p class="grey-text text-lighten-4">
<i class="material-icons">phone</i>&nbsp;Call Lauri 55 55 5555
</p>
<h5 class="white-text">Sponsors</h5>
<p class="grey-text text-lighten-4">
We have more than 10 companies supporting us financially and by equipment
</br>
<a href="#">I want to become a sponsor</a>
</p>
</div>
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Links</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="#!">Location</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Mission</a></li>
<li><a class="grey-text text-lighten-3" href="#!">People</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2017 k-space
<!-- <a class="grey-text text-lighten-4 right" href="#!">More Links</a> -->
</div>
</div>
</footer>
</div>
<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="/static/js/app.js"></script>
</body>
</html>