Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion webapp/src/Entity/Clarification.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,6 @@ public function getSummary(): string
$newBody .= $line . ' ';
}
}
return Utils::cutString(html_entity_decode((empty($newBody) ? $this->getBody() : $newBody)), 80);
return Utils::cutString(html_entity_decode((empty($newBody) ? $this->getBody() : $newBody)), 120);
}
}
43 changes: 17 additions & 26 deletions webapp/templates/team/partials/clarification_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
{% endif %}

<div class="table-wrapper">
<table class="data-table table table-striped table-hover table-sm" style="width:100%;">
<table class="data-table table table-hover table-sm" style="width:100%;">
<thead class="thead-light">
<tr>
<th scope="col">time</th>
<th scope="col">from</th>
<th scope="col">to</th>
{% if includeSubject %}
<th scope="col">subject</th>
{% endif %}
<th scope="col">to</th>
<th scope="col">text</th>
</tr>
</thead>
Expand All @@ -26,33 +25,12 @@
{{ clarification.submittime | printtime(null, clarification.contest) }}
</a>
</td>
{%- if clarification.sender is null %}
{%- set sender = 'Jury' %}
{%- if clarification.recipient is null %}
{%- set recipient = 'All' %}
{%- else %}
{%- set recipient = clarification.recipient.effectiveName %}
{%- endif %}
{%- else %}
{%- set recipient = 'Jury' %}
{%- set sender = clarification.sender.effectiveName %}
{%- endif %}

<td>
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}" title="{{ sender }}">
{{ sender | u.truncate(teamname_max_length, '…') }}
</a>
</td>
<td>
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}" title="{{ recipient }}">
{{ recipient | u.truncate(teamname_max_length, '…') }}
</a>
</td>
{% if includeSubject %}
<td>
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}">
{%- if clarification.problem -%}
problem {{ clarification.contestProblem | problemBadge -}}
{{ clarification.contestProblem | problemBadge -}}
{%- elseif clarification.category -%}
{{- categories[clarification.category]|default('general') -}}
{%- else -%}
Expand All @@ -62,9 +40,22 @@
</td>
{% endif %}

<td>
{%- if clarification.sender is null and clarification.recipient is not null %}
you
{%- else %}
all
{%- endif -%}
</td>

<td>
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}">
{{ clarification.summary | markdown_to_html | sanitize_html('app.clarification_sanitizer') }}
<i>{{ clarification.summary
| markdown_to_html
| replace({'<p>': '', '</p>': ''})
| sanitize_html('app.clarification_sanitizer')
| raw
}}</i>
</a>
</td>
</tr>
Expand Down
7 changes: 2 additions & 5 deletions webapp/templates/team/partials/submission_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% if submissions is empty %}
<div class="alert alert-warning">No submissions</div>
{% else %}
<table class="data-table table table-hover table-striped table-sm submissions-table">
<table class="data-table table table-hover table-sm submissions-table">
<thead class="thead-light">
<tr>
<th scope="col">time</th>
Expand All @@ -30,9 +30,6 @@
{% if not submission.valid %}
{% set classes = classes ~ ' ignore' %}
{% endif %}
{% if submission.judgings.first is empty or not submission.judgings.first.seen %}
{% set classes = classes ~ ' unseen' %}
{% endif %}
<tr class="{{ classes }}">
<td>
<a data-ajax-modal data-ajax-modal-after="markSeen" {% if link %}href="{{ link }}"{% endif %}>
Expand Down Expand Up @@ -81,7 +78,7 @@
{% endif %}
{% if allowDownload %}
<td>
<a title="Download submission ZIP" aria-label="download submission zip" class="btn btn-light" href="{{ path('team_submission_download', {'submitId': submission.submitid}) }}">
<a title="Download submission ZIP" aria-label="download submission zip" href="{{ path('team_submission_download', {'submitId': submission.submitid}) }}">
<i class="fa fa-file-archive"></i>
</a>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testClarificationRequest(): void
$this->verifyRedirectToURL('http://localhost/team');

// Now check if we actually have this clarification.
self::assertSelectorExists('html:contains("problem C")');
self::assertSelectorExists('html:contains("C")');
self::assertSelectorExists('html:contains("I don\'t understand this problem")');
}
}
5 changes: 3 additions & 2 deletions webapp/tests/Unit/Entity/ClarificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function testSummary(): void
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.';
$clarification->setBody($text);
static::assertEquals('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod …',
static::assertEquals('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magn…',
$clarification->getSummary());
}

Expand Down Expand Up @@ -50,9 +50,10 @@ public function testMergeNewlines(): void
sixth line,
seventh line,
eighth line,
ninth line,
and so on.';
$clarification->setBody($text);
static::assertEquals('First line, second line, third line, fourth line, fifth line, sixth line, sevent…',
static::assertEquals('First line, second line, third line, fourth line, fifth line, sixth line, seventh line, eighth line, ninth line, and so …',
$clarification->getSummary());
}
}
Loading