Skip to content

Commit 0a85aa4

Browse files
committed
Clean up team index page.
Changes: - the striped tables don't provide a lot of additional value (anymore?), and I think the gray bites with table header - perhaps do the same changes later on other pages - The bold-ing of the submissions that have not been clicked is unnecessary - there is no real additional content that we want teams to acknowledge. We probably should use the unread column in the database for notifications instead - Remove the from/to columns for the clarification side and also remove the word "problem" in the subject column. from/to makes sense for jury interface but not so much for teams.
1 parent db01ff3 commit 0a85aa4

File tree

5 files changed

+18
-35
lines changed

5 files changed

+18
-35
lines changed

webapp/src/Entity/Clarification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,6 @@ public function getSummary(): string
352352
$newBody .= $line . ' ';
353353
}
354354
}
355-
return Utils::cutString(html_entity_decode((empty($newBody) ? $this->getBody() : $newBody)), 80);
355+
return Utils::cutString(html_entity_decode((empty($newBody) ? $this->getBody() : $newBody)), 120);
356356
}
357357
}

webapp/templates/team/partials/clarification_list.html.twig

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
{% endif %}
55

66
<div class="table-wrapper">
7-
<table class="data-table table table-striped table-hover table-sm" style="width:100%;">
7+
<table class="data-table table table-hover table-sm" style="width:100%;">
88
<thead class="thead-light">
99
<tr>
1010
<th scope="col">time</th>
11-
<th scope="col">from</th>
12-
<th scope="col">to</th>
1311
{% if includeSubject %}
1412
<th scope="col">subject</th>
1513
{% endif %}
@@ -26,33 +24,12 @@
2624
{{ clarification.submittime | printtime(null, clarification.contest) }}
2725
</a>
2826
</td>
29-
{%- if clarification.sender is null %}
30-
{%- set sender = 'Jury' %}
31-
{%- if clarification.recipient is null %}
32-
{%- set recipient = 'All' %}
33-
{%- else %}
34-
{%- set recipient = clarification.recipient.effectiveName %}
35-
{%- endif %}
36-
{%- else %}
37-
{%- set recipient = 'Jury' %}
38-
{%- set sender = clarification.sender.effectiveName %}
39-
{%- endif %}
4027

41-
<td>
42-
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}" title="{{ sender }}">
43-
{{ sender | u.truncate(teamname_max_length, '') }}
44-
</a>
45-
</td>
46-
<td>
47-
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}" title="{{ recipient }}">
48-
{{ recipient | u.truncate(teamname_max_length, '') }}
49-
</a>
50-
</td>
5128
{% if includeSubject %}
5229
<td>
5330
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}">
5431
{%- if clarification.problem -%}
55-
problem {{ clarification.contestProblem | problemBadge -}}
32+
{{ clarification.contestProblem | problemBadge -}}
5633
{%- elseif clarification.category -%}
5734
{{- categories[clarification.category]|default('general') -}}
5835
{%- else -%}
@@ -64,7 +41,15 @@
6441

6542
<td>
6643
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}">
67-
{{ clarification.summary | markdown_to_html | sanitize_html('app.clarification_sanitizer') }}
44+
{%- if clarification.sender is null and clarification.recipient is not null %}
45+
<i class="fa-solid fa-reply" title="Reply to you"></i>&nbsp;
46+
{%- endif %}
47+
<i>{{ clarification.summary
48+
| markdown_to_html
49+
| replace({'<p>': '', '</p>': ''})
50+
| sanitize_html('app.clarification_sanitizer')
51+
| raw
52+
}}</i>
6853
</a>
6954
</td>
7055
</tr>

webapp/templates/team/partials/submission_list.html.twig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% if submissions is empty %}
55
<div class="alert alert-warning">No submissions</div>
66
{% else %}
7-
<table class="data-table table table-hover table-striped table-sm submissions-table">
7+
<table class="data-table table table-hover table-sm submissions-table">
88
<thead class="thead-light">
99
<tr>
1010
<th scope="col">time</th>
@@ -30,9 +30,6 @@
3030
{% if not submission.valid %}
3131
{% set classes = classes ~ ' ignore' %}
3232
{% endif %}
33-
{% if submission.judgings.first is empty or not submission.judgings.first.seen %}
34-
{% set classes = classes ~ ' unseen' %}
35-
{% endif %}
3633
<tr class="{{ classes }}">
3734
<td>
3835
<a data-ajax-modal data-ajax-modal-after="markSeen" {% if link %}href="{{ link }}"{% endif %}>
@@ -81,7 +78,7 @@
8178
{% endif %}
8279
{% if allowDownload %}
8380
<td>
84-
<a title="Download submission ZIP" aria-label="download submission zip" class="btn btn-light" href="{{ path('team_submission_download', {'submitId': submission.submitid}) }}">
81+
<a title="Download submission ZIP" aria-label="download submission zip" href="{{ path('team_submission_download', {'submitId': submission.submitid}) }}">
8582
<i class="fa fa-file-archive"></i>
8683
</a>
8784
</td>

webapp/tests/Unit/Controller/Team/ClarificationControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testClarificationRequest(): void
2323
$this->verifyRedirectToURL('http://localhost/team');
2424

2525
// Now check if we actually have this clarification.
26-
self::assertSelectorExists('html:contains("problem C")');
26+
self::assertSelectorExists('html:contains("C")');
2727
self::assertSelectorExists('html:contains("I don\'t understand this problem")');
2828
}
2929
}

webapp/tests/Unit/Entity/ClarificationTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function testSummary(): void
1515
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
1616
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.';
1717
$clarification->setBody($text);
18-
static::assertEquals('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod …',
18+
static::assertEquals('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magn',
1919
$clarification->getSummary());
2020
}
2121

@@ -50,9 +50,10 @@ public function testMergeNewlines(): void
5050
sixth line,
5151
seventh line,
5252
eighth line,
53+
ninth line,
5354
and so on.';
5455
$clarification->setBody($text);
55-
static::assertEquals('First line, second line, third line, fourth line, fifth line, sixth line, sevent',
56+
static::assertEquals('First line, second line, third line, fourth line, fifth line, sixth line, seventh line, eighth line, ninth line, and so ',
5657
$clarification->getSummary());
5758
}
5859
}

0 commit comments

Comments
 (0)