diff --git a/.idea/scavenger.iml b/.idea/scavenger.iml index 7a335b4..7acc9e6 100644 --- a/.idea/scavenger.iml +++ b/.idea/scavenger.iml @@ -14,7 +14,7 @@ - + diff --git a/core/admin.py b/core/admin.py index 76d3b7f..1a18489 100644 --- a/core/admin.py +++ b/core/admin.py @@ -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( diff --git a/core/locale/ja_JP/LC_MESSAGES/django.mo b/core/locale/ja_JP/LC_MESSAGES/django.mo index 00d2ad3..fdff195 100644 Binary files a/core/locale/ja_JP/LC_MESSAGES/django.mo and b/core/locale/ja_JP/LC_MESSAGES/django.mo differ diff --git a/core/locale/ja_JP/LC_MESSAGES/django.po b/core/locale/ja_JP/LC_MESSAGES/django.po index 4fd3628..25a31d8 100644 --- a/core/locale/ja_JP/LC_MESSAGES/django.po +++ b/core/locale/ja_JP/LC_MESSAGES/django.po @@ -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 , 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: にぃゆい <+@nyiyui.ca>\n" "Language-Team: LANGUAGE \n" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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" @@ -141,9 +136,9 @@ msgstr "" #| " " msgid "" "\n" -" %(hunt_name)s has started! go decrypt your first hint!\n" -" " +" " msgstr "" "\n" "がらくた集め、開始!最初の二次元コードを当て" @@ -158,23 +153,14 @@ msgstr "" #| " " msgid "" "\n" -" or, would you like to invite more team " +" or, would you like to invite more team " "members?\n" -" " -msgstr "" -"\n" -"未だメンバー招待も出来るよ。" - -#: .\core\templates\core\index.html:39 -msgid "" -"\n" -" you're going solo\n" " " msgstr "" "\n" -"ソロプレイ" +"未だメンバー招待も出来るよ。" -#: .\core\templates\core\index.html:43 +#: .\core\templates\core\index.html:37 #, python-format msgid "" "\n" @@ -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 @@ -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 "チームの二次元コードをスキャンしてにゃ" @@ -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 "で始まるにゃ" diff --git a/core/migrations/0021_alter_hint_options.py b/core/migrations/0021_alter_hint_options.py deleted file mode 100644 index 5b664f5..0000000 --- a/core/migrations/0021_alter_hint_options.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 4.1.13 on 2023-12-08 01:15 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("core", "0020_alter_logicpuzzlehint_qr_index_and_more"), - ] - - operations = [ - migrations.AlterModelOptions( - name="hint", - options={}, - ), - ] diff --git a/core/migrations/0022_remove_team_solo.py b/core/migrations/0022_remove_team_solo.py new file mode 100644 index 0000000..69acab5 --- /dev/null +++ b/core/migrations/0022_remove_team_solo.py @@ -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", + ), + ] diff --git a/core/models.py b/core/models.py index ba79f56..0f64175 100644 --- a/core/models.py +++ b/core/models.py @@ -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 ) @@ -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) @@ -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) diff --git a/core/templates/core/base.html b/core/templates/core/base.html index bbc51f2..2c994c0 100644 --- a/core/templates/core/base.html +++ b/core/templates/core/base.html @@ -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 #} @@ -85,11 +85,7 @@ {% block header %}{% endblock %} {% if request.user.in_team %} - {% if not request.user.current_team.solo %} {{ request.user.current_team.name }} - {% else %} - solo - {% endif %} {% endif %} {{ request.user.username }} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 44b8336..cb52956 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -26,28 +26,20 @@ {{ hunt_name }} has started! go decrypt your first hint! {% endblocktranslate %} - {% if not request.user.current_team.solo %} {% url 'team_invite' as invite_url %} {% blocktranslate %} or, would you like to invite more team members? {% endblocktranslate %} - {% endif %} {% else %} {% if request.user.in_team %} - {% if request.user.current_team.solo %} - {% blocktranslate %} - you're going solo - {% endblocktranslate %} - {% else %} {% blocktranslate with team=request.user.current_team.name %} your team: {{ team }} {% endblocktranslate %} {% endif %} - {% endif %} - {% if not request.user.in_team or request.user.current_team.solo %} + {% if not request.user.in_team %} {% translate "join a team" %} @@ -55,14 +47,6 @@ {% translate "make a team" %} {% endif %} - {% if not request.user.in_team or not request.user.current_team.solo %} - - - {% csrf_token %} - - - - {% endif %} {% endif %} {% else %} diff --git a/core/urls.py b/core/urls.py index 944655b..35d3f39 100644 --- a/core/urls.py +++ b/core/urls.py @@ -14,7 +14,6 @@ path("signal", qr.qr_signal, name="qr_signal"), path("team/join/", team.join, name="join"), path("team/make/", team.make, name="team_new"), - path("team/solo", team.solo, name="team_solo"), path("team/invite", team.invite, name="team_invite"), path("clues", puzzle.logic_clues, name="logic_clues"), path("credits", index.credits, name="credits"), diff --git a/core/views/qr.py b/core/views/qr.py index e403f12..7c8ef78 100644 --- a/core/views/qr.py +++ b/core/views/qr.py @@ -24,7 +24,7 @@ def wrapped(*args, **kwargs): if request.user.current_team is None: messages.error( request, - _("Please join a team or choose to go solo before getting a hint."), + _("Please join or create a team before getting a hint."), ) return redirect(reverse("index")) return f(*args, **kwargs) diff --git a/core/views/team.py b/core/views/team.py index b30712a..65677f1 100644 --- a/core/views/team.py +++ b/core/views/team.py @@ -81,19 +81,6 @@ def make(request): return render(request, "core/team_new.html", dict(form=form)) -@login_required -@upcoming_hunt_required -@block_if_current_hunt -def solo(q: HttpRequest): - hunt_ = Hunt.current_hunt() or Hunt.next_hunt() - team_ = Team.objects.create( - solo=True, hunt=hunt_, name=f"{q.user.username}'s Solo Team" - ) - team_.join(q.user) - - return redirect(reverse("index")) - - @login_required @require_http_methods(["GET"]) @team_required