Commit bbce06e2 authored by Felizia Tiburcio's avatar Felizia Tiburcio

Edits to homepage layout

parent e1ac6726
...@@ -7,9 +7,11 @@ body { ...@@ -7,9 +7,11 @@ body {
color: #3d3838; color: #3d3838;
} }
h1 { .carousel-item img {
background-color: blue; max-height: 600px;
min-width: auto;
} }
/* nav bar */ /* nav bar */
nav { nav {
background: black; background: black;
...@@ -74,6 +76,12 @@ nav { ...@@ -74,6 +76,12 @@ nav {
/* homepage happening now */ /* homepage happening now */
.title-container {
display: flex;
padding: 8px 32px;
justify-content: center;
}
@media(max-width:480px){ @media(max-width:480px){
.event-container{ .event-container{
display: flex; display: flex;
...@@ -88,7 +96,7 @@ nav { ...@@ -88,7 +96,7 @@ nav {
justify-content: center; justify-content: center;
background-color: #ffc2c2; background-color: #ffc2c2;
padding: 8px; padding: 8px;
border: 2px solid black; border: 2px dotted black;
} }
.event { .event {
......
from django.shortcuts import render, redirect from django.shortcuts import render, redirect
from django.http import HttpResponse from django.http import HttpResponse
from .models import *
from datetime import datetime, timedelta
def homepage(request): def homepage(request):
return render(request, "boodlesite/templates/index.html") print(Auction.objects.all())
# Filter by auctions happening right now
auctions_now = Auction.objects.filter(auctionstart__lt=datetime.now(),auctionend__gt=datetime.now())
for auction in auctions_now: #
print(auction)
# Filter by auctions scheduled at most a week from now
week_range = datetime.now() + timedelta(days=7)
auctions_soon = Auction.objects.filter(auctionstart__lt=week_range).exclude(auctionstart__lte=datetime.now())
for auction in auctions_soon: #
print(auction)
context = {
'auctions_now': auctions_now,
'auctions_soon': auctions_soon
}
return render(request, "boodlesite/templates/index.html",context)
def auction(request, pk):
# Current auction ID
auction = Auction.objects.get(pk=pk)
# print('auction', pk, auction)
# print(auction.title,auction.info)
if auction.auctionend < datetime.now():
return HttpResponse("This auction has already passed.")
elif auction.auctionstart > datetime.now():
return HttpResponse("This auction has not yet started.")
else:
return render(request, "boodlesite/templates/auction.html")
def auction(request):
return render(request, "boodlesite/templates/auction.html")
def test(request):
return HttpResponse("Hellotest")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment