refactor(cupang): 입고센터 이름 수정 기능 제거
이름을 바꾸면 그 센터를 쓰던 기존 출고 건과 어긋날 수 있어 수정 경로를 막는다. 잘못 등록한 센터는 삭제 후 새로 등록. - 목록 행: 이름 input+저장 버튼 → 읽기 전용 텍스트 - center_edit 라우터에서 name 폼 파라미터 제거(활성/정렬만 수정) - 행이 좁아져 그리드 최소폭 340px → 240px Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -453,7 +453,6 @@ async def center_create(
|
||||
async def center_edit(
|
||||
request: Request,
|
||||
center_id: int,
|
||||
name: str = Form(""),
|
||||
active: str = Form(""),
|
||||
sort_order: str = Form(""),
|
||||
user: dict[str, Any] = Depends(_require_user),
|
||||
@@ -461,9 +460,8 @@ async def center_edit(
|
||||
store = _store(request)
|
||||
if store is None:
|
||||
raise HTTPException(status_code=503, detail="cupang_db 미설정")
|
||||
# 이름 변경은 지원하지 않는다(기존 출고 이력과 어긋날 수 있음). 활성/정렬만 수정.
|
||||
kwargs: dict[str, Any] = {"center_id": center_id}
|
||||
if name.strip():
|
||||
kwargs["name"] = name
|
||||
if active != "":
|
||||
kwargs["active"] = active in ("1", "true", "on", "True")
|
||||
if sort_order.strip():
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831a" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831b" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="cpg">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831a" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831b" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="cpg">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831a" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831b" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="cpg">
|
||||
@@ -24,25 +24,25 @@
|
||||
|
||||
<div class="cpg-card-head cpg-center-head">
|
||||
<h2>센터 목록 <span class="erp-muted" id="cpgCenterCount">({{ centers|length }})</span></h2>
|
||||
<span class="erp-muted">이름을 고치면 저장, 쓰지 않는 센터는 비활성 또는 삭제.</span>
|
||||
<span class="erp-muted">쓰지 않는 센터는 비활성 또는 삭제. 이름 변경은 지원하지 않음 — 새로 등록.</span>
|
||||
</div>
|
||||
|
||||
<!-- 목록: 여러 열로 한 화면에 -->
|
||||
<div class="cpg-center-grid" id="cpgCenterGrid">
|
||||
{% for c in centers %}
|
||||
<form method="post" action="/cupang/centers/{{ c.id }}/edit"
|
||||
class="cpg-center-row {% if not c.active %}is-inactive{% endif %}"
|
||||
data-name="{{ c.name|lower }}">
|
||||
<div class="cpg-center-row {% if not c.active %}is-inactive{% endif %}" data-name="{{ c.name|lower }}">
|
||||
<span class="cpg-center-dot" title="{% if c.active %}활성{% else %}비활성{% endif %}"></span>
|
||||
<input class="erp-input cpg-center-name" type="text" name="name" value="{{ c.name }}" />
|
||||
<button type="submit" class="erp-btn erp-btn-outline cpg-btn-sm" title="이름 저장">저장</button>
|
||||
<button type="submit" name="active" value="{% if c.active %}0{% else %}1{% endif %}"
|
||||
class="erp-btn erp-btn-outline cpg-btn-sm"
|
||||
title="{% if c.active %}비활성으로 전환{% else %}활성으로 전환{% endif %}">{% if c.active %}비활성{% else %}활성{% endif %}</button>
|
||||
<button type="submit" formaction="/cupang/centers/{{ c.id }}/delete" formnovalidate
|
||||
class="erp-btn erp-btn-danger cpg-btn-sm"
|
||||
onclick="return confirm('{{ c.name }} 센터를 삭제할까요?');">삭제</button>
|
||||
</form>
|
||||
<span class="cpg-center-name">{{ c.name }}</span>
|
||||
<form method="post" action="/cupang/centers/{{ c.id }}/edit" class="cpg-inline-form">
|
||||
<input type="hidden" name="active" value="{% if c.active %}0{% else %}1{% endif %}" />
|
||||
<button type="submit" class="erp-btn erp-btn-outline cpg-btn-sm"
|
||||
title="{% if c.active %}비활성으로 전환{% else %}활성으로 전환{% endif %}">{% if c.active %}비활성{% else %}활성{% endif %}</button>
|
||||
</form>
|
||||
<form method="post" action="/cupang/centers/{{ c.id }}/delete" class="cpg-inline-form"
|
||||
onsubmit="return confirm('{{ c.name }} 센터를 삭제할까요?');">
|
||||
<button type="submit" class="erp-btn erp-btn-danger cpg-btn-sm">삭제</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831a" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831b" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="cpg">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831a" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831b" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="cpg">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831a" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831b" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="cpg">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831a" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260831b" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="cpg">
|
||||
|
||||
Reference in New Issue
Block a user