Skip to content

Commit

Permalink
adds the basics for /team/
Browse files Browse the repository at this point in the history
fix: updates index to have the url for leaving (will prob switch to a url to /team in the future)
  • Loading branch information
JasonLovesDoggo committed Dec 10, 2023
1 parent 7b9002c commit cb5570a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/templates/core/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@ <h3>
your team: {{ team }}
{% endblocktranslate %}
{% if not IN_HUNT or request.user.team.hunt.allow_creation_post_start %}

<a class="button" href="{% url 'team_invite' %}">{% translate "invite more team members" %}</a>

<span class="small-text">
{% blocktranslate %}
to switch teams, simply join a new team via the qr code or url
{% endblocktranslate %}
</span>
<a class="button" href="{% url 'team_leave' %}">{% translate "leave team" %}</a>
{% endif %}
{% endif %}
</h3>
Expand Down
36 changes: 36 additions & 0 deletions core/templates/core/team.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% extends "core/base.html" %}
{% load static %}
{% load i18n %}
{% load qr %}

{% block title %}
{% translate "Team Information" %}
{% endblock %}

{% block head_end %}
<link rel="stylesheet" href="{% static 'core/team.css' %}"/>
{% endblock %}

{% block body %}
<div class="team-content">
{% if request.user.in_team %}
<div class="team-heading">
{% translate "Team Information" %}
</div>
<p>{% translate "Team Name:" %} {{ request.user.current_team.name }}</p>
<p>{% translate "Team Members:" %} {{ request.user.current_team.members.count }}</p>
<p>{% translate "Current QR Code:" %} {{ request.user.current_team.qr_len }}</p>
<!-- Add more details about the team's progress as needed -->

{% comment %} Logic Puzzle Hints {% endcomment %}
<div class="logic-hints">
<h3>{% translate "Logic Puzzle Hints:" %}</h3>
{% for clue in request.user.current_team.logic_puzzle_hints %}
<p>{{ clue }}</p>
{% endfor %}
</div>
{% else %}
<p>{% translate "You are not part of any team." %}</p>
{% endif %}
</div>
{% endblock %}
1 change: 1 addition & 0 deletions core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
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"),
path("team/make/", team.make, name="team_new"),
path("team/invite", team.invite, name="team_invite"),
Expand Down
6 changes: 6 additions & 0 deletions core/views/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ def leave(request):
return render(request, "core/team_leave.html")


@login_required
@require_http_methods(["GET"])
@team_required
def team(q: HttpRequest):
return render(q, "core/team.html")

@login_required
@require_http_methods(["GET"])
@team_required
Expand Down

0 comments on commit cb5570a

Please sign in to comment.