Skip to content

Commit

Permalink
Get rid of 'Matryoshka' of boxes and drop setting subject when replying.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickygerritsen committed Feb 17, 2024
1 parent 3ceab94 commit d3c3b6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
4 changes: 3 additions & 1 deletion webapp/src/Controller/Team/ClarificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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()) {
Expand Down
22 changes: 6 additions & 16 deletions webapp/templates/team/partials/clarification_content.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,13 @@
<div class="card card-body">
{{ form_start(form) }}
{{ form_row(form.recipient) }}
{{ form_row(form.subject) }}
<div class="list-group mb-3">
<div class="list-group-item">
<div class="flex-column">
<label for="team_clarification_message" class="form-label text-muted d-flex justify-content-end"><small>message</small></label>
</div>
{{ form_row(form.message) }}
{{ form_row(form.message) }}
<div class="mb-3">
<div class="flex-column">
<label class="form-label text-muted d-flex justify-content-end"><small>message preview</small></label>
</div>
<div class="list-group-item">
<div class="mb-3">
<div class="flex-column">
<label class="form-label text-muted d-flex justify-content-end"><small>message preview</small></label>
</div>
<div class="card">
<div class="card-body" id="messagepreview">Start typing to see a preview of your message</div>
</div>
</div>
<div class="card">
<div class="card-body" id="messagepreview">Start typing to see a preview of your message</div>
</div>
</div>
{{ form_end(form) }}
Expand Down

0 comments on commit d3c3b6b

Please sign in to comment.