board/list.html
페이지 정보
작성자 관리자 작성일 24-07-04 09:40 조회 35 댓글 0본문
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{include/layout.html}">
<body>
<div layout:fragment="content">
<br>
<script th:inline="javascript">
const result = [[${bno}]];
if(result){
alert(result);
}
</script>
<center>
<h1>LIST</h1>
<table width="700" border="0">
<tr>
<td>Total : [[${result.total}]]</td>
<td align="right">
<form>
<select name="size"><!-- 출력 게시물 수 -->
<option value="1" th:selected="${result.size == 1}">1</option>
<option value="2" th:selected="${result.size == 2}">2</option>
<option value="5" th:selected="${result.size == 5}">5</option>
<option value="10" th:selected="${result.size == 10}">10</option>
</select>
<select name="type">
<option value="">-------</option>
<option value="t" th:selected="${pageRequestDTO.type == 't'}">제목</option>
<option value="c" th:selected="${pageRequestDTO.type == 'c'}">내용</option>
<option value="w" th:selected="${pageRequestDTO.type == 'w'}">작성자</option>
<option value="tc" th:selected="${pageRequestDTO.type == 'tc'}">제목 작성자</option>
<option value="tcw" th:selected="${pageRequestDTO.type == 'tcw'}">제목 내용 작성자</option>
</select>
<input name="keyword" th:value="${pageRequestDTO.keyword}">
<button>검색</button>
</form>
</td>
</tr>
</table>
<!-- 부모 태그에 전역변수 처리 -->
<table width=700 border=1 th:with="nums=${result.total - (result.page - 1) * result.size}">
<tr>
<th width="50">No</th>
<th width="50">bno</th>
<th width="*">제목</th>
<th width="80">작성자</th>
<th width="80">날짜</th>
<th width="50">조회수</th>
</tr>
<tr th:each="dto, num : ${result.dtoList}">
<!-- 지역변수 -->
<td th:text="${nums - num.index}" align=center></td>
<td align="center">[[${dto.bno}]]</td>
<td>
<span th:if="${dto.boardImages != null && dto.boardImages.size() > 0}">
<img width="30" th:each="boardImage : ${dto.boardImages}" th:src="|/view/s_${boardImage.uuid}_${boardImage.fileName}|">
</span>
<a th:href="|@{read(bno=${dto.bno})}&${pageRequestDTO.link}|">[[${dto.title}]]</a>
<span th:if="${dto.replyCount} > 0" style="color:red">([[${dto.replyCount}]])</span>
</td>
<td align="center">[[${dto.writer}]]</td>
<td align="center">[[${#temporals.format(dto.regDate, 'yyyy-MM-dd')}]]</td>
<td align="center">[[${dto.cnt}]]</td>
</tr>
</table>
<style>
.active { font-weight:bold; }
</style>
<table width="700" border="0">
<tr>
<td>
<span th:if="${result.prev}">
<a th:href="@{list(page=${result.start-1},size=${result.size},type=${pageRequestDTO.type},keyword=${pageRequestDTO.keyword})}">이전</a></span>
</span>
<th:block th:each="i: ${#numbers.sequence(result.start, result.end)}">
<span th:class="${result.page == i ? 'active' : ''}">
<a th:href="@{list(page=${i},size=${result.size},type=${pageRequestDTO.type},keyword=${pageRequestDTO.keyword})}" th:text="${i}"></a>
</span>
</th:block>
<span th:if="${result.next}">
<a th:href="@{list(page=${result.end+1},size=${result.size},type=${pageRequestDTO.type},keyword=${pageRequestDTO.keyword})}">다음</a>
</span>
</td>
<td align="right">
<a href="list">[새로고침]</a>
<a href="register">[글쓰기]</a>
</td>
</tr>
</table>
</center>
<br>
</div>
</body>
</html>
댓글목록 0
등록된 댓글이 없습니다.