Challenge preview on front page

This commit is contained in:
teras 2017-10-08 12:04:01 +03:00
parent 140878df57
commit f08449d71a
3 changed files with 20 additions and 50 deletions

1
.gitignore vendored
View File

@ -106,3 +106,4 @@ tasks.xml
media/icons
challenges/migrations
static/

View File

@ -8,7 +8,10 @@ from .models import *
def index(request):
if request.method == 'GET':
return render(request, 'index.html')
data = {
'challenges': Challenge.objects.all()
}
return render(request, 'index.html', data)
@csrf_protect

View File

@ -289,58 +289,24 @@
</div>
</div>
<div class="row challenges">
<div class="col s12 m3">
<div class="card small">
<div class="card-content">
<div class="card-title">name here</div>
<p>Description here</p>
</br>
<div>
<div class="chip">security</div>
{% for challenge in challenges %}
<div class="col s12 m3">
<div class="card small">
<div class="card-content">
<div class="card-title">{{ challenge.name }}</div>
<p>{{ challenge.description }}</p>
</br>
<div>
{% for tag in challenge.tags.all %}
<div class="chip">{{ tag.name }}</div>
{% endfor %}
</div>
</br>
</div>
</br>
</div>
</div>
</div>
<div class="col s12 m3">
<div class="card small">
<div class="card-content">
<div class="card-title">name here</div>
<p>Description here</p>
</br>
<div>
<div class="chip">security</div>
</div>
</br>
</div>
</div>
</div>
<div class="col s12 m3">
<div class="card small">
<div class="card-content">
<div class="card-title">name here</div>
<p>Description here</p>
</br>
<div>
<div class="chip">security</div>
</div>
</br>
</div>
</div>
</div>
<div class="col s12 m3">
<div class="card small">
<div class="card-content">
<div class="card-title">name here</div>
<p>Description here</p>
<br>
<div>
<div class="chip">security</div>
</div>
<br>
</div>
</div>
</div>
{% endfor %}
</div>
<br>
<div class="row">