From d3c3b6bc6c0cadf505049aeedfda68fe0af49884 Mon Sep 17 00:00:00 2001 From: Nicky Gerritsen Date: Sat, 17 Feb 2024 19:28:42 +0100 Subject: [PATCH] Get rid of 'Matryoshka' of boxes and drop setting subject when replying. --- .../Team/ClarificationController.php | 4 +++- .../partials/clarification_content.html.twig | 22 +++++-------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/webapp/src/Controller/Team/ClarificationController.php b/webapp/src/Controller/Team/ClarificationController.php index 11f4c3edf8..ab376d91b2 100644 --- a/webapp/src/Controller/Team/ClarificationController.php +++ b/webapp/src/Controller/Team/ClarificationController.php @@ -70,7 +70,7 @@ public function viewAction(Request $request, int $clarId): Response if ($clarification->getProblem()) { $formData['subject'] = sprintf('%d-%d', $clarification->getContest()->getCid(), $clarification->getProblem()->getProbid()); } else { - $formData['subject'] = sprintf('%d-%s', $clarification->getContest()->getCid(), $clarification->getQueue()); + $formData['subject'] = sprintf('%d-%s', $clarification->getContest()->getCid(), $clarification->getCategory()); } $formData['message'] = "> " . str_replace("\n", "\n> ", Utils::wrapUnquoted($clarification->getBody())) . "\n\n"; @@ -80,6 +80,8 @@ public function viewAction(Request $request, int $clarId): Response ->setAction($this->generateUrl('team_clarification', ['clarId' => $clarId])) ->getForm(); + $form->remove('subject'); + $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { diff --git a/webapp/templates/team/partials/clarification_content.html.twig b/webapp/templates/team/partials/clarification_content.html.twig index f3f5ea63d0..366514f01e 100644 --- a/webapp/templates/team/partials/clarification_content.html.twig +++ b/webapp/templates/team/partials/clarification_content.html.twig @@ -9,23 +9,13 @@
{{ form_start(form) }} {{ form_row(form.recipient) }} - {{ form_row(form.subject) }} -
-
-
- -
- {{ form_row(form.message) }} + {{ form_row(form.message) }} +
+
+
-
-
-
- -
-
-
Start typing to see a preview of your message
-
-
+
+
Start typing to see a preview of your message
{{ form_end(form) }}