89 lines
3.2 KiB
HTML
89 lines
3.2 KiB
HTML
<!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 class="fw-bold" enctype="multipart/form-data" method="post"
|
|
th:action="@{/addons/email/form}" th:object="${formDto}">
|
|
|
|
<div class="row mb-3">
|
|
<label class="col-sm-2 col-form-label" for="id">To *</label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" id="id" th:classappend="${#fields.hasErrors('to')} ? 'is-invalid'" th:field="*{to}"
|
|
type="email"/>
|
|
<div class="invalid-feedback fw-bold" th:errors="*{to}" th:if="${#fields.hasErrors('to')}">
|
|
에러 메세지
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
<label class="col-sm-2 col-form-label" for="subject">Subject *</label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" id="subject" th:classappend="${#fields.hasErrors('subject')} ? 'is-invalid'"
|
|
th:field="*{subject}"/>
|
|
<div class="invalid-feedback fw-bold" th:errors="*{subject}"
|
|
th:if="${#fields.hasErrors('subject')}">
|
|
에러 메세지
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
<label class="col-sm-2 col-form-label" for="msgType">Message Type *</label>
|
|
<div class="col-sm-4">
|
|
<input checked class="form-check-input" id="msgType" name="msgType" type="radio"
|
|
value="HTML"/>
|
|
<label class="form-check-label" for="msgType">HTML</label>
|
|
<input class="form-check-input" id="msgType2" name="msgType" type="radio" value="TEXT"/>
|
|
<label class="form-check-label" for="msgType2">TEXT</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
<label class="col-sm-2 col-form-label" for="message">Message *</label>
|
|
<div class="col-sm-4">
|
|
<textarea class="form-control" id="message" th:classappend="${#fields.hasErrors('message')} ? 'is-invalid'" th:field="*{message}"
|
|
type="text"></textarea>
|
|
<div class="invalid-feedback fw-bold" th:errors="*{message}"
|
|
th:if="${#fields.hasErrors('message')}">
|
|
에러 메세지
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-3 publicFileInputs">
|
|
<label class="form-label d-block" for="formFile1">파일 첨부</label>
|
|
<input class="form-control w-50 d-inline-block mb-2" id="formFile1" name="multipartFiles"
|
|
type="file">
|
|
<button class="btn btn-success d-inline-block align-top" onclick="addFileInput('public');"
|
|
type="button">추가
|
|
</button>
|
|
</div>
|
|
|
|
<button class="btn btn-primary" type="submit">발송</button>
|
|
</form>
|
|
|
|
<script>
|
|
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 class="form-control w-50 mb-2" type="file" name="{{:name}}"/>
|
|
|
|
</script>
|
|
</section>
|
|
|
|
</html>
|