fix(frontend): correct pluralization in classmates count
Use ternary operator to display correct singular/plural form: - "1 compañero" (singular) when count === 1 - "X compañeros" (plural) otherwise Fixes DEF-003: Page incorrectly showed "1 compañeros" instead of "1 compañero" when there was exactly one classmate.
This commit is contained in:
parent
e0c130294f
commit
ac6119b265
|
|
@ -60,7 +60,7 @@ import { InitialsPipe } from '@shared/pipes/initials.pipe';
|
||||||
<h2 class="classmates-section-title">
|
<h2 class="classmates-section-title">
|
||||||
<mat-icon>book</mat-icon>
|
<mat-icon>book</mat-icon>
|
||||||
{{ item.subjectName }}
|
{{ item.subjectName }}
|
||||||
<span class="classmates-count">{{ item.classmates.length }} compañeros</span>
|
<span class="classmates-count">{{ item.classmates.length }} {{ item.classmates.length === 1 ? 'compañero' : 'compañeros' }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
@if (item.classmates.length === 0) {
|
@if (item.classmates.length === 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue