From 026a9ab526f42736b4397aa5853629458c25e882 Mon Sep 17 00:00:00 2001 From: king Date: Mon, 31 Aug 2026 11:59:44 +0900 Subject: [PATCH] =?UTF-8?q?refactor(cupang):=20=EC=9E=85=EA=B3=A0=EC=84=BC?= =?UTF-8?q?=ED=84=B0=20=EA=B4=80=EB=A6=AC=20UI=20=EB=8B=A8=EC=88=9C?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 센터 목록은 이름 등록·조회·관리가 목적이므로 "사용중" 표시를 없애고 활성/비활성/삭제만 남긴다. 좌우 2단(추가 카드 360px + 900px 고정 목록) 대신 상단 추가·검색 바 + 다중 컬럼 그리드로 바꿔 29개 이상 센터를 한 화면에서 훑을 수 있게 했다. - 행마다 폼 하나(formaction/name=active)로 저장·토글·삭제 처리 - 상태는 배지 대신 좌측 점(활성 초록 / 비활성 회색+흐리게) - 클라이언트 검색 필터, 카운트 실시간 갱신 - 라우터에서 center_in_use 조회 제거(화면에서 미사용) Co-Authored-By: Claude Opus 5 --- app/modules/cupang/router.py | 5 +- .../cupang/templates/cupang/box_calc.html | 2 +- .../cupang/templates/cupang/box_rules.html | 2 +- .../cupang/templates/cupang/centers.html | 95 ++++++++++--------- .../cupang/templates/cupang/detail.html | 2 +- app/modules/cupang/templates/cupang/form.html | 2 +- .../cupang/templates/cupang/index.html | 2 +- .../cupang/templates/cupang/products.html | 2 +- app/static/cupang.css | 52 +++++----- 9 files changed, 81 insertions(+), 83 deletions(-) diff --git a/app/modules/cupang/router.py b/app/modules/cupang/router.py index c44a7dd..c562bd4 100644 --- a/app/modules/cupang/router.py +++ b/app/modules/cupang/router.py @@ -418,9 +418,6 @@ async def centers_page(request: Request) -> HTMLResponse: return guard store, user = guard centers = sorted(store.list_centers(include_inactive=True), key=lambda c: c["name"]) - # 사용 중 여부 표시 - for c in centers: - c["in_use"] = store.center_in_use(center_id=c["id"]) return render_template( request, "cupang/centers.html", @@ -429,7 +426,7 @@ async def centers_page(request: Request) -> HTMLResponse: "is_admin": is_admin(user), "nav_items": build_erp_nav(user, active="cupang"), "page_title": "쿠팡 밀크런 — 입고센터 관리", - "page_subtitle": "추가 · 수정 · 비활성화. 사용 중 센터는 삭제되지 않고 비활성화됩니다.", + "page_subtitle": "센터명 등록 · 수정 · 활성/비활성 · 삭제.", "centers": centers, }, ) diff --git a/app/modules/cupang/templates/cupang/box_calc.html b/app/modules/cupang/templates/cupang/box_calc.html index 339a4ed..cd03a6a 100644 --- a/app/modules/cupang/templates/cupang/box_calc.html +++ b/app/modules/cupang/templates/cupang/box_calc.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {% block content %}
diff --git a/app/modules/cupang/templates/cupang/box_rules.html b/app/modules/cupang/templates/cupang/box_rules.html index bdc8375..4f08c7a 100644 --- a/app/modules/cupang/templates/cupang/box_rules.html +++ b/app/modules/cupang/templates/cupang/box_rules.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {% block content %}
diff --git a/app/modules/cupang/templates/cupang/centers.html b/app/modules/cupang/templates/cupang/centers.html index fc1cf95..adc9484 100644 --- a/app/modules/cupang/templates/cupang/centers.html +++ b/app/modules/cupang/templates/cupang/centers.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {% block content %}
@@ -9,58 +9,63 @@ ◀◀ 달력 -
+
- -
-

입고센터 추가

-
- + +
+ + +
- -
-
-

센터 목록 ({{ centers|length }})

- 사용 중 센터는 삭제 시 비활성화됩니다. -
+
+

센터 목록 ({{ centers|length }})

+ 이름을 고치면 저장, 쓰지 않는 센터는 비활성 또는 삭제. +
-
- {% for c in centers %} -
-
- - -
- - {% if c.in_use %}사용중{% endif %} - {% if c.active %}활성 - {% else %}비활성{% endif %} - - - {% if c.active %} -
- - -
- {% else %} -
- - -
- {% endif %} -
- -
-
-
- {% endfor %} -
+ +
+ {% for c in centers %} +
+ + + + + +
+ {% endfor %}
+ + {% endblock %} diff --git a/app/modules/cupang/templates/cupang/detail.html b/app/modules/cupang/templates/cupang/detail.html index 4585196..073a871 100644 --- a/app/modules/cupang/templates/cupang/detail.html +++ b/app/modules/cupang/templates/cupang/detail.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {% block content %}
diff --git a/app/modules/cupang/templates/cupang/form.html b/app/modules/cupang/templates/cupang/form.html index 1610fdf..40e1455 100644 --- a/app/modules/cupang/templates/cupang/form.html +++ b/app/modules/cupang/templates/cupang/form.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {% block content %}
diff --git a/app/modules/cupang/templates/cupang/index.html b/app/modules/cupang/templates/cupang/index.html index a9980cb..8f2b3a7 100644 --- a/app/modules/cupang/templates/cupang/index.html +++ b/app/modules/cupang/templates/cupang/index.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {% block content %}
diff --git a/app/modules/cupang/templates/cupang/products.html b/app/modules/cupang/templates/cupang/products.html index 6265fbb..c010525 100644 --- a/app/modules/cupang/templates/cupang/products.html +++ b/app/modules/cupang/templates/cupang/products.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {% block content %}
diff --git a/app/static/cupang.css b/app/static/cupang.css index ecd62dd..2b359b4 100644 --- a/app/static/cupang.css +++ b/app/static/cupang.css @@ -169,45 +169,41 @@ .cpg-inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; } .cpg-row-actions { display: flex; gap: 6px; flex-wrap: wrap; } -/* ── 입고센터 관리 (좌: 추가 / 우: 목록) ── */ -.cpg-center-layout { - display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; -} -.cpg-center-add { - width: 360px; flex: 0 0 auto; - padding: 16px; -} -.cpg-center-listcard { - flex: 1 1 480px; min-width: 0; - height: 900px; - display: flex; flex-direction: column; overflow: hidden; -} -@media (max-width: 820px) { - .cpg-center-add, .cpg-center-listcard { width: 100%; flex-basis: 100%; } -} +/* ── 입고센터 관리 (상단: 추가·검색 / 아래: 목록 그리드) ── */ +.cpg-center-card { padding: 16px; } -.cpg-center-add-title { font-size: 15px; font-weight: 600; margin: 0 0 8px; } -.cpg-btn-sm { padding: 3px 8px; font-size: 12px; } +.cpg-center-bar { + display: flex; flex-wrap: wrap; gap: 10px; align-items: center; + padding-bottom: 12px; border-bottom: 1px solid var(--color-subtle-ash); +} +.cpg-center-addform { display: flex; gap: 6px; align-items: center; margin: 0; flex: 1 1 320px; min-width: 0; } +.cpg-center-addinput { flex: 1 1 auto; min-width: 0; } +.cpg-center-search { flex: 0 1 240px; min-width: 0; } -/* 목록: 카드 높이 채우고 내부 스크롤 */ -.cpg-center-list { - flex: 1 1 auto; min-height: 0; overflow-y: auto; - display: flex; flex-direction: column; gap: 6px; +.cpg-center-head { margin: 12px 0 8px; } + +.cpg-center-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); + gap: 6px; + max-height: 70vh; overflow-y: auto; padding-right: 4px; } .cpg-center-row { - display: flex; align-items: center; gap: 8px; - padding: 5px 8px; + display: flex; align-items: center; gap: 6px; + margin: 0; padding: 5px 8px; border: 1px solid var(--color-subtle-ash); border-radius: 10px; min-width: 0; } +.cpg-center-dot { + flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; + background: var(--color-success-green, #10c22b); +} .cpg-center-row.is-inactive { opacity: .55; } -.cpg-center-edit { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; } +.cpg-center-row.is-inactive .cpg-center-dot { background: var(--color-subtle-ash); } .cpg-center-name { flex: 1 1 auto; min-width: 0; } -.cpg-center-sort { width: 56px; flex: 0 0 auto; } -.cpg-center-state { display: inline-flex; gap: 4px; flex: 0 0 auto; } -.cpg-center-act { display: inline-flex; gap: 4px; flex: 0 0 auto; } +.cpg-btn-sm { padding: 3px 8px; font-size: 12px; flex: 0 0 auto; } /* ── 라인 테이블 ── */ .cpg-lines td { vertical-align: middle; }