Skip to content

Commit

Permalink
fix: doesn't ref .through as it's not a manager
Browse files Browse the repository at this point in the history
removes is_solo and all solo teams

removes empty translate ref as empty string doesn't result in empty translation

+ compiles said translations
  • Loading branch information
JasonLovesDoggo committed Dec 10, 2023
1 parent 770aed8 commit 8d6d16c
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 127 deletions.
2 changes: 1 addition & 1 deletion .idea/scavenger.iml

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

2 changes: 0 additions & 2 deletions core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ def clean(self):
raise ValidationError(
f"Teams for hunt: {self.instance.hunt.name} can only have a max of {self.instance.hunt.max_team_size} members. You tried to set it to {total_objs}"
)
elif self.instance.is_solo and total_objs > 1:
raise ValidationError("Solo groups can only have one member")
elif total_objs <= 0:
if self.request is not None:
messages.warning(
Expand Down
Binary file modified core/locale/ja_JP/LC_MESSAGES/django.mo
Binary file not shown.
151 changes: 83 additions & 68 deletions core/locale/ja_JP/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#: .\core\templates\core\base.html:22
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-12-05 00:21-0500\n"
"POT-Creation-Date: 2023-12-09 22:30-0500\n"
"PO-Revision-Date: 2022-12-16 20:24+EST\n"
"Last-Translator: にぃゆい <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -18,15 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: .\core\admin.py:14
msgid "Set selected users as a Location Setter"
msgstr ""

#: .\core\admin.py:25
msgid "Set selected users as a Logic Puzzle Setter"
msgstr ""

#: .\core\admin.py:117
#: .\core\admin.py:112
msgid "Link to Hint Page"
msgstr ""

Expand All @@ -50,23 +41,23 @@ msgstr ""
msgid "ago"
msgstr ""

#: .\core\templates\core\base.html:104
#: .\core\templates\core\base.html:100
msgid "Home"
msgstr "ホーム"

#: .\core\templates\core\base.html:111
#: .\core\templates\core\base.html:107
msgid "Admin"
msgstr "管理"

#: .\core\templates\core\base.html:116
#: .\core\templates\core\base.html:112
msgid "current"
msgstr "最新ヒント"

#: .\core\templates\core\base.html:120 .\core\templates\core\logout.html:6
#: .\core\templates\core\base.html:116 .\core\templates\core\logout.html:6
msgid "Logout"
msgstr "ログアウト"

#: .\core\templates\core\base.html:127
#: .\core\templates\core\base.html:123
msgid "Login"
msgstr ""

Expand Down Expand Up @@ -98,7 +89,11 @@ msgstr ""
msgid "hints"
msgstr "ヒント"

#: .\core\templates\core\credits.html:48
#: .\core\templates\core\credits.html:47
msgid "logic puzzle"
msgstr ""

#: .\core\templates\core\credits.html:53
msgid "support"
msgstr ""

Expand Down Expand Up @@ -132,7 +127,7 @@ msgstr ""
"\n"
"%(username)s、ようこそ!\n"

#: .\core\templates\core\index.html:25
#: .\core\templates\core\index.html:26
#, fuzzy, python-format
#| msgid ""
#| "\n"
Expand All @@ -141,9 +136,9 @@ msgstr ""
#| " "
msgid ""
"\n"
" %(hunt_name)s has started! go decrypt your <a href=\"%(first_url)s"
" %(hunt_name)s has started! go decrypt your <a href=\"%(first_url)s"
"\">first hint</a>!\n"
" "
" "
msgstr ""
"\n"
"がらくた集め、開始!<a href=\"%(first_url)s\">最初の二次元コード</a>を当て"
Expand All @@ -158,23 +153,14 @@ msgstr ""
#| " "
msgid ""
"\n"
" or, would you like to <a href=\"%(invite_url)s\">invite more team "
" or, would you like to <a href=\"%(invite_url)s\">invite more team "
"members</a>?\n"
" "
msgstr ""
"\n"
"未だ<a href=\"%(invite_url)s\">メンバー招待</a>も出来るよ。"

#: .\core\templates\core\index.html:39
msgid ""
"\n"
" you're going solo\n"
" "
msgstr ""
"\n"
"ソロプレイ"
"未だ<a href=\"%(invite_url)s\">メンバー招待</a>も出来るよ。"

#: .\core\templates\core\index.html:43
#: .\core\templates\core\index.html:37
#, python-format
msgid ""
"\n"
Expand All @@ -184,17 +170,20 @@ msgstr ""
"\n"
"チームプレイ:%(team)s"

#: .\core\templates\core\index.html:52 .\core\templates\core\team_join.html:10
#: .\core\templates\core\index.html:45 .\core\templates\core\team_join.html:22
msgid "join a team"
msgstr "チームに参加"

#: .\core\templates\core\index.html:55 .\core\templates\core\team_new.html:10
#: .\core\templates\core\index.html:48 .\core\templates\core\team_new.html:21
msgid "make a team"
msgstr "チームを作る"

#: .\core\templates\core\index.html:62
msgid "go solo "
msgstr "ソロプレイ"
#: .\core\templates\core\index.html:55
msgid ""
"\n"
" no future scavenger hunt is scheduled, please check back later\n"
" "
msgstr ""

#: .\core\templates\core\logout.html:10 .\core\templates\core\logout.html:16
#, fuzzy
Expand Down Expand Up @@ -272,15 +261,11 @@ msgstr ""
msgid "Join a Team"
msgstr "チームに参加"

#: .\core\templates\core\team_join.html:14
#: .\core\templates\core\team_join.html:24
msgid "either enter your team's join code"
msgstr "チームの参加コードを入れるか"

#: .\core\templates\core\team_join.html:18
msgid "Join"
msgstr "参加"

#: .\core\templates\core\team_join.html:20
#: .\core\templates\core\team_join.html:34
msgid "or, scan your team's QR code"
msgstr "チームの二次元コードをスキャンしてにゃ"

Expand All @@ -290,63 +275,93 @@ msgstr "チームの二次元コードをスキャンしてにゃ"
msgid "Make a Team"
msgstr "チームを作る"

#: .\core\templates\core\team_new.html:24
msgid "create"
msgstr "作成"
#: .\core\utils\actions.py:33
msgid "Set selected users as a Logic Puzzle Setter"
msgstr ""

#: .\core\utils\actions.py:43
msgid "Remove selected users as a Logic Puzzle Setter"
msgstr ""

#: .\core\utils\actions.py:53
msgid "Set selected users as a Qr Code Setter"
msgstr ""

#: .\core\utils\actions.py:63
msgid "Remove selected users as a Qr Code Setter"
msgstr ""

#: .\core\views\qr.py:27
msgid "Please join a team or choose to go solo before getting a hint."
#, fuzzy
#| msgid "Please join a team or choose to go solo before getting a hint."
msgid "Please join or create a team before getting a hint."
msgstr "ヒントを見る前に、ソロプレイするかチームでするか決めてにゃ!"

#: .\core\views\qr.py:41
#: .\core\views\qr.py:40
msgid "No future hunts are scheduled."
msgstr ""

#: .\core\views\qr.py:70
#: .\core\views\qr.py:62
#, fuzzy
#| msgid "Since the hunt has already begun, switching teams is disallowed."
msgid ""
"Since the hunt has already begun, creating/switching/joining teams is "
"disallowed. If you need to do one of the above, please contact an organizer."
msgstr "もう始まってるから、チーム変えるのはダメダメだからね。"

#: .\core\views\qr.py:90
msgid "No hunt is currently active."
msgstr ""

#: .\core\views\qr.py:88
#: .\core\views\qr.py:107
#, fuzzy
#| msgid "Contest has not started yet."
msgid "Contest has ended."
msgstr "未だ始まってないよ〜"

#: .\core\views\qr.py:93
#: .\core\views\qr.py:112
msgid "Contest has not started yet."
msgstr "未だ始まってないよ〜"

#: .\core\views\qr.py:138
#: .\core\views\qr.py:167
msgid "You are not on the first QR code."
msgstr ""

#: .\core\views\team.py:26
#, fuzzy
#| msgid "Since the hunt has already begun, switching teams is disallowed."
msgid ""
"Since the hunt has already begun, switching teams is disallowed. If you need "
"to switch teams, please contact an admin."
msgstr "もう始まってるから、チーム変えるのはダメダメだからね。"

#: .\core\views\team.py:46
#: .\core\views\team.py:37
#, python-format
msgid "Joined team %(team_name)s"
msgstr "チーム%(team_name)sに参加したにゃ"

#: .\core\views\team.py:52
#: .\core\views\team.py:43
#, python-format
msgid "Team %(team_name)s is full."
msgstr "チーム%(team_name)sはもう満杯だよ"

#: .\core\views\team.py:71
msgid "Since the hunt has already begun, making new teams is disallowed."
msgstr "もう始まったから、新しいチーム作るのはダメだよ。"

#: .\core\views\team.py:87
#: .\core\views\team.py:75
#, python-format
msgid "Made team %(team_name)s"
msgstr "チーム%(team_name)sをつくったよ。"

#~ msgid ""
#~ "\n"
#~ " you're going solo\n"
#~ " "
#~ msgstr ""
#~ "\n"
#~ "ソロプレイ"

#~ msgid "go solo "
#~ msgstr "ソロプレイ"

#~ msgid "Join"
#~ msgstr "参加"

#~ msgid "create"
#~ msgstr "作成"

#~ msgid "Since the hunt has already begun, making new teams is disallowed."
#~ msgstr "もう始まったから、新しいチーム作るのはダメだよ。"

#~ msgid "__startsPost"
#~ msgstr "で始まるにゃ"

Expand Down
16 changes: 0 additions & 16 deletions core/migrations/0021_alter_hint_options.py

This file was deleted.

16 changes: 16 additions & 0 deletions core/migrations/0022_remove_team_solo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 4.1.13 on 2023-12-10 03:34

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("core", "0021_alter_hint_options_qrcode_created_at_teammembership_and_more"),
]

operations = [
migrations.RemoveField(
model_name="team",
name="solo",
),
]
5 changes: 2 additions & 3 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ class Team(models.Model):
default=False
) # todo use this field to have a club-like page so you can join an open team (future feature)
current_qr_i = models.IntegerField(default=0)
solo = models.BooleanField(default=False)
members = models.ManyToManyField(
User, related_name="teams", related_query_name="teams", through=TeamMembership
)
Expand All @@ -173,7 +172,7 @@ def leave(self, member: User):
if self.members.filter(id=member.id).first() is None:
raise IndexError("User is not in team")
# remove the member
self.members.through.remove(member)
self.members.remove(member) # noqa

def update_current_qr_i(self, i: int):
self.current_qr_i = max(self.current_qr_i, i)
Expand All @@ -192,7 +191,7 @@ def join(self, user: User):
return
if self.is_full:
raise IndexError("Team is full")
self.members.through.add(user)
self.members.add(user) # noqa

def invites(self):
return Invite.objects.filter(team=self)
Expand Down
6 changes: 1 addition & 5 deletions core/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{ START.timestamp }} * 1000,
{{ END.timestamp }} * 1000,
"{{ hunt.name }} {% translate "starts in" %}", {# starts pre #}
"{% translate '' %}", {# starts post #}
"", {# starts post #}
"{% translate 'Only' %}", {# ends pre #}
"{% translate 'remaining' %}", {# ends post #}
"{{ hunt.name }} {% translate 'ended' %}", {# ended pre #}
Expand Down Expand Up @@ -85,11 +85,7 @@ <h1>{% block header %}{% endblock %}</h1>
<nav id="main-header" class="main-header">
<div class="identity">
{% if request.user.in_team %}
{% if not request.user.current_team.solo %}
<span class="team-name">{{ request.user.current_team.name }}</span>
{% else %}
<span class="team-name">solo</span>
{% endif %}
{% endif %}
<span class="username">{{ request.user.username }}</span>
</div>
Expand Down
Loading

0 comments on commit 8d6d16c

Please sign in to comment.