Skip to content

Instantly share code, notes, and snippets.

@sigmadream

sigmadream/add-button.html

Last active Apr 22, 2020
Embed
What would you like to do?
2020.04.12 ~ 04.18 (#05) – MVC 패턴(2), View과 관련된 코드
<a href="/add" class="btn btn-primary">
<i class="fas fa-user-plus ml-2">추가</i>
</a>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
<title>학생명단 v1 | Add</title>
</head>
<body>
<div class="container">
<h3>학생 명부 추가</h3>
<form action="#" th:action="@{/add}" th:object="${student}" method="post">
<div class="form-group col-md-8">
<label for="name" class="col-form-label">Name</label>
<input type="text" th:field="*{name}" class="form-control" id="name" placeholder="Name">
</div>
<div class="form-group col-md-8">
<label for="email" class="col-form-label">Email</label>
<input type="text" th:field="*{email}" class="form-control" id="email" placeholder="Email">
</div>
<div class="form-group col-md-8">
<label for="phoneNo" class="col-form-label">Phone No</label>
<input type="text" th:field="*{phoneNo}" class="form-control" id="phoneNo" placeholder="PhoneNo">
</div>
<div class="col-md-6">
<input type="submit" class="btn btn-primary" value="추가">
</div>
</form>
</div>
</body>
</html>
<td><a th:href="@{/delete/{id}(id=${student.id})}" class="btn btn-primary"><i class="fas fa-user-times ml-2">삭제</i></a></td>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
<title>학생명단 v1 | 전체 명단</title>
</head>
<body>
<div class="container my-2">
<div class="container my-5">
<p class="my-5">
<a href="#" class="btn btn-primary">
<i class="fas fa-user-plus ml-2">추가</i>
</a>
</p>
<div class="col-md-10">
<div>
<table class="table table-striped table-responsive-md">
<thead>
<tr>
<th>이름</th>
<th>이메일</th>
<th>전화번호</th>
<th>수정</th>
<th>삭제</th>
</tr>
</thead>
<tbody>
<tr>
<td>홍길동</td>
<td>홍길동@길동.com</td>
<td>010-1234-5678</td>
<td><a href="#" class="btn btn-primary"><i class="fas fa-user-edit ml-2">수정</i></a></td>
<td><a href="#" class="btn btn-primary"><i class="fas fa-user-times ml-2">삭제</i></a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
<title>학생명단 v1 | 전체 명단</title>
</head>
<body>
<div class="container my-2">
<div class="container my-5">
<p class="my-5">
<a href="/add" class="btn btn-primary">
<i class="fas fa-user-plus ml-2">추가</i>
</a>
</p>
<div class="col-md-10">
<div>
<table class="table table-striped table-responsive-md">
<thead>
<tr>
<th>이름</th>
<th>이메일</th>
<th>전화번호</th>
<th>수정</th>
<th>삭제</th>
</tr>
</thead>
<tbody>
<tr th:each="student : ${students}">
<td th:text="${student.name}"></td>
<td th:text="${student.email}"></td>
<td th:text="${student.phoneNo}"></td>
<td><a href="#" class="btn btn-primary"><i class="fas fa-user-edit ml-2">수정</i></a></td>
<td><a href="#" class="btn btn-primary"><i class="fas fa-user-times ml-2">삭제</i></a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>
<td><a th:href="@{/update/{id}(id=${student.id})}" class="btn btn-primary"><i class="fas fa-user-edit ml-2">수정</i></a></td>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
<title>학생명단 v1 | Update</title>
</head>
<body>
<div class="container">
<h3>Update Student</h3>
<form action="#" th:action="@{/update/{id}(id=${student.id})}" th:object="${student}" method="post">
<div class="form-group col-md-8">
<label for="name" class="col-form-label">Name</label>
<input type="text" th:field="*{name}" class="form-control" id="name" placeholder="Name">
</div>
<div class="form-group col-md-8">
<label for="email" class="col-form-label">Email</label>
<input type="text" th:field="*{email}" class="form-control" id="email" placeholder="Email">
</div>
<div class="form-group col-md-8">
<label for="phoneNo" class="col-form-label">Phone No</label>
<input type="text" th:field="*{phoneNo}" class="form-control" id="phoneNo" placeholder="PhoneNo">
</div>
<div class="col-md-6">
<input type="submit" class="btn btn-primary" value="수정">
</div>
</form>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment