#16 board : article form
This commit is contained in:
60
board/src/main/resources/templates/articles/form.html
Normal file
60
board/src/main/resources/templates/articles/form.html
Normal file
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="Uno Kim">
|
||||
<title>새 게시글 등록</title>
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header id="header">
|
||||
헤더 삽입부
|
||||
<hr>
|
||||
</header>
|
||||
|
||||
<div class="container">
|
||||
<header id="article-form-header" class="py-5 text-center">
|
||||
<h1>게시글 작성</h1>
|
||||
</header>
|
||||
|
||||
<form id="article-form">
|
||||
<div class="row mb-3 justify-content-md-center">
|
||||
<label for="title" class="col-sm-2 col-lg-1 col-form-label text-sm-end">제목</label>
|
||||
<div class="col-sm-8 col-lg-9">
|
||||
<input type="text" class="form-control" id="title" name="title" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 justify-content-md-center">
|
||||
<label for="content" class="col-sm-2 col-lg-1 col-form-label text-sm-end">본문</label>
|
||||
<div class="col-sm-8 col-lg-9">
|
||||
<textarea class="form-control" id="content" name="content" rows="5" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-4 justify-content-md-center">
|
||||
<label for="hashtag" class="col-sm-2 col-lg-1 col-form-label text-sm-end">해시태그</label>
|
||||
<div class="col-sm-8 col-lg-9">
|
||||
<input type="text" class="form-control" id="hashtag" name="hashtag">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-5 justify-content-md-center">
|
||||
<div class="col-sm-10 d-grid gap-2 d-sm-flex justify-content-sm-end">
|
||||
<button type="submit" class="btn btn-primary" id="submit-button">저장</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancel-button">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<footer id="footer">
|
||||
<hr>
|
||||
푸터 삽입부
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
15
board/src/main/resources/templates/articles/form.th.xml
Normal file
15
board/src/main/resources/templates/articles/form.th.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0"?>
|
||||
<thlogic>
|
||||
<attr sel="#header" th:replace="header :: header" />
|
||||
<attr sel="#footer" th:replace="footer :: footer" />
|
||||
|
||||
<attr sel="#article-form-header/h1" th:text="${formStatus} ? '게시글 ' + ${formStatus.description} : _" />
|
||||
|
||||
<attr sel="#article-form" th:action="${formStatus?.update} ? '/articles/' + ${article.id} + '/form' : '/articles/form'" th:method="post">
|
||||
<attr sel="#title" th:value="${article?.title} ?: _" />
|
||||
<attr sel="#content" th:text="${article?.content} ?: _" />
|
||||
<attr sel="#hashtag" th:value="${article?.hashtag} ?: _" />
|
||||
<attr sel="#submit-button" th:text="${formStatus?.description} ?: _" />
|
||||
<attr sel="#cancel-button" th:onclick="'history.back()'" />
|
||||
</attr>
|
||||
</thlogic>
|
||||
Reference in New Issue
Block a user