Commit bbce06e2 authored by Felizia Tiburcio's avatar Felizia Tiburcio

Edits to homepage layout

parent e1ac6726
......@@ -7,9 +7,11 @@ body {
color: #3d3838;
}
h1 {
background-color: blue;
.carousel-item img {
max-height: 600px;
min-width: auto;
}
/* nav bar */
nav {
background: black;
......@@ -74,6 +76,12 @@ nav {
/* homepage happening now */
.title-container {
display: flex;
padding: 8px 32px;
justify-content: center;
}
@media(max-width:480px){
.event-container{
display: flex;
......@@ -88,7 +96,7 @@ nav {
justify-content: center;
background-color: #ffc2c2;
padding: 8px;
border: 2px solid black;
border: 2px dotted black;
}
.event {
......
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import *
from datetime import datetime, timedelta
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