- 각 화면 내 <h1> 페이지 타이틀 제거 → 헤더 타이틀로 일원화 (가계부 pending 카운트는 유지, 액션 헤더는 우측 정렬) - 게시글 상세: 공지 등록/해제 버튼 제거 + '목록' 아이콘 추가(list 아이콘 신규) - 글 작성/수정 공지 체크박스로 일원화(편집 시 기존값 로드) - ProfileEdit/AccountInfo 화면 내 뒤로가기 제거, 미사용 router 정리 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -80,15 +80,6 @@ async function unblockPost() {
|
||||
}
|
||||
}
|
||||
|
||||
async function setNoticePost(on) {
|
||||
try {
|
||||
await (on ? boardApi.setNotice(postId) : boardApi.unsetNotice(postId))
|
||||
await load()
|
||||
} catch (e) {
|
||||
alert(e.response?.data?.message || '처리에 실패했습니다.')
|
||||
}
|
||||
}
|
||||
|
||||
async function addComment() {
|
||||
const content = commentText.value.trim()
|
||||
if (!content) return
|
||||
@@ -151,10 +142,8 @@ onMounted(load)
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<IconBtn icon="list" title="목록" @click="router.push(`/board/${category}`)" />
|
||||
<div class="right-actions">
|
||||
<!-- 관리자 공지 설정/해제 (커뮤니티) -->
|
||||
<button v-if="isAdmin && category === 'community' && !post.notice" type="button" class="notice-btn" @click="setNoticePost(true)">공지 등록</button>
|
||||
<button v-if="isAdmin && category === 'community' && post.notice" type="button" class="notice-btn" @click="setNoticePost(false)">공지 해제</button>
|
||||
<!-- 관리자 제한/해제 -->
|
||||
<button v-if="isAdmin && !post.blocked" type="button" class="warn" @click="blockPost">열람 제한</button>
|
||||
<button v-if="isAdmin && post.blocked" type="button" class="warn" @click="unblockPost">제한 해제</button>
|
||||
@@ -295,7 +284,7 @@ button.notice-btn {
|
||||
}
|
||||
.actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
border-top: 1px solid var(--color-border);
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
@@ -128,8 +128,7 @@ onMounted(loadTags)
|
||||
|
||||
<template>
|
||||
<section class="board">
|
||||
<header class="board-head">
|
||||
<h1>{{ boardTitle }}</h1>
|
||||
<header class="board-head" style="justify-content: flex-end">
|
||||
<IconBtn icon="edit" title="글쓰기" variant="primary" @click="router.push(`/board/${category}/write`)" />
|
||||
</header>
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ const auth = useAuthStore()
|
||||
const category = route.params.category || DEFAULT_BOARD
|
||||
const editId = route.params.id || null
|
||||
const isEdit = computed(() => !!editId)
|
||||
// 공지: 관리자가 커뮤니티 게시판에 새 글 작성할 때만 설정 가능
|
||||
// 공지: 관리자가 커뮤니티 게시판 글을 작성/수정할 때 체크박스로 설정
|
||||
const isAdmin = computed(() => auth.user?.role === 'ADMIN')
|
||||
const canNotice = computed(() => isAdmin.value && category === 'community' && !isEdit.value)
|
||||
const canNotice = computed(() => isAdmin.value && category === 'community')
|
||||
|
||||
const title = ref('')
|
||||
const content = ref('')
|
||||
@@ -49,6 +49,7 @@ async function loadForEdit() {
|
||||
const p = await boardApi.get(editId)
|
||||
title.value = p.title
|
||||
content.value = p.content
|
||||
notice.value = !!p.notice
|
||||
// 게시글의 태그(이름) → 현재 태그 목록에서 id 매핑
|
||||
const nameToId = {}
|
||||
tagGroups.value.forEach((c) => c.tags.forEach((t) => (nameToId[t.name] = t.id)))
|
||||
@@ -99,7 +100,6 @@ onMounted(async () => {
|
||||
|
||||
<template>
|
||||
<section class="write">
|
||||
<h1>{{ isEdit ? '글 수정' : '글쓰기' }}</h1>
|
||||
|
||||
<form class="write-form" @submit.prevent="submit">
|
||||
<input v-model="title" type="text" placeholder="제목" maxlength="200" :disabled="loading" />
|
||||
|
||||
Reference in New Issue
Block a user