refactor: unify bag and admin layout routing
This commit is contained in:
14
app/Views/components/header_brand.php
Normal file
14
app/Views/components/header_brand.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/** @var string $href Brand link target */
|
||||
$href = $href ?? base_url();
|
||||
/** @var string $linkClass Anchor + inner flex typography */
|
||||
$linkClass = $linkClass ?? 'flex items-center gap-2 shrink-0 text-base font-semibold text-gray-800 tracking-tight hover:text-blue-600';
|
||||
?>
|
||||
<a href="<?= esc($href) ?>" class="<?= esc($linkClass, 'attr') ?>" title="종량제 시스템">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-6 w-6 text-blue-900 translate-y-[1px] shrink-0" aria-hidden="true" focusable="false">
|
||||
<path fill="currentColor" d="M9 3a1 1 0 00-1 1v1H5.75a.75.75 0 000 1.5h12.5a.75.75 0 000-1.5H16V4a1 1 0 00-1-1H9zm9 4H6v11a2 2 0 002 2h8a2 2 0 002-2V7zM10 9a.75.75 0 01.75.75v6a.75.75 0 01-1.5 0v-6A.75.75 0 0110 9zm4 0a.75.75 0 01.75.75v6a.75.75 0 01-1.5 0v-6A.75.75 0 0114 9z"/>
|
||||
</svg>
|
||||
<span class="whitespace-nowrap">종량제 시스템</span>
|
||||
</a>
|
||||
46
app/Views/components/header_user_tools.php
Normal file
46
app/Views/components/header_user_tools.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* 상단 헤더 오른쪽: 사용자·역할 · 작업 지자체 · (사이트|관리자) · 로그아웃
|
||||
*
|
||||
* @var array{name:string,role_label:string}|null $userNav
|
||||
* @var string|null $effectiveLgName
|
||||
* @var bool $showSiteLink 관리자 → 일반 사이트
|
||||
* @var bool $showAdminLink 사이트 → 관리자 패널
|
||||
*/
|
||||
helper('admin');
|
||||
if (! isset($userNav)) {
|
||||
$userNav = session_user_nav_display();
|
||||
}
|
||||
$showSiteLink = ! empty($showSiteLink);
|
||||
$showAdminLink = ! empty($showAdminLink);
|
||||
?>
|
||||
<div class="flex items-center gap-2 sm:gap-3 shrink-0">
|
||||
<?php if ($userNav !== null): ?>
|
||||
<div class="hidden sm:flex flex-col items-end leading-tight max-w-[11rem] border-r border-gray-200 pr-3 mr-1"
|
||||
title="<?= esc($userNav['name'] . ' · ' . $userNav['role_label']) ?>">
|
||||
<span class="text-sm font-medium text-gray-800 truncate"><?= esc($userNav['name']) ?></span>
|
||||
<span class="text-xxs text-gray-500 truncate"><?= esc($userNav['role_label']) ?></span>
|
||||
</div>
|
||||
<div class="sm:hidden text-xs text-gray-600 max-w-[6rem] truncate" title="<?= esc($userNav['name'] . ' · ' . $userNav['role_label']) ?>">
|
||||
<?= esc($userNav['name']) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (! empty($effectiveLgName)): ?>
|
||||
<span class="text-sm text-gray-600 max-w-[10rem] truncate" title="현재 작업 지자체"><?= esc((string) $effectiveLgName) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($showSiteLink): ?>
|
||||
<a href="<?= base_url('/') ?>" class="text-sm text-gray-600 hover:text-blue-600 whitespace-nowrap px-0.5">사이트</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($showAdminLink): ?>
|
||||
<a href="<?= base_url('admin') ?>" class="text-sm text-gray-600 hover:text-blue-600 whitespace-nowrap px-0.5">관리자</a>
|
||||
<?php endif; ?>
|
||||
<a href="<?= base_url('logout') ?>"
|
||||
class="flex items-center gap-1 text-sm text-gray-500 hover:text-red-600 transition-colors px-1.5 py-1 rounded-md hover:bg-red-50 whitespace-nowrap"
|
||||
title="로그아웃">
|
||||
<svg class="h-5 w-5 shrink-0" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M6 18L18 6M6 6l12 12" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
<span>종료</span>
|
||||
</a>
|
||||
</div>
|
||||
35
app/Views/components/jongryangje_mark.php
Normal file
35
app/Views/components/jongryangje_mark.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* 종량제 시스템 — 미니멀 에코 마크 (링 + 잎)
|
||||
*
|
||||
* @var string $svgClass Tailwind classes for the SVG root
|
||||
*/
|
||||
$svgClass = $svgClass ?? 'h-6 w-6 shrink-0';
|
||||
$gid = 'jrMark_' . bin2hex(random_bytes(4));
|
||||
?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="<?= esc($svgClass, 'attr') ?>" aria-hidden="true" focusable="false">
|
||||
<defs>
|
||||
<linearGradient id="<?= esc($gid, 'attr') ?>_ring" x1="5" y1="5" x2="19" y2="19" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#10b981"/>
|
||||
<stop offset="1" stop-color="#047857"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="<?= esc($gid, 'attr') ?>_leaf" x1="12" y1="6" x2="12" y2="18.5" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#6ee7b7"/>
|
||||
<stop offset="1" stop-color="#059669"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<circle cx="12" cy="12" r="10.5" fill="#f7fefb"/>
|
||||
<!-- 외곽 링: 우상단을 비우고 화살표로 순환감을 최소 요소로 표현 -->
|
||||
<path fill="none"
|
||||
stroke="url(#<?= esc($gid, 'attr') ?>_ring)"
|
||||
stroke-width="1.8"
|
||||
stroke-linecap="round"
|
||||
d="M8.1 5.5a7.8 7.8 0 107.9 1.7"/>
|
||||
<path d="M18.5 4.95l1.7 1.45-2.22.62z" fill="#059669"/>
|
||||
<!-- 중앙 잎 -->
|
||||
<path fill="url(#<?= esc($gid, 'attr') ?>_leaf)"
|
||||
d="M12 5.7C9.55 7.35 8.75 10.25 10.95 14.95C11.35 15.8 11.7 16.45 12 16.95C12.3 16.45 12.65 15.8 13.05 14.95C15.25 10.25 14.45 7.35 12 5.7z"/>
|
||||
<path stroke="#ecfdf5" stroke-width="0.65" stroke-linecap="round" fill="none" d="M11.95 7.55C11.85 10.2 11.95 12.45 12.05 15.35"/>
|
||||
</svg>
|
||||
Reference in New Issue
Block a user