공지사항 목록 정렬 및 UI 개선
- 상단고정(fixYn) 우선 정렬 로직 추가 - 고정 뱃지 UI 템플릿 추가
This commit is contained in:
+9
-1
@@ -44,7 +44,15 @@ public class PortalNoticeFacadeImpl implements PortalNoticeFacade {
|
|||||||
Specification<PortalNotice> spec = Specification.where(search.buildSpecification())
|
Specification<PortalNotice> spec = Specification.where(search.buildSpecification())
|
||||||
.and((root, query, criteriaBuilder) -> criteriaBuilder.equal(root.get("useYn"),"Y"));
|
.and((root, query, criteriaBuilder) -> criteriaBuilder.equal(root.get("useYn"),"Y"));
|
||||||
|
|
||||||
Page<PortalNotice> noticesPage = portalNoticeService.getNotices(spec, pageable);
|
// 상단고정(fixYn='Y') 우선 정렬 — 호출자의 sort 앞에 결합 (admin Service 와 일관)
|
||||||
|
Sort fixYnFirst = Sort.by(Sort.Direction.DESC, "fixYn");
|
||||||
|
Pageable fixedPageable = PageRequest.of(
|
||||||
|
pageable.getPageNumber(),
|
||||||
|
pageable.getPageSize(),
|
||||||
|
fixYnFirst.and(pageable.getSort())
|
||||||
|
);
|
||||||
|
|
||||||
|
Page<PortalNotice> noticesPage = portalNoticeService.getNotices(spec, fixedPageable);
|
||||||
return noticesPage.map(portalNoticeMapper::map);
|
return noticesPage.map(portalNoticeMapper::map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,9 @@
|
|||||||
<div class="row-cell row-cell--title" style="flex: 1; min-width: 200px;" data-label="제목">
|
<div class="row-cell row-cell--title" style="flex: 1; min-width: 200px;" data-label="제목">
|
||||||
<a th:href="@{/portalnotice/detail(id=${notice.id})}" class="notice-title-link">
|
<a th:href="@{/portalnotice/detail(id=${notice.id})}" class="notice-title-link">
|
||||||
<span class="notice-number" th:text="|[${page.totalElements - (page.number * page.size) - status.index}]|">[1]</span>
|
<span class="notice-number" th:text="|[${page.totalElements - (page.number * page.size) - status.index}]|">[1]</span>
|
||||||
|
<span class="notice-fix-badge"
|
||||||
|
th:if="${notice.fixYn == 'Y'}"
|
||||||
|
style="display:inline-block;padding:2px 8px;margin-right:6px;border-radius:10px;font-size:12px;background:#e5f0ff;color:#0a4ea3;font-weight:600;">고정</span>
|
||||||
<span class="notice-type-badge notice-type-badge--incident"
|
<span class="notice-type-badge notice-type-badge--incident"
|
||||||
th:if="${notice.noticeType == '3'}"
|
th:if="${notice.noticeType == '3'}"
|
||||||
style="display:inline-block;padding:2px 8px;margin-right:6px;border-radius:10px;font-size:12px;background:#fde7e9;color:#c0152a;">장애</span>
|
style="display:inline-block;padding:2px 8px;margin-right:6px;border-radius:10px;font-size:12px;background:#fde7e9;color:#c0152a;">장애</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user