Files
jongryangje/app/Views/home/_dashboard_gov_portal_sidebar.php
taekyoungc 1a443de02e feat: 매뉴얼 검색·소메뉴 아이콘 개선·워크스페이스 탭 세션 유지
- 매뉴얼: 전체 검색 박스(slug별 hit 카운트·스니펫)와 본문 하이라이트 추가
  - ManualRenderer::plainText()/search(), Bag::manualSearch(), bag/manual/search 라우트
- 사이드바 소메뉴 선택 아이콘 변경: 닫기처럼 보이던 × → ▸, + → · (정적/동적 일관)
- 워크스페이스: 탭 목록을 sessionStorage에 저장·복원
  - 관리자 페이지 이동 후 복귀·새로고침해도 열어둔 탭 유지(세션 범위)
  - 복원으로 무의미해진 beforeunload 새로고침 경고 제거
- e2e: 관리자 이동 후 탭 복원 케이스 추가

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 19:52:53 +09:00

60 lines
2.4 KiB
PHP

<?php
declare(strict_types=1);
/** @var list<array> $govNavItems */
/** @var int $govActiveParentIdx */
/** @var string $govActiveChildHref */
$activeParent = $govNavItems[$govActiveParentIdx] ?? $govNavItems[0] ?? null;
$sidebarTitle = $activeParent['name'] ?? 'MY MENU';
$activeChildHref = strtolower(ltrim((string) ($govActiveChildHref ?? ''), '/'));
?>
<aside class="sidebar">
<div class="my-menu-hd" id="portalSidebarTitle"><?= esc($sidebarTitle) ?></div>
<ul class="my-menu-list" id="portalSidebarList">
<?php if ($activeParent !== null): ?>
<?php if (! empty($activeParent['hasChildren'])): ?>
<?php foreach ($activeParent['children'] as $ci => $child): ?>
<?php
$childHref = strtolower(ltrim((string) ($child['href'] ?? ''), '/'));
$isChildActive = $activeChildHref !== ''
? ($childHref === $activeChildHref)
: ($ci === 0);
?>
<li>
<?php if ($child['href'] !== ''): ?>
<a href="<?= esc($child['url']) ?>" class="<?= $isChildActive ? 'active' : '' ?>">
<span class="menu-ico"><?= $isChildActive ? '▸' : '·' ?></span>
<?= esc($child['name']) ?>
</a>
<?php else: ?>
<span class="menu-sub" style="opacity:.65;cursor:default;">
<span class="menu-ico">·</span><?= esc($child['name']) ?>
</span>
<?php endif; ?>
</li>
<?php endforeach; ?>
<?php elseif ($activeParent['href'] !== ''): ?>
<li>
<a href="<?= esc($activeParent['url']) ?>" class="active">
<span class="menu-ico">▸</span><?= esc($activeParent['name']) ?>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
</ul>
<div class="sidebar-blocks">
<div class="sb-teal">
<i class="fa-solid fa-mobile-screen"></i>
모바일 앱(예정)<br/>지정판매소 판매·스캔 연동
</div>
<div class="sb-gray">
<i class="fa-solid fa-repeat"></i> 통합 전환<br/>
<a href="<?= base_url('admin/select-local-government') ?>" style="color:#fff;text-decoration:underline;">지자체 선택</a>
</div>
<div class="sb-links">
<a href="<?= base_url('bag/help') ?>">나의 할일</a>
<a href="<?= base_url('bag/manual') ?>">사용자 매뉴얼</a>
<a href="<?= base_url('bag/help') ?>">FAQ</a>
</div>
</div>
</aside>