mirror of
https://github.com/Rushilwiz/tj2023.git
synced 2025-04-20 12:00:17 -04:00
fixed indexing
This commit is contained in:
parent
a631263a4c
commit
680d7786cf
|
@ -11,7 +11,7 @@
|
||||||
<p class="lead">We are the class to beat!</p>
|
<p class="lead">We are the class to beat!</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container news mb-5">
|
<div class="container news mb-2">
|
||||||
<h1 class="text-center font-weight-bold">2023 News</h1>
|
<h1 class="text-center font-weight-bold">2023 News</h1>
|
||||||
<br><br>
|
<br><br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if bar %}
|
{% for bar in bars %}
|
||||||
<div class="container news">
|
<div class="container news">
|
||||||
<h1 class="text-center font-weight-bold">{{ bar.name }}!</h1>
|
<h1 class="text-center font-weight-bold">{{ bar.name }}!</h1>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
@ -55,5 +55,5 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endfor %}
|
||||||
{% endblock content %}
|
{% endblock content %}
|
|
@ -4,21 +4,17 @@ from .models import Story, Bar
|
||||||
|
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
def index(request):
|
def index(request):
|
||||||
try:
|
stories = Story.objects.all().order_by('-created')[:3]
|
||||||
stories = Story.objects.all().order_by('-created')
|
bar = Bar.objects.all()[:1]
|
||||||
bar = Bar.objects.all()[0]
|
|
||||||
stories = stories[:3]
|
|
||||||
except Exception:
|
|
||||||
stories = []
|
|
||||||
bar = None
|
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
'stories': stories,
|
'stories': stories,
|
||||||
'animate': True,
|
'animate': True,
|
||||||
'bar': bar
|
'bars': bar
|
||||||
}
|
}
|
||||||
|
print(stories)
|
||||||
|
|
||||||
return render(request, 'pages/index.html', context)
|
return render(request, 'pages/index.html', context=context)
|
||||||
|
|
||||||
|
|
||||||
def council(request):
|
def council(request):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user