Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
JasonLovesDoggo committed Dec 19, 2023

Verified

This commit was signed with the committer’s verified signature.
JasonLovesDoggo Jason Cameron
2 parents 12dbe88 + 12a3567 commit 11e1df8
Showing 8 changed files with 119 additions and 126 deletions.
2 changes: 1 addition & 1 deletion .idea/dataSources.local.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 7 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
# Scavenger Hunt Website

A scavenger hunt website designed to prevent any form of cheating and RNG-based wins on a typical scavenger hunt. It was created in Django and uses OAuth 2.0 / OIDC-ish with the main [Metropolis](https://maclyonsden.com) site to handle authentication.

<img alt="screenshot of the main page" src="https://github.com/wlmac/scavenger/assets/45807097/194b5ad8-d2f9-49a9-951f-5dd6d3ab51c3" height="400px"></img>

A scavenger hunt website designed to prevent any form of cheating and RNG-based wins on a typical scavenger hunt. It was created in Django uses a Oauth 2.0 system with the main mld (metropolis) site to handle authentication.



## credits
### project manager
Patrick Lin
Patrick Lin
### programming
nyiyui,
Jason Cameron,
Jimmy Liu,
Glen Lin,
Joshua Wang,
Chelsea Wong
nyiyui, Jason Cameron, Jimmy Liu, Glen Lin, Joshua Wang, Chelsea Wong
### content
Misheel Batkhuu
Misheel Batkhuu
### UI/UX design
Chelsea Wong

Chelsea Wong

# setup

Binary file modified core/locale/ja_JP/LC_MESSAGES/django.mo
Binary file not shown.
192 changes: 98 additions & 94 deletions core/locale/ja_JP/LC_MESSAGES/django.po

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/models.py
Original file line number Diff line number Diff line change
@@ -115,7 +115,7 @@ def code_pks(cls, team: "Team"):
hunt_codes = hunt.middle_locations.all()
pks = [a["pk"] for a in hunt_codes.values("pk")]
r.shuffle(pks)
pks = pks[: hunt.path_length]
pks = pks[: hunt.path_length] # cut qr's to max ( path length )
if hunt_end := hunt.ending_location:
pks.append(hunt_end.id)
if hunt_start := hunt.starting_location:
9 changes: 9 additions & 0 deletions core/static/core/base.css
Original file line number Diff line number Diff line change
@@ -146,6 +146,15 @@ a:visited {
text-decoration: none;
}

@media screen and (max-width: 700px){
.button {
display: block;
width: max-content;
margin: auto;
margin-top: 10px;
}
}

.button:hover {
background: hsl(0deg 100% 90%);;
}
1 change: 0 additions & 1 deletion core/urls.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
path("qr/<str:key>", qr.qr, name="qr"),
path("first", qr.qr_first, name="qr_first"),
path("current", qr.qr_current, name="qr_current"),
path("catalog", qr.qr_catalog, name="qr_catalog"),
path("signal", qr.qr_signal, name="qr_signal"),
path("team", team.team, name="team"),
path("team/join/", team.join, name="join"),
19 changes: 3 additions & 16 deletions core/views/qr.py
Original file line number Diff line number Diff line change
@@ -180,30 +180,17 @@ def qr_first(request):
@during_hunt
def qr_current(request):
i = request.user.current_team.current_qr_i
first_ = i == 0
if first_:
if i == 0: # on first qr code
return redirect(reverse("qr_first"))
context = dict(first=first_, current=True)
i -= 1 # we want the index that they are AT not the next one
context = dict(current=True)
codes = QrCode.codes(request.user.current_team)
context["qr"] = codes[i]
context["nexthint"] = None if len(codes) <= (j := i + 1) else codes[j]
context["logic_hint"] = LogicPuzzleHint.get_clue(request.user.current_team)
return render(request, "core/qr.html", context=context)


@login_required
@require_http_methods(["GET", "POST"])
@team_required
@during_hunt
def qr_catalog(request):
i = request.user.current_team.current_qr_i
if i == 0:
return redirect(reverse("qr_first"))
context = dict(current=True)
context["qr"] = QrCode.codes(request.user.current_team)[:i] # i + 1?
return render(request, "core/qr_catalog.html", context=context)


global_notifs = Signal()


0 comments on commit 11e1df8

Please sign in to comment.