From a716abfd55eb221aea99d242255d20d572125dac Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Wed, 24 Jul 2024 09:15:47 +0200 Subject: [PATCH 1/2] Fix indentation/alignment --- webapp/src/Service/DOMJudgeService.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/webapp/src/Service/DOMJudgeService.php b/webapp/src/Service/DOMJudgeService.php index 33dde946e6..daa569b6ca 100644 --- a/webapp/src/Service/DOMJudgeService.php +++ b/webapp/src/Service/DOMJudgeService.php @@ -421,16 +421,16 @@ public function getUpdates(): array if ($this->checkrole('balloon')) { $balloonsQuery = $this->em->createQueryBuilder() - ->select('b.balloonid', 't.name', 't.location', 'p.name AS pname') - ->from(Balloon::class, 'b') - ->leftJoin('b.submission', 's') - ->leftJoin('s.problem', 'p') - ->leftJoin('s.contest', 'co') - ->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem') - ->leftJoin('s.team', 't') - ->andWhere('co.cid = :cid') - ->andWhere('b.done = 0') - ->setParameter('cid', $contest->getCid()); + ->select('b.balloonid', 't.name', 't.location', 'p.name AS pname') + ->from(Balloon::class, 'b') + ->leftJoin('b.submission', 's') + ->leftJoin('s.problem', 'p') + ->leftJoin('s.contest', 'co') + ->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem') + ->leftJoin('s.team', 't') + ->andWhere('co.cid = :cid') + ->andWhere('b.done = 0') + ->setParameter('cid', $contest->getCid()); $freezetime = $contest->getFreezeTime(); if ($freezetime !== null && !(bool)$this->config->get('show_balloons_postfreeze')) { From a09454356ebd71f5dd65b6eec68d066cb6a12a4a Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:36:53 +0200 Subject: [PATCH 2/2] Don't display number of balloons when no contest is active This fixes: https://domjudge.sentry.io/issues/5634564396/?project=6376669&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=14d&stream_index=1 On the main balloonpage we don't display those balloons so it makes sense to also not update the counter in the menu. --- webapp/src/Service/DOMJudgeService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/Service/DOMJudgeService.php b/webapp/src/Service/DOMJudgeService.php index daa569b6ca..97cf50dedf 100644 --- a/webapp/src/Service/DOMJudgeService.php +++ b/webapp/src/Service/DOMJudgeService.php @@ -419,7 +419,7 @@ public function getUpdates(): array } } - if ($this->checkrole('balloon')) { + if ($this->checkrole('balloon') && $contest) { $balloonsQuery = $this->em->createQueryBuilder() ->select('b.balloonid', 't.name', 't.location', 'p.name AS pname') ->from(Balloon::class, 'b')