Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Boodle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martina Therese R. Reyes
Boodle
Commits
bbce06e2
Commit
bbce06e2
authored
Mar 12, 2022
by
Felizia Tiburcio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edits to homepage layout
parent
e1ac6726
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
8 deletions
+50
-8
styles.css
boodlesite/static/css/styles.css
+11
-3
views.py
main/views.py
+39
-5
No files found.
boodlesite/static/css/styles.css
View file @
bbce06e2
...
@@ -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
soli
d
black
;
border
:
2px
dotte
d
black
;
}
}
.event
{
.event
{
...
...
main/views.py
View file @
bbce06e2
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
):
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"
)
return
render
(
request
,
"boodlesite/templates/auction.html"
)
def
test
(
request
):
return
HttpResponse
(
"Hellotest"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment