Commit d5c60c34 authored by Mahmoud Aglan's avatar Mahmoud Aglan

copy: the public live pages speak like an Egyptian game

Live, embed, standings, pairings, bracket, players, print and venue-screen
text is short Egyptian Arabic with the words players use (لايف، ماتش،
الشجرة، راحة، باط), matching the player app. Text only: no markup or
styling changed.

Also: the standings table checked an undefined $medals (left from the emoji
medals), raising a warning on every render; the rank column shows the
place, and the podium above keeps the medal icons.
Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
parent da912f8d
......@@ -38,7 +38,7 @@
const cls = ['lb-bracket-seat', s.name === null ? 'is-empty' : '', (m.winner_id && s.id && m.winner_id === s.id) ? 'is-winner' : ''].join(' ');
const seed = s.seed ? '<span class="lb-bracket-seed">' + esc(s.seed) + '</span> ' : '';
const score = showScore && s.name !== null && fmt(s.score) !== '' ? '<span class="lb-bracket-score">' + esc(fmt(s.score)) + '</span>' : '';
return '<div class="' + cls + '"><span>' + seed + esc(s.name || 'في الانتظار') + '</span>' + score + '</div>';
return '<div class="' + cls + '"><span>' + seed + esc(s.name || 'مستني') + '</span>' + score + '</div>';
}).join('');
const isLive = status === 'in_progress' || status === 'tiebreak';
return '<div class="lb-bracket-match' + (isLive ? ' is-live' : '') + '">' + seats + '</div>';
......@@ -57,7 +57,7 @@
const total = rounds[rounds.length - 1];
let html = rounds.map(r => '<div class="lb-bracket-round"><div class="lb-bracket-round-title">' + esc(roundName(r, total)) + '</div>' +
main[r].sort((a, b) => (a.match_number || 0) - (b.match_number || 0)).map(matchHtml).join('') + '</div>').join('');
if (extra.length) html += '<div class="lb-bracket-round"><div class="lb-bracket-round-title">المركز الثالث</div>' + extra.map(matchHtml).join('') + '</div>';
if (extra.length) html += '<div class="lb-bracket-round"><div class="lb-bracket-round-title">المركز التالت</div>' + extra.map(matchHtml).join('') + '</div>';
container.innerHTML = html;
}
......
......@@ -117,7 +117,7 @@
<div class="ann-body">
${ann.title ? `<strong class="ann-title">${escapeHtml(ann.title)}</strong>` : ''}
<p class="ann-content">${escapeHtml(ann.content)}</p>
<span class="ann-time">الآن</span>
<span class="ann-time">دلوقتي</span>
</div>
`;
bubble.style.animation = 'fadeInUp 0.4s ease';
......@@ -185,7 +185,7 @@
const pts = (Math.round(player.points * 2) / 2).toString().replace(/^0\.5$/, '½').replace('.5', '½');
bits.push(pts + ' نقطة');
}
if (player.games) bits.push(player.games + ' مباراة');
if (player.games) bits.push(player.games + ' ماتش');
meta.textContent = bits.join(' · ');
}
......@@ -287,7 +287,7 @@
document.getElementById('h2h-name-a').textContent = record.names[a] || '';
document.getElementById('h2h-name-b').textContent = record.names[b] || '';
document.getElementById('h2h-scores').textContent =
games.length ? fmt(scoreA) + ' - ' + fmt(scoreB) : 'لم يلتقيا';
games.length ? fmt(scoreA) + ' - ' + fmt(scoreB) : 'ملعبوش مع بعض';
document.getElementById('h2h-games').innerHTML = rows.join('');
panel.hidden = false;
}
......@@ -372,6 +372,6 @@ document.addEventListener('click', (e) => {
const expanded = wrap.classList.toggle('is-expanded');
btn.setAttribute('aria-expanded', expanded ? 'true' : 'false');
btn.textContent = expanded
? 'عرض أفضل 20 فقط'
: `عرض كل اللاعبين (${wrap.querySelectorAll('tbody tr').length})`;
? 'أول 20 بس'
: `شوف الكل (${wrap.querySelectorAll('tbody tr').length})`;
});
......@@ -110,8 +110,8 @@
} else {
grid = `<div class="scr-board-wrap"><div class="scr-board is-empty"><span>${b.state === 'waiting' ? 'لسه ما بدأتش' : (b.state === 'bye' ? 'راحة' : '')}</span></div></div>`;
}
const tag = b.state === 'live' ? '<span class="scr-tag is-live"><span class="pulse-dot"></span> جارية</span>'
: b.state === 'done' ? '<span class="scr-tag">انتهت</span>'
const tag = b.state === 'live' ? '<span class="scr-tag is-live"><span class="pulse-dot"></span> لايف</span>'
: b.state === 'done' ? '<span class="scr-tag">خلصت</span>'
: b.state === 'waiting' ? '<span class="scr-tag">مستنية</span>' : '';
const kind = b.game_kind && b.game_kind !== 'regular' ? `<span class="scr-tag is-kind">${b.game_kind === 'armageddon' ? 'أرماجدون' : 'فاصلة'}</span>` : '';
return `<article class="scr-card${b.state === 'live' ? ' is-live' : ''}">
......@@ -135,7 +135,7 @@
const list = d ? d.boards : [];
const pages = Math.max(1, Math.ceil(list.length / BOARDS_PAGE));
const p = Math.min(page, pages - 1);
els.boardsTitle.textContent = pages > 1 ? `مباريات الجولة (${p + 1} من ${pages})` : 'مباريات الجولة';
els.boardsTitle.textContent = pages > 1 ? `ماتشات الجولة (${p + 1} من ${pages})` : 'ماتشات الجولة';
els.boards.innerHTML = list.slice(p * BOARDS_PAGE, (p + 1) * BOARDS_PAGE).map(b => {
const res = RESULT[b.result];
const mid = b.state === 'bye' ? 'راحة' : res ? `${res[0]} - ${res[1]}` : (b.state === 'live' ? '<span class="pulse-dot"></span>' : '');
......@@ -183,7 +183,7 @@
if (d.round.status === 'pending' && d.round.scheduled_start_at) {
text += ' · تبدأ ' + new Intl.DateTimeFormat('ar-EG-u-nu-latn', { timeZone: 'Africa/Cairo', hour: 'numeric', minute: '2-digit' }).format(new Date(d.round.scheduled_start_at));
} else if (games) {
text += ` · ${done} من ${games} خلصت` + (live ? ` · ${live} جارية` : '');
text += ` · ${done} من ${games} خلصت` + (live ? ` · ${live} لايف` : '');
}
} else if (status === 'registration') text = 'التسجيل مفتوح';
els.round.textContent = text || ' ';
......
......@@ -54,7 +54,7 @@ class LiveTournamentsController
$metaTags = [
'title' => $tournament['name'] . ' — El3ab Live',
'description' => $description !== '' ? mb_substr($description, 0, 200) : 'بطولة مباشرة على منصة El3ab',
'description' => $description !== '' ? mb_substr($description, 0, 200) : 'بطولة لايف على El3ab',
'image' => $image,
'url' => $liveUrl,
];
......@@ -127,7 +127,7 @@ class LiveTournamentsController
$content = $this->renderView('_bracket', compact('tournament', 'bracket', 'liveTheme'));
$this->renderPublicLayout($content, [
'pageTitle' => $tournament['name'] . ' - القرعة',
'pageTitle' => $tournament['name'] . ' - الشجرة',
'liveTheme' => $liveTheme,
'liveCustomCss' => $tournament['live_custom_css'] ?? '',
'loadBracket' => true,
......@@ -144,7 +144,7 @@ class LiveTournamentsController
$content = $this->renderView('_players', compact('tournament', 'players', 'liveTheme'));
$this->renderPublicLayout($content, [
'pageTitle' => $tournament['name'] . ' - اللاعبون',
'pageTitle' => $tournament['name'] . ' - اللاعيبة',
'liveTheme' => $liveTheme,
'liveCustomCss' => $tournament['live_custom_css'] ?? '',
]);
......
<?php if (empty($announcements)): ?>
<div class="empty-state">لا توجد إعلانات</div>
<div class="empty-state">مفيش إعلانات</div>
<?php else: ?>
<div class="announcements-feed" id="announcements-feed">
<?php foreach ($announcements as $ann):
......
......@@ -5,7 +5,7 @@ $arenaGames = $arenaData['games'] ?? [];
?>
<?php if (empty($arenaStandings)): ?>
<div class="empty-state">لا توجد بيانات أرينا</div>
<div class="empty-state">لسه مفيش ماتشات أرينا</div>
<?php else: ?>
<div class="arena-board">
<div class="arena-standings">
......@@ -14,8 +14,8 @@ $arenaGames = $arenaData['games'] ?? [];
<tr>
<th>#</th>
<th>اللاعب</th>
<th>النقاط</th>
<th>المباريات</th>
<th>النقط</th>
<th>الماتشات</th>
<th>الأداء</th>
</tr>
</thead>
......@@ -42,7 +42,7 @@ $arenaGames = $arenaData['games'] ?? [];
</div>
<?php if (!empty($arenaGames)): ?>
<div class="arena-recent">
<h4>آخر المباريات</h4>
<h4>آخر الماتشات</h4>
<div class="arena-games-feed">
<?php foreach (array_slice($arenaGames, 0, 10) as $game): ?>
<div class="arena-game-item">
......
......@@ -61,7 +61,7 @@ $drawMatch = function (array $m) use ($seat, $fmt) {
<div class="lb-bracket-match<?= ($m['status'] ?? '') === 'in_progress' || ($m['status'] ?? '') === 'tiebreak' ? ' is-live' : '' ?>">
<?php foreach ([$a, $b] as $s): ?>
<div class="lb-bracket-seat <?= $s['name'] === null ? 'is-empty' : '' ?> <?= ($winner && $s['id'] && $winner === $s['id']) ? 'is-winner' : '' ?>">
<span><?php if ($s['seed']): ?><span class="lb-bracket-seed"><?= (int)$s['seed'] ?></span> <?php endif; ?><?= htmlspecialchars($s['name'] ?? 'في الانتظار') ?></span>
<span><?php if ($s['seed']): ?><span class="lb-bracket-seed"><?= (int)$s['seed'] ?></span> <?php endif; ?><?= htmlspecialchars($s['name'] ?? 'مستني') ?></span>
<?php if ($showScore && $s['name'] !== null && $fmt($s['score']) !== ''): ?><span class="lb-bracket-score"><?= htmlspecialchars($fmt($s['score'])) ?></span><?php endif; ?>
</div>
<?php endforeach; ?>
......@@ -71,7 +71,7 @@ $drawMatch = function (array $m) use ($seat, $fmt) {
?>
<?php if (empty($byRound)): ?>
<div class="empty-state">لم تُسحب القرعة بعد</div>
<div class="empty-state">لسه مفيش قرعة</div>
<?php else: ?>
<div class="lb-bracket" id="bracket-svg-container" data-tournament-id="<?= htmlspecialchars($tournament['id'] ?? '') ?>"
data-matches="<?= htmlspecialchars(json_encode($bracket, JSON_UNESCAPED_UNICODE)) ?>">
......@@ -83,7 +83,7 @@ $drawMatch = function (array $m) use ($seat, $fmt) {
<?php endforeach; ?>
<?php if ($extra): ?>
<div class="lb-bracket-round">
<div class="lb-bracket-round-title">المركز الثالث</div>
<div class="lb-bracket-round-title">المركز التالت</div>
<?php foreach ($extra as $m) echo $drawMatch($m); ?>
</div>
<?php endif; ?>
......
......@@ -6,7 +6,7 @@ if ($startTimestamp <= time()) return;
?>
<div class="countdown-section" data-target="<?= date('c', $startTimestamp) ?>">
<h3 class="countdown-label">تبدأ البطولة خلال</h3>
<h3 class="countdown-label">البطولة تبدأ بعد</h3>
<div class="countdown-clock">
<div class="countdown-unit">
<span class="countdown-value" id="countdown-days">00</span>
......
......@@ -16,7 +16,7 @@ $left = $max > 0 ? max(0, $max - $taken) : null;
<h2 class="lb-cta-title" id="lb-cta-title">التسجيل مفتوح</h2>
<p class="lb-cta-sub">
<?= $fee > 0 ? 'الاشتراك ' . number_format($fee) . ' عملة' : 'الاشتراك مجاني' ?>
<?php if ($left !== null): ?> · <?= $left > 0 ? 'باقي ' . number_format($left) . ' مكان' : 'الأماكن كملت، فيه قائمة انتظار' ?><?php endif; ?>
<?php if ($left !== null): ?> · <?= $left > 0 ? 'فاضل ' . number_format($left) . ' مكان' : 'الأماكن كملت، فيه قائمة انتظار' ?><?php endif; ?>
<?php if (($cta['access'] ?? 'public') === 'code_only'): ?> · بالكود بس<?php endif; ?>
</p>
</div>
......
<?php if (empty($gallery)): ?>
<div class="empty-state">لا توجد صور</div>
<div class="empty-state">مفيش صور</div>
<?php else: ?>
<div class="gallery-grid">
<?php foreach ($gallery as $item): ?>
......
<?php
$groups = $data['groups'] ?? [];
if (empty($groups)): ?>
<div class="empty-state">لا توجد مجموعات</div>
<div class="empty-state">مفيش مجموعات</div>
<?php else: ?>
<div class="groups-grid">
<?php foreach ($groups as $groupName => $groupPlayers): ?>
......@@ -12,7 +12,7 @@ if (empty($groups)): ?>
<tr>
<th>#</th>
<th>اللاعب</th>
<th>نقاط</th>
<th>نقط</th>
<th>م</th>
</tr>
</thead>
......
......@@ -52,7 +52,7 @@ asort($names, SORT_NATURAL | SORT_FLAG_CASE);
<h4 class="widget-title">مقارنة لاعبين</h4>
<?php if (count($names) < 2): ?>
<p class="h2h-empty">تظهر المقارنة بعد أول جولة.</p>
<p class="h2h-empty">المقارنة تظهر بعد أول جولة</p>
<?php else: ?>
<script type="application/json" id="h2h-data"><?= json_encode(
['names' => $names, 'games' => $games],
......@@ -61,14 +61,14 @@ asort($names, SORT_NATURAL | SORT_FLAG_CASE);
<div class="h2h-selectors">
<select id="h2h-player-a" class="h2h-select" aria-label="اللاعب الأول">
<option value="">اختر لاعب...</option>
<option value="">اختار لاعب</option>
<?php foreach ($names as $id => $n): ?>
<option value="<?= htmlspecialchars((string)$id) ?>"><?= htmlspecialchars($n) ?></option>
<?php endforeach; ?>
</select>
<span class="h2h-vs">VS</span>
<select id="h2h-player-b" class="h2h-select" aria-label="اللاعب الثاني">
<option value="">اختر لاعب...</option>
<select id="h2h-player-b" class="h2h-select" aria-label="اللاعب التاني">
<option value="">اختار لاعب</option>
<?php foreach ($names as $id => $n): ?>
<option value="<?= htmlspecialchars((string)$id) ?>"><?= htmlspecialchars($n) ?></option>
<?php endforeach; ?>
......
......@@ -4,9 +4,9 @@ $orgLogo = $org['logo_url'] ?? '';
$statusLabels = [
'draft' => 'مسودة',
'registration' => 'التسجيل مفتوح',
'in_progress' => 'جارية الآن',
'completed' => 'انتهت',
'cancelled' => 'ملغية',
'in_progress' => 'لايف',
'completed' => 'خلصت',
'cancelled' => 'اتلغت',
];
$statusClasses = [
'registration' => 'status-registration',
......@@ -22,14 +22,14 @@ $playerCount = (int)($stats['players'] ?? 0);
$prize = (int)($tournament['prize_pool_coins'] ?? $tournament['prize_pool'] ?? 0);
$modeLabels = [
'swiss' => 'نظام سويسري',
'swiss' => 'سويسري',
'elimination' => 'خروج المغلوب',
'single_elimination' => 'خروج المغلوب',
'double_elimination' => 'خروج المغلوب المزدوج',
'round_robin' => 'دوري كامل',
'double_elimination' => 'خروج مزدوج',
'round_robin' => 'دوري',
'arena' => 'أرينا',
'group_stage' => 'مجموعات',
'multi_phase' => 'متعدد المراحل',
'multi_phase' => 'على مراحل',
];
/**
......@@ -124,19 +124,19 @@ $speedLabel = match (true) {
<?php if ($roundsTotal): ?>
<div class="lb-stat">
<div class="lb-stat-value"><?= max(0, (int)($stats['rounds_played'] ?? 0)) ?>/<?= $roundsTotal ?></div>
<div class="lb-stat-label">جولات مكتملة</div>
<div class="lb-stat-label">جولات خلصت</div>
</div>
<?php endif; ?>
<?php if (!empty($stats['games_total'])): ?>
<div class="lb-stat">
<div class="lb-stat-value"><?= (int)$stats['games_completed'] ?></div>
<div class="lb-stat-label">مباراة انتهت</div>
<div class="lb-stat-label">ماتش خلص</div>
</div>
<?php endif; ?>
<?php if (!empty($stats['games_live'])): ?>
<div class="lb-stat is-live">
<div class="lb-stat-value"><?= (int)$stats['games_live'] ?></div>
<div class="lb-stat-label">جارية الآن</div>
<div class="lb-stat-label">لايف</div>
</div>
<?php endif; ?>
<?php if ($prize > 0): ?>
......
......@@ -2,12 +2,12 @@
$description = $tournament['description'] ?? '';
$rules = $tournament['rules'] ?? '';
$modeDescriptions = [
'swiss' => 'نظام سويسري: يتم اقتران اللاعبين ذوي النقاط المتقاربة في كل جولة. لا يُقصى أي لاعب.',
'elimination' => 'خروج المغلوب: الخاسر يخرج من البطولة. الفائز يتقدم للجولة التالية.',
'round_robin' => 'دوري كامل: كل لاعب يلعب ضد جميع اللاعبين الآخرين.',
'arena' => 'أرينا: مباريات سريعة متتالية. كلما لعبت أكثر، زادت فرصتك.',
'group_stage' => 'مجموعات: يتم تقسيم اللاعبين إلى مجموعات، والأوائل يتأهلون.',
'multi_phase' => 'متعدد المراحل: مراحل متتالية بأنظمة مختلفة.',
'swiss' => 'سويسري: كل جولة بتقابل حد نقطه قريبة من نقطك، ومحدش بيخرج.',
'elimination' => 'خروج المغلوب: اللي يخسر يخرج، واللي يكسب يكمل.',
'round_robin' => 'دوري: كل لاعب بيلعب مع الكل.',
'arena' => 'أرينا: ماتشات سريعة ورا بعض، وكل ما تلعب أكتر فرصتك تزيد.',
'group_stage' => 'مجموعات: اللاعيبة بيتقسموا مجموعات، والأوائل بيطلعوا.',
'multi_phase' => 'على مراحل: كل مرحلة بنظام مختلف.',
];
$mode = $tournament['tournament_mode'] ?? 'swiss';
?>
......@@ -20,7 +20,7 @@ $mode = $tournament['tournament_mode'] ?? 'swiss';
<?php if ($description): ?>
<div class="info-description">
<h4>الوصف</h4>
<h4>التفاصيل</h4>
<div class="info-text"><?= nl2br(htmlspecialchars($description)) ?></div>
</div>
<?php endif; ?>
......
......@@ -29,14 +29,14 @@ $nameOf = function ($pairing, string $side) {
};
$reasonLabels = [
'checkmate' => 'كش مات', 'resign' => 'انسحاب', 'timeout' => 'انتهى الوقت',
'abandon' => 'انسحاب', 'stalemate' => 'تعادل بالجمود', 'agreement' => 'تعادل بالاتفاق',
'forfeit' => 'عدم حضور',
'checkmate' => 'كش مات', 'resign' => 'استسلام', 'timeout' => 'الوقت خلص',
'abandon' => 'انسحاب', 'stalemate' => 'باط', 'agreement' => 'تعادل بالاتفاق',
'forfeit' => 'غياب',
];
?>
<?php if (empty($pairingsList)): ?>
<div class="empty-state">لا توجد مباريات في هذه الجولة بعد</div>
<div class="empty-state">لسه مفيش ماتشات في الجولة دي</div>
<?php else: ?>
<div class="lb-boards">
......@@ -79,13 +79,13 @@ $reasonLabels = [
<div class="lb-board-tag">
<?php if ($isLive): ?>
<span class="pulse-dot"></span> جارية الآن
<span class="pulse-dot"></span> لايف
<?php elseif ($isBye): ?>
مقعد فارغ
راحة
<?php elseif ($reason && isset($reasonLabels[$reason])): ?>
<?= htmlspecialchars($reasonLabels[$reason]) ?>
<?php else: ?>
انتهت
خلص
<?php endif; ?>
</div>
</div>
......
......@@ -12,7 +12,7 @@
<div class="modal-player-stats" id="modal-player-stats">
<div class="modal-stat">
<span class="modal-stat-value" id="modal-wins">0</span>
<span class="modal-stat-label">انتصارات</span>
<span class="modal-stat-label">كسب</span>
</div>
<div class="modal-stat">
<span class="modal-stat-value" id="modal-draws">0</span>
......@@ -20,7 +20,7 @@
</div>
<div class="modal-stat">
<span class="modal-stat-value" id="modal-losses">0</span>
<span class="modal-stat-label">هزائم</span>
<span class="modal-stat-label">خسارة</span>
</div>
</div>
<div class="modal-player-games" id="modal-player-games"></div>
......
......@@ -30,7 +30,7 @@ usort($list, function ($a, $b) use ($read) {
?>
<?php if (empty($list)): ?>
<div class="empty-state">لا يوجد لاعبون مسجلون بعد</div>
<div class="empty-state">لسه محدش اتسجل</div>
<?php else: ?>
<div class="lb-field">
<?php foreach ($list as $i => $p):
......
<?php
$slug = $tournament['slug'] ?? $tournament['id'];
$shareUrl = ($_SERVER['REQUEST_SCHEME'] ?? 'https') . '://' . ($_SERVER['HTTP_HOST'] ?? '') . '/live/' . $slug;
$shareText = $tournament['name'] . ' - بطولة مباشرة على El3ab';
$shareText = $tournament['name'] . ' - لايف على El3ab';
$qrSvg = QRCodeService::generateSvg($shareUrl, 150);
?>
<div class="sharing-widget lb-share">
<div class="lb-share-head">
<h4 class="widget-title">تابع البطولة مباشرة</h4>
<p class="lb-share-hint">امسح الرمز أو انسخ الرابط — يفتح هذه الصفحة كما هي، بلا تسجيل دخول.</p>
<h4 class="widget-title">تابع البطولة لايف</h4>
<p class="lb-share-hint">امسح الكود أو انسخ اللينك، من غير تسجيل دخول</p>
</div>
<?php /* The QR is the point of the card at a venue, so it leads rather than
......@@ -17,7 +17,7 @@ $qrSvg = QRCodeService::generateSvg($shareUrl, 150);
<div class="share-url-box lb-share-row">
<input type="text" readonly value="<?= htmlspecialchars($shareUrl) ?>" class="share-url-input lb-share-url" id="share-url">
<button class="share-copy-btn lb-share-btn" data-copy="<?= htmlspecialchars($shareUrl) ?>" title="نسخ الرابط">
<button class="share-copy-btn lb-share-btn" data-copy="<?= htmlspecialchars($shareUrl) ?>" title="انسخ اللينك">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>
</button>
</div>
......@@ -36,7 +36,7 @@ $qrSvg = QRCodeService::generateSvg($shareUrl, 150);
<div class="share-embed lb-share-embed">
<details>
<summary>كود التضمين</summary>
<summary>حطها في موقعك</summary>
<textarea readonly class="embed-code" rows="3"><iframe src="<?= htmlspecialchars($shareUrl) ?>/embed" width="100%" height="600" frameborder="0"></iframe></textarea>
</details>
</div>
......
......@@ -8,7 +8,7 @@
*/
if (empty($sponsors)) return;
$tierLabels = [
'title' => 'الراعي الرسمي', 'presenting' => 'الراعي المقدّم', 'gold' => 'راعي ذهبي', 'silver' => 'راعي فضي',
'title' => 'الراعي الرسمي', 'presenting' => 'راعي رئيسي', 'gold' => 'راعي ذهبي', 'silver' => 'راعي فضي',
'bronze' => 'راعي برونزي', 'partner' => 'شريك', 'media' => 'الشريك الإعلامي', 'venue' => 'شريك المكان',
];
$size = fn(string $tier) => match ($tier) { 'title', 'presenting' => 'is-lead', 'gold', 'silver' => 'is-mid', default => 'is-small' };
......
......@@ -59,7 +59,7 @@ foreach ($rows as $r) {
?>
<?php if (empty($rows)): ?>
<div class="empty-state">لا يوجد ترتيب بعد — سيظهر فور انتهاء أول مباراة</div>
<div class="empty-state">الترتيب يظهر بعد أول ماتش</div>
<?php else: ?>
<?php /* The top three, sized to be read from across a hall. */ ?>
......@@ -87,7 +87,7 @@ foreach ($rows as $r) {
<tr>
<th class="col-rank">#</th>
<th class="col-player">اللاعب</th>
<th class="col-pts">النقاط</th>
<th class="col-pts">النقط</th>
<th class="col-games">م</th>
<th class="col-wins">ف</th>
<th class="col-draws">ت</th>
......@@ -112,11 +112,7 @@ foreach ($rows as $r) {
aria-label="<?= htmlspecialchars($p['name']) ?> — تفاصيل اللاعب"
data-player-id="<?= htmlspecialchars($p['id']) ?>"
data-player="<?= htmlspecialchars($card) ?>">
<td class="col-rank">
<?php if (isset($medals[$p['rank']])): ?>
<span class="medal" aria-label="المركز <?= $p['rank'] ?>"><?= $medals[$p['rank']] ?></span>
<?php else: ?><?= $p['rank'] ?><?php endif; ?>
</td>
<td class="col-rank"><?= $p['rank'] ?></td>
<td class="col-player">
<div class="lb-player-cell">
<?php if ($p['avatar']): ?>
......@@ -157,7 +153,7 @@ foreach ($rows as $r) {
<?php if (count($rows) > $TOP_VISIBLE): ?>
<button type="button" class="lb-showall" data-showall
aria-expanded="false" aria-controls="standings-wrap">
عرض كل اللاعبين (<?= count($rows) ?>)
شوف الكل (<?= count($rows) ?>)
</button>
<?php endif; ?>
</div>
......
......@@ -29,17 +29,17 @@ $drawPct = 100 - $decPct;
// round and live-game count; repeating them here reads as a page that does not
// know what it has already said. This section covers what the hero cannot fit.
$metrics = [
['value' => $games, 'label' => 'إجمالي المباريات'],
['value' => $done, 'label' => 'انتهت'],
['value' => $decisive, 'label' => 'حُسمت بفوز'],
['value' => $games, 'label' => 'الماتشات'],
['value' => $done, 'label' => 'خلصت'],
['value' => $decisive, 'label' => 'اتحسمت'],
['value' => $draws, 'label' => 'تعادل'],
];
if ($byes > 0) $metrics[] = ['value' => $byes, 'label' => 'مقاعد فارغة'];
if ($live > 0) $metrics[] = ['value' => $live, 'label' => 'جارية الآن', 'live' => true];
if ($byes > 0) $metrics[] = ['value' => $byes, 'label' => 'راحة'];
if ($live > 0) $metrics[] = ['value' => $live, 'label' => 'لايف', 'live' => true];
// Nothing has been played: the split bar and a row of zeroes say nothing.
if ($games === 0) {
echo '<div class="empty-state">لم تُلعب أي مباراة بعد</div>';
echo '<div class="empty-state">لسه مفيش ماتشات</div>';
return;
}
?>
......@@ -56,11 +56,11 @@ if ($games === 0) {
<?php if ($decisive + $draws > 0): ?>
<div class="lb-split">
<div class="lb-split-head">
<span class="lb-split-key"><span class="lb-split-swatch is-decisive"></span> حُسمت <strong><?= $decisive ?></strong></span>
<span class="lb-split-key"><span class="lb-split-swatch is-decisive"></span> اتحسمت <strong><?= $decisive ?></strong></span>
<span class="lb-split-key"><span class="lb-split-swatch is-draw"></span> تعادل <strong><?= $draws ?></strong></span>
</div>
<div class="lb-split-bar" role="img"
aria-label="<?= $decPct ?>٪ من المباريات حُسمت و<?= $drawPct ?>٪ انتهت بالتعادل">
aria-label="<?= $decPct ?>٪ اتحسمت و<?= $drawPct ?>٪ تعادل">
<span class="lb-split-seg is-decisive" style="inline-size: <?= $decPct ?>%"></span>
<span class="lb-split-seg is-draw" style="inline-size: <?= $drawPct ?>%"></span>
</div>
......
......@@ -41,7 +41,7 @@ $roundState = function (array $round): string {
return $withResult === count($pairings) ? 'completed' : 'in_progress';
};
$stateLabel = ['completed' => 'مكتملة', 'in_progress' => 'جارية', 'paired' => 'القرعة جاهزة', 'upcoming' => 'قادمة'];
$stateLabel = ['completed' => 'خلصت', 'in_progress' => 'شغالة', 'paired' => 'اتوزّعت', 'upcoming' => 'لسه'];
$completed = 0;
foreach ($rounds as $r) if ($roundState($r) === 'completed') $completed++;
......@@ -50,12 +50,12 @@ $pct = $total > 0 ? (int)round($completed / $total * 100) : 0;
?>
<?php if (empty($rounds)): ?>
<div class="empty-state">لم تبدأ أي جولة بعد</div>
<div class="empty-state">الجولات لسه مبدأتش</div>
<?php else: ?>
<div class="lb-progress lb-timeline-progress">
<div class="lb-progress-head">
<span class="lb-progress-round"><?= $completed ?> من <?= $total ?> جولات مكتملة</span>
<span class="lb-progress-round"><?= $completed ?> من <?= $total ?> جولات خلصت</span>
<span class="lb-progress-pct"><?= $pct ?>%</span>
</div>
<div class="lb-progress-track">
......@@ -80,7 +80,7 @@ $pct = $total > 0 ? (int)round($completed / $total * 100) : 0;
<?php if (!empty($pairings)): ?>
<details class="lb-round-details"<?= $state === 'in_progress' ? ' open' : '' ?>>
<summary><?= count($pairings) ?> مباراة</summary>
<summary><?= count($pairings) ?> ماتش</summary>
<div class="lb-round-games">
<?php foreach ($pairings as $p): ?>
<div class="lb-round-game<?= empty($p['result']) && empty($p['is_bye']) ? ' is-live' : '' ?>">
......
......@@ -7,7 +7,7 @@ $mode = $data['mode'] ?? 'swiss';
<div class="live-embed" data-tournament-id="<?= htmlspecialchars($tournament['id']) ?>" data-status="<?= $status ?>">
<div class="embed-header">
<h2 class="embed-title"><?= htmlspecialchars($tournament['name']) ?></h2>
<span class="embed-badge status-<?= $status ?>"><?= $status === 'in_progress' ? 'مباشر' : ($status === 'completed' ? 'انتهت' : 'قريباً') ?></span>
<span class="embed-badge status-<?= $status ?>"><?= $status === 'in_progress' ? 'لايف' : ($status === 'completed' ? 'خلصت' : 'قريب') ?></span>
</div>
<?php if (!empty($visibility['standings']) && !empty($data['standings'])): ?>
......@@ -24,7 +24,7 @@ $mode = $data['mode'] ?? 'swiss';
<div class="embed-footer">
<a href="/live/<?= htmlspecialchars($tournament['slug'] ?? $tournament['id']) ?>" target="_blank" class="embed-link">
عرض البطولة كاملة على El3ab
شوف البطولة كلها على El3ab
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><path d="M15 3h6v6"/><path d="M10 14 21 3"/></svg>
</a>
</div>
......
......@@ -49,7 +49,7 @@ $signup = $data['signup'] ?? ['open' => false];
<?php if (!empty($visibility['pairings']) && $status === 'in_progress'): ?>
<section class="live-section" id="pairings-section">
<h2 class="section-title"><span class="pulse-dot"></span> المباريات الجارية</h2>
<h2 class="section-title"><span class="pulse-dot"></span> ماتشات لايف</h2>
<?php $pairings = $data['pairings'] ?? []; require __DIR__ . '/_pairings.php'; ?>
</section>
<?php endif; ?>
......@@ -102,7 +102,7 @@ $signup = $data['signup'] ?? ['open' => false];
<?php if (!empty($visibility['players']) && !empty($data['players'])): ?>
<section class="live-section" id="players-section">
<h2 class="section-title">اللاعبون</h2>
<h2 class="section-title">اللاعيبة</h2>
<?php $players = $data['players'] ?? []; require __DIR__ . '/_players.php'; ?>
</section>
<?php endif; ?>
......@@ -123,14 +123,14 @@ $signup = $data['signup'] ?? ['open' => false];
<?php if (!empty($visibility['gallery']) && !empty($data['gallery'])): ?>
<section class="live-section" id="gallery-section">
<h2 class="section-title">معرض الصور</h2>
<h2 class="section-title">الصور</h2>
<?php $gallery = $data['gallery']; require __DIR__ . '/_gallery.php'; ?>
</section>
<?php endif; ?>
<?php if (!empty($visibility['rules']) && !empty($tournament['description'])): ?>
<section class="live-section" id="info-section">
<h2 class="section-title">القوانين والمعلومات</h2>
<h2 class="section-title">عن البطولة</h2>
<?php require __DIR__ . '/_info.php'; ?>
</section>
<?php endif; ?>
......
......@@ -13,7 +13,7 @@
$name = ($tournament['name_ar'] ?? '') ?: $tournament['name'];
$tid = $tournament['id'];
$tierLabels = [
'title' => 'الراعي الرسمي', 'presenting' => 'الراعي المقدّم', 'gold' => 'راعي ذهبي', 'silver' => 'راعي فضي',
'title' => 'الراعي الرسمي', 'presenting' => 'راعي رئيسي', 'gold' => 'راعي ذهبي', 'silver' => 'راعي فضي',
'bronze' => 'راعي برونزي', 'partner' => 'شريك', 'media' => 'الشريك الإعلامي', 'venue' => 'شريك المكان',
];
?>
......@@ -52,16 +52,16 @@ $tierLabels = [
</header>
<main class="scr-stage" aria-live="polite">
<section class="scr-panel" data-panel="featured" aria-label="المباريات المميزة">
<h2 class="scr-panel-title">المباريات المميزة</h2>
<section class="scr-panel" data-panel="featured" aria-label="أهم الماتشات">
<h2 class="scr-panel-title">أهم الماتشات</h2>
<div class="scr-featured" id="scr-featured"></div>
</section>
<section class="scr-panel" data-panel="standings" aria-label="الترتيب">
<h2 class="scr-panel-title">الترتيب</h2>
<div class="scr-table" id="scr-standings"></div>
</section>
<section class="scr-panel" data-panel="boards" aria-label="مباريات الجولة">
<h2 class="scr-panel-title" id="scr-boards-title">مباريات الجولة</h2>
<section class="scr-panel" data-panel="boards" aria-label="ماتشات الجولة">
<h2 class="scr-panel-title" id="scr-boards-title">ماتشات الجولة</h2>
<div class="scr-boards" id="scr-boards"></div>
</section>
<section class="scr-panel" data-panel="idle" aria-label="البطولة">
......@@ -74,7 +74,7 @@ $tierLabels = [
<aside class="scr-qr">
<div class="scr-qr-code"><?= $qr ?></div>
<p><?= $signup ? 'امسح وسجّل' : 'تابع مباشر' ?></p>
<p><?= $signup ? 'امسح وسجّل' : 'تابع لايف' ?></p>
</aside>
<?php if (!empty($sponsors)): ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment