-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from cmsong111/11-푸드트럭-기능-web
후기 작성 기능
- Loading branch information
Showing
11 changed files
with
187 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/main/java/ac/kr/deu/connect/luck/image/ImageRestController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
src/main/java/ac/kr/deu/connect/luck/image/ImageUrlResponse.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
src/main/java/ac/kr/deu/connect/luck/image/dto/ImageUrlResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package ac.kr.deu.connect.luck.image.dto | ||
|
||
data class ImageUrlResponse( | ||
val imageUrl: String | ||
) { | ||
override fun toString(): String { | ||
return "ImageUrlResponse(imageUrl='$imageUrl')" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/main/resources/templates/food_truck/manager/review_manage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!DOCTYPE html> | ||
<html lang="ko" layout:decorate="layout/default_layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"> | ||
<th:block layout:fragment="content"> | ||
<script th:inline="javascript"> | ||
|
||
// 삭제 버튼 클릭 시, 확인 후 URL 이동 | ||
function deleteReview(foodTruckId, reviewId) { | ||
if (confirm('정말 삭제하시겠습니까?')) { | ||
location.href = '/food-truck/' + foodTruckId + '/review/' + reviewId + '/delete'; | ||
} | ||
} | ||
|
||
|
||
</script> | ||
|
||
|
||
<h1 class="text-center">후기 관리</h1> | ||
|
||
<div class="container mt-5"> | ||
<div class="row"> | ||
<div class="col-md-4 mb-4" th:each="review : ${foodTruckDetailResponse.reviews()}"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<h5 class="card-title" th:text="${review.content()}"></h5> | ||
<p class="card-text"> | ||
<span>평점: </span> | ||
<span th:text="${review.rating()}"></span> | ||
<span>점</span> | ||
</p> | ||
<p class="card-text"> | ||
<span>작성자: </span> | ||
<span th:text="${review.authorName()}"></span> | ||
</p> | ||
<p class="card-text"> | ||
<span>작성일: </span> | ||
<span th:text="${review.createdAt()}"></span> | ||
</p> | ||
<p class="card-text"> | ||
<span>답장: </span> | ||
<span th:text="${review.reply()}"></span> | ||
</p> | ||
<button class="btn btn-primary" | ||
th:onclick="|location.href='/food-truck/' + ${foodTruckDetailResponse.id()} + '/review/' + ${review.id} + '/reply'|" | ||
type="button"> | ||
답장 | ||
</button> | ||
|
||
<button class="btn btn-danger" th:onclick="|deleteReview(${foodTruckDetailResponse.id()}, ${review.id})|" | ||
type="button"> | ||
삭제 | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</th:block> | ||
</html> |
15 changes: 15 additions & 0 deletions
15
src/main/resources/templates/food_truck/manager/review_reply_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="ko" layout:decorate="layout/default_layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"> | ||
<th:block layout:fragment="content"> | ||
<div class="container mt-5"> | ||
<h1 class="text-center">후기 답변</h1> | ||
<form method="post" th:action="|/food-truck/${foodTruckId}/review/${reviewId}/reply|"> | ||
<div class="form-group mt-3"> | ||
<label for="content">내용:</label> | ||
<textarea class="form-control" id="content" name="content" required th:text="${review.getReply()}"></textarea> | ||
</div> | ||
<button class="btn btn-primary" type="submit">등록</button> | ||
</form> | ||
</div> | ||
</th:block> | ||
</html> |
20 changes: 20 additions & 0 deletions
20
src/main/resources/templates/food_truck/review_edit_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="ko" layout:decorate="layout/default_layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"> | ||
<th:block layout:fragment="content"> | ||
|
||
<div class="container mt-5"> | ||
<h1>리뷰 수정</h1> | ||
<form th:action="@{'/food-truck/' + ${id} + '/review/' + ${reviewId} + '/edit'}" method="post" th:object="${review}"> | ||
<div class="form-group"> | ||
<label for="content">내용</label> | ||
<textarea class="form-control" id="content" name="content" rows="3" th:text="${review.content}"></textarea> | ||
</div> | ||
<div class="form-group"> | ||
<label for="rating">평점</label> | ||
<input type="number" class="form-control" id="rating" name="rating" th:value="${review.rating}"> | ||
</div> | ||
<button type="submit" class="btn btn-primary">수정</button> | ||
</form> | ||
</div> | ||
</th:block> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters