feat: 번역 필터링 및 UI 개선

- 번역 저장 시 .이 포함된 이름 필터링 (tooltip 등 제외)
- 모드 번역 제목 옆 개수 표시 제거
- 모드팩 페이지 PC 다운로드 버튼 위치 변경 (버전 라인 오른쪽)
This commit is contained in:
caadiq 2025-12-26 17:50:10 +09:00
parent 03bf32a7d2
commit 9ff2dd957c
3 changed files with 15 additions and 8 deletions

View file

@ -812,6 +812,9 @@ router.post("/modtranslations", requireAdmin, async (req, res) => {
if (keyModId !== modId) continue; // 다른 모드 키는 무시 if (keyModId !== modId) continue; // 다른 모드 키는 무시
// 이름에 .이 포함된 경우 스킵 (예: copper_backtank.tooltip.behaviour)
if (name.includes(".")) continue;
if (type === "block") { if (type === "block") {
await pool.query( await pool.query(
`INSERT INTO blocks (name, name_ko, mod_id) VALUES (?, ?, ?) `INSERT INTO blocks (name, name_ko, mod_id) VALUES (?, ?, ?)

View file

@ -1847,11 +1847,6 @@ export default function Admin({ isMobile = false }) {
<div className="bg-zinc-900 border border-zinc-800 rounded-2xl p-4"> <div className="bg-zinc-900 border border-zinc-800 rounded-2xl p-4">
<h3 className="text-white font-medium mb-4 flex items-center gap-2"> <h3 className="text-white font-medium mb-4 flex items-center gap-2">
🌐 모드 번역 🌐 모드 번역
{modTranslations.length > 0 && (
<span className="text-sm font-normal text-zinc-500">
({modTranslations.length} 모드)
</span>
)}
</h3> </h3>
{/* 업로드 영역 */} {/* 업로드 영역 */}

View file

@ -37,7 +37,7 @@ const ModpackCard = ({ modpack, isLatest }) => {
<div className={`bg-zinc-900 border rounded-2xl overflow-hidden ${isLatest ? 'border-mc-green' : 'border-zinc-800'}`}> <div className={`bg-zinc-900 border rounded-2xl overflow-hidden ${isLatest ? 'border-mc-green' : 'border-zinc-800'}`}>
{/* 헤더 */} {/* 헤더 */}
<div className="p-5"> <div className="p-5">
{/* 상단: 아이콘 + 버전 정보 */} {/* 상단: 아이콘 + 버전 정보 + 다운로드 버튼 */}
<div className="flex items-center gap-3 mb-3"> <div className="flex items-center gap-3 mb-3">
<div className={`p-2.5 rounded-xl ${isLatest ? 'bg-mc-green/20' : 'bg-zinc-800'}`}> <div className={`p-2.5 rounded-xl ${isLatest ? 'bg-mc-green/20' : 'bg-zinc-800'}`}>
<Package className={isLatest ? 'text-mc-green' : 'text-zinc-400'} size={24} /> <Package className={isLatest ? 'text-mc-green' : 'text-zinc-400'} size={24} />
@ -53,12 +53,21 @@ const ModpackCard = ({ modpack, isLatest }) => {
</div> </div>
<p className="text-sm text-zinc-400 mt-0.5 truncate">{modpack.name}</p> <p className="text-sm text-zinc-400 mt-0.5 truncate">{modpack.name}</p>
</div> </div>
</div>
{/* 다운로드 버튼 - 모바일에서 전체 너비 */} {/* PC: 오른쪽에 다운로드 버튼 */}
<a <a
href={`/api/modpacks/${modpack.id}/download`} href={`/api/modpacks/${modpack.id}/download`}
className="flex items-center justify-center gap-2 w-full sm:w-auto px-4 py-2.5 bg-mc-green hover:bg-mc-green/80 text-white font-medium rounded-xl transition-colors" className="hidden sm:flex items-center gap-2 px-4 py-2.5 bg-mc-green hover:bg-mc-green/80 text-white font-medium rounded-xl transition-colors shrink-0"
>
<Download size={18} />
<span>다운로드</span>
</a>
</div>
{/* 모바일: 전체 너비 다운로드 버튼 */}
<a
href={`/api/modpacks/${modpack.id}/download`}
className="flex sm:hidden items-center justify-center gap-2 w-full px-4 py-2.5 bg-mc-green hover:bg-mc-green/80 text-white font-medium rounded-xl transition-colors"
> >
<Download size={18} /> <Download size={18} />
<span>다운로드</span> <span>다운로드</span>