Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit 5bfaddb

Browse files
committed
refactor(challenge): Use native function for truncating
1 parent 1775bbd commit 5bfaddb

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

templates/components/Challenge/CommentModule/Comment.html.twig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="關閉"></button>
1717
</div>
1818
<div class="modal-body">
19-
確定要移除「{{
20-
plainContent|length > previewCommentCharLimit
21-
? plainContent|slice(0, previewCommentCharLimit) ~ '……'
22-
: plainContent
23-
}}」這則留言嗎?
19+
確定要移除「{{ plainContent|u.truncate(100, '……') }}」這則留言嗎?
2420
</div>
2521
<div class="modal-footer">
2622
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>

templates/components/Challenge/ResultPresenterModule/EventPresenter.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<tbody>
1010
{% for event in this.events %}
1111
<tr key="{{ event.id }}">
12-
<th scope="row" class="text-truncate"><code>{{ event.query }}</code></th>
12+
<th scope="row"><code>{{ event.query|u.truncate(50, '') }}</code></th>
1313
<td>
1414
{% if event.status == constant('\\App\\Entity\\SolutionEventStatus::Failed') %}
1515

0 commit comments

Comments
 (0)