Skip to content

Commit 3a2a92d

Browse files
authored
Merge pull request #168 from pirogramming/hyungju/main
feat: form에서 스택 선택하지 못하도록 변경, 플젝 선택한 것에 따라 정해지도록 수정
2 parents 95d0157 + 8264020 commit 3a2a92d

3 files changed

Lines changed: 30 additions & 7 deletions

File tree

static/css/reflections.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,14 @@ button.ref-btn{
15851585
font-size: 13px;
15861586
}
15871587

1588+
.ref-select[disabled]{
1589+
background: #f9fafb;
1590+
color: var(--gray-600);
1591+
cursor: not-allowed;
1592+
opacity: 1; /* disabled 기본 투명도 제거 */
1593+
}
1594+
1595+
15881596
.ref-meta-hint {
15891597
font-size: 11px;
15901598
margin-left: 5px;

static/js/reflections.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,29 @@
150150
roleMap = {};
151151
}
152152

153+
const setRole = (val) => {
154+
roleSel.value = val || ""; // 개인 회고면 빈값
155+
};
156+
157+
// 초기 상태(수정 페이지 대응): 프로젝트가 없으면 role 비우기
158+
if (!projectSel.value) setRole("");
159+
153160
projectSel.addEventListener("change", () => {
154161
const pid = projectSel.value;
155-
if (!pid) return;
156162

157-
const autoRole = roleMap[pid];
158-
if (autoRole) {
159-
roleSel.value = autoRole; // 사용자가 원하면 다시 바꿀 수 있음
163+
// ✅ "선택 안 함(개인용)"이면 개인 회고로 리셋
164+
if (!pid) {
165+
setRole("");
166+
return;
160167
}
168+
169+
// ✅ 프로젝트 선택하면 roleMap 기반으로 자동 세팅
170+
const autoRole = roleMap[pid];
171+
setRole(autoRole || "");
161172
});
162173
};
163174

175+
164176
const bindAssetUpload = () => {
165177
const fileInput = document.getElementById("assetFileInput");
166178
if (!fileInput) return;

templates/reflections/_note_form.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,14 @@
6666
<label class="ref-label">프로젝트</label>
6767
<div class="ref-selectwrap">
6868
<select name="project_id" class="ref-select" data-project-select>
69-
<option value="">선택 안 함 (개인용)</option>
69+
<option value="">선택 안 함 (개인 회고)</option>
7070
{% if my_projects %}
7171
{% for p in my_projects %}
7272
<option value="{{ p.id }}" {% if note and note.project_id == p.id %}selected{% endif %}>
7373
{{ p.title }}
74+
{% with my_role_map|get_item:p.id as r %}
75+
{% if r %} ({{ r }}){% else %} (역할 미지정){% endif %}
76+
{% endwith %}
7477
</option>
7578
{% endfor %}
7679
{% endif %}
@@ -86,8 +89,8 @@
8689
<div class="ref-meta-row">
8790
<label class="ref-label">역할</label>
8891
<div class="ref-selectwrap">
89-
<select name="role" class="ref-select" data-role-select>
90-
<option value="">선택 안 함</option>
92+
<select name="role" class="ref-select" data-role-select disabled>
93+
<option value="">개인 회고</option>
9194
<option value="PM" {% if note.role == "PM" %}selected{% endif %}>WEB 기획</option>
9295
<option value="FRONTEND" {% if note.role == "FRONTEND" %}selected{% endif %}>WEB 프론트엔드</option>
9396
<option value="BACKEND" {% if note.role == "BACKEND" %}selected{% endif %}>WEB 백엔드</option>

0 commit comments

Comments
 (0)