mirror of
https://github.com/Rushilwiz/tj2023.git
synced 2025-04-10 23:30: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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container news mb-5">
|
||||
<div class="container news mb-2">
|
||||
<h1 class="text-center font-weight-bold">2023 News</h1>
|
||||
<br><br>
|
||||
<div class="row">
|
||||
|
@ -27,7 +27,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% if bar %}
|
||||
{% for bar in bars %}
|
||||
<div class="container news">
|
||||
<h1 class="text-center font-weight-bold">{{ bar.name }}!</h1>
|
||||
<br><br>
|
||||
|
@ -55,5 +55,5 @@
|
|||
});
|
||||
</script>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endblock content %}
|
|
@ -4,21 +4,17 @@ from .models import Story, Bar
|
|||
|
||||
# Create your views here.
|
||||
def index(request):
|
||||
try:
|
||||
stories = Story.objects.all().order_by('-created')
|
||||
bar = Bar.objects.all()[0]
|
||||
stories = stories[:3]
|
||||
except Exception:
|
||||
stories = []
|
||||
bar = None
|
||||
stories = Story.objects.all().order_by('-created')[:3]
|
||||
bar = Bar.objects.all()[:1]
|
||||
|
||||
context = {
|
||||
'stories': stories,
|
||||
'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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user