최초 커밋!
This commit is contained in:
138
front/src/main/resources/templates/board/exampleBoardForm.html
Normal file
138
front/src/main/resources/templates/board/exampleBoardForm.html
Normal file
@@ -0,0 +1,138 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
<form enctype="multipart/form-data"
|
||||
method="post"
|
||||
name="updateForm" th:action="@{/board/exampleBoard/} + ${formDto.editMode ? 'update' : 'create'}"
|
||||
th:object="${formDto}">
|
||||
<input name="editMode" th:value="${formDto.editMode}" type="hidden"/>
|
||||
<input name="id" th:if="${formDto.editMode}" th:value="${formDto.id}" type="hidden"/>
|
||||
|
||||
<div>
|
||||
<h1 th:text="${formDto.title}">
|
||||
</h1>
|
||||
|
||||
<div>
|
||||
<label>게시일 *</label>
|
||||
<div>
|
||||
<span th:text="${formDto.boardStartDate}"></span> ~ <span
|
||||
th:text="${formDto.boardEndDate}"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>공개여부</label>
|
||||
<div th:text="${formDto.visible}">
|
||||
</div>
|
||||
|
||||
<div th:utext="${formDto.content}">
|
||||
|
||||
</div>
|
||||
|
||||
<div th:if="${formDto.editMode}">
|
||||
<label for="content" style="padding-top: 0;">public 파일</label>
|
||||
<div>
|
||||
<div th:each="item, status : ${formDto.uploadedFiles}">
|
||||
<a th:attr="data-file-seq=${item.seq}" th:href="${@commonUtil.getPublicIOPath(item)}"
|
||||
th:text="${item.originalFilename}"
|
||||
></a>
|
||||
<a href="javascript:void(0);" onclick="removeFile(this);"
|
||||
th:attr="data-del-file-seq=${item.seq}"><i
|
||||
></i></a>
|
||||
<a href="javascript:void(0);" onclick="cancelRemove(this);" style="display: none;"
|
||||
th:attr="data-cancel-file-seq=${item.seq}"
|
||||
> (취소)</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div th:if="${formDto.editMode}">
|
||||
<label for="content" style="padding-top: 0;">private 파일</label>
|
||||
<div>
|
||||
<div th:each="item, status : ${formDto.uploadedPrivates}">
|
||||
<a th:attr="data-file-seq=${item.seq}" th:href="${@commonUtil.getPrivateIOPath(item)}"
|
||||
th:text="${item.originalFilename}"
|
||||
></a>
|
||||
<a href="javascript:void(0);" onclick="removeFile(this);"
|
||||
th:attr="data-del-file-seq=${item.seq}"><i
|
||||
></i></a>
|
||||
<a href="javascript:void(0);" onclick="cancelRemove(this);" style="display: none;"
|
||||
th:attr="data-cancel-file-seq=${item.seq}"
|
||||
> (취소)</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<button onclick="gotoList();return false;" type="button">목록으로 이동</button>
|
||||
</form>
|
||||
|
||||
<!-- 이전 목록페이지의 검색 및 정렬조건 폼 -->
|
||||
<form method="get" name="prevParamForm" th:action="@{/board/exampleBoard}"
|
||||
th:if="${formDto.editMode}"
|
||||
th:object="${paramDto}">
|
||||
<input th:field="*{searchField}" type="hidden">
|
||||
<input th:field="*{searchValue}" type="hidden">
|
||||
<input th:field="*{searchOpen}" type="hidden">
|
||||
<input th:field="*{page}" type="hidden">
|
||||
<input th:field="*{size}" type="hidden">
|
||||
<input th:field="*{sort}" type="hidden">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function gotoList() {
|
||||
document.prevParamForm ? document.prevParamForm.submit()
|
||||
: location.href = '/board/exampleBoard';
|
||||
}
|
||||
|
||||
function removeFile(oj) {
|
||||
const fileSeq = $(oj).data('del-file-seq');
|
||||
const el = $('a[data-file-seq=' + fileSeq + ']');
|
||||
el.addClass('text-decoration-line-through');
|
||||
$(oj).hide();
|
||||
|
||||
const cancelEl = $('a[data-cancel-file-seq=' + fileSeq + ']');
|
||||
cancelEl.show();
|
||||
|
||||
const f = document.updateForm;
|
||||
let input = $('<input type="hidden" name="delFileSeq">');
|
||||
input.val(fileSeq);
|
||||
input.attr('id', 'del_' + fileSeq);
|
||||
$(f).append(input);
|
||||
}
|
||||
|
||||
function cancelRemove(oj) {
|
||||
const fileSeq = $(oj).data('cancel-file-seq');
|
||||
const el = $('a[data-file-seq=' + fileSeq + ']');
|
||||
el.removeClass('text-decoration-line-through');
|
||||
|
||||
$('#del_' + fileSeq).remove();
|
||||
|
||||
$('a[data-del-file-seq=' + fileSeq + ']').show();
|
||||
|
||||
$(oj).hide();
|
||||
}
|
||||
|
||||
function addFileInput(type) {
|
||||
let tmpl = $.templates('#fileInputTmpl');
|
||||
switch (type) {
|
||||
case 'public':
|
||||
$('.publicFileInputs').append(tmpl.render({'name': 'multipartFiles'}));
|
||||
break;
|
||||
case 'private':
|
||||
$('.privateFileInputs').append(tmpl.render({'name': 'privateFiles'}));
|
||||
break;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script id="fileInputTmpl" type="text/x-jsrender">
|
||||
<input type="file" name="{{:name}}"/>
|
||||
|
||||
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user