Skip to content

Commit ffa4d06

Browse files
committed
fix : 비로그인 화면 영어 카테고리들 한글화
1 parent ae9470a commit ffa4d06

2 files changed

Lines changed: 54 additions & 4 deletions

File tree

backend-core/static/users/js/homepage_guest.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
/**
22
* 비로그인 전용 홈 페이지: API로 미션 목록만 불러와서 렌더링
33
*/
4+
5+
const CATEGORY_MAP = {
6+
'ERRAND': '심부름',
7+
'STUDY': '학업',
8+
'RENTAL': '대여',
9+
'RECRUIT': '구인',
10+
'LIFE': '생활',
11+
'OTHER': '기타'
12+
};
13+
14+
const CATEGORY_CLASS_MAP = {
15+
'심부름': 'errand', 'ERRAND': 'errand',
16+
'학업': 'study', 'STUDY': 'study',
17+
'대여': 'rent', 'RENTAL': 'rent',
18+
'구인': 'job', 'RECRUIT': 'job',
19+
'생활': 'life', 'LIFE': 'life',
20+
'기타': 'etc', 'OTHER': 'etc'
21+
};
22+
23+
const STATUS_MAP = {
24+
'WAITING': { text: '대기중', class: 'waiting' },
25+
'MATCHED': { text: '진행중', class: 'matched' },
26+
'COMPLETED': { text: '완료', class: 'completed' }
27+
};
28+
429
async function loadGuestHomepage() {
530
if (localStorage.getItem('access_token')) {
631
window.location.href = '/api/users/homepage/';
@@ -38,10 +63,10 @@ async function loadGuestHomepage() {
3863

3964
container.innerHTML = latestMissions.map(function (m) {
4065
const title = (m.title || '').replace(/</g, '&lt;').replace(/>/g, '&gt;');
41-
const category = m.category || '기타';
66+
const category = CATEGORY_MAP[m.category] || '기타';
4267
const location_name = m.location_name || '장소 미지정';
4368
const reward = m.reward != null ? m.reward.toLocaleString() + '원' : '가격 미정';
44-
const status = m.status || '진행중';
69+
const status = STATUS_MAP[m.status].text || '진행중';
4570
const id = m.id || '';
4671

4772
// 카테고리에 맞는 클래스 선택

backend-core/staticfiles/users/js/homepage_guest.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
/**
22
* 비로그인 전용 홈 페이지: API로 미션 목록만 불러와서 렌더링
33
*/
4+
5+
const CATEGORY_MAP = {
6+
'ERRAND': '심부름',
7+
'STUDY': '학업',
8+
'RENTAL': '대여',
9+
'RECRUIT': '구인',
10+
'LIFE': '생활',
11+
'OTHER': '기타'
12+
};
13+
14+
const CATEGORY_CLASS_MAP = {
15+
'심부름': 'errand', 'ERRAND': 'errand',
16+
'학업': 'study', 'STUDY': 'study',
17+
'대여': 'rent', 'RENTAL': 'rent',
18+
'구인': 'job', 'RECRUIT': 'job',
19+
'생활': 'life', 'LIFE': 'life',
20+
'기타': 'etc', 'OTHER': 'etc'
21+
};
22+
23+
const STATUS_MAP = {
24+
'WAITING': { text: '대기중', class: 'waiting' },
25+
'MATCHED': { text: '진행중', class: 'matched' },
26+
'COMPLETED': { text: '완료', class: 'completed' }
27+
};
28+
429
async function loadGuestHomepage() {
530
if (localStorage.getItem('access_token')) {
631
window.location.href = '/api/users/homepage/';
@@ -38,10 +63,10 @@ async function loadGuestHomepage() {
3863

3964
container.innerHTML = latestMissions.map(function (m) {
4065
const title = (m.title || '').replace(/</g, '&lt;').replace(/>/g, '&gt;');
41-
const category = m.category || '기타';
66+
const category = CATEGORY_MAP[m.category] || '기타';
4267
const location_name = m.location_name || '장소 미지정';
4368
const reward = m.reward != null ? m.reward.toLocaleString() + '원' : '가격 미정';
44-
const status = m.status || '진행중';
69+
const status = STATUS_MAP[m.status].text || '진행중';
4570
const id = m.id || '';
4671

4772
// 카테고리에 맞는 클래스 선택

0 commit comments

Comments
 (0)