Commit 7643a8c4 authored by issei.miyajima's avatar issei.miyajima

一覧画面、vie、controllerw修正

parent d6af580c
...@@ -75,7 +75,7 @@ public class EcsiteController { ...@@ -75,7 +75,7 @@ public class EcsiteController {
//一覧画面遷移(靴の情報と画像を一緒にmodelにあげることが出来ない為、分けてある) //一覧画面遷移(靴の情報と画像を一緒にmodelにあげることが出来ない為、分けてある)
@GetMapping("list") @GetMapping("list")
public String list(Model model) { public String list(Model model, @AuthenticationPrincipal LoginUser userDetails) {
//靴の情報をすべて取得 //靴の情報をすべて取得
List<Shoes> shoes = shoesService.findAll(); List<Shoes> shoes = shoesService.findAll();
//靴の情報を一括で取得するmodel(Idでの降順表示設定済み) //靴の情報を一括で取得するmodel(Idでの降順表示設定済み)
...@@ -87,6 +87,10 @@ public class EcsiteController { ...@@ -87,6 +87,10 @@ public class EcsiteController {
} }
//靴の処理した画像を一括で取得する //靴の処理した画像を一括で取得する
model.addAttribute("shoesPhoto", shoesPhoto); model.addAttribute("shoesPhoto", shoesPhoto);
//user情報取得、格納
User user = userDetails.getUser();
model.addAttribute("user", user);
//遷移先 未設定 //遷移先 未設定
return "list"; return "list";
} }
......
<!DOCTYPE html> <!DOCTYPE html>
<html class="no-js" lang="ja"> <html class="no-js" lang="ja" xmlns:th="http://www.thymeleaf.org">
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
...@@ -7,9 +7,8 @@ ...@@ -7,9 +7,8 @@
<meta name="description" content=""/> <meta name="description" content=""/>
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="icon" href="images/favicon.png"/> <link rel="icon" href="images/favicon.png"/>
<link rel="stylesheet" href="css/style.css"/> <link rel="stylesheet" href="css/style.css" th:href="@{/css/style.css}"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css"
integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
...@@ -21,7 +20,7 @@ ...@@ -21,7 +20,7 @@
<div id="modal-content"> <div id="modal-content">
<div id="modal-content-innar"> <div id="modal-content-innar">
<!-- モーダルウィンドウのコンテンツ開始 --> <!-- モーダルウィンドウのコンテンツ開始 -->
<img class="shoeImage" alt="productImage"> <img class="shoeImage" alt="productImage"/>
<div id="showName"></div> <div id="showName"></div>
<div id="showPrice"></div> <div id="showPrice"></div>
...@@ -81,7 +80,7 @@ ...@@ -81,7 +80,7 @@
<div class="col-md-12"> <div class="col-md-12">
<form class="form-inline col-md-12 wow fadeInDown animated"> <form class="form-inline col-md-12 wow fadeInDown animated">
<div class="form-group"> <div class="form-group">
<input type="email" class="form-control subscribe" id="email" placeholder="Search..."> <input type="email" class="form-control subscribe" id="email" placeholder="Search..."/>
<button class="suscribe-btn" ><i class="pe-7s-search"></i></button> <button class="suscribe-btn" ><i class="pe-7s-search"></i></button>
</div> </div>
</form><!-- end /. form --> </form><!-- end /. form -->
...@@ -93,12 +92,18 @@ ...@@ -93,12 +92,18 @@
<div id="listBox"> <div id="listBox">
<!--each分でくりかえす(宮嶋)--> <!--each分でくりかえす(宮嶋)-->
<div class="productBox" th:each="shoe : ${shoes}"> <div class="productBox" th:each="shoe : ${shoes}">
<img class="shoeImage" src="images/スニーカー3.jpg" alt="productImage"> <img class="shoeImage" src="images/スニーカー3.jpg" alt="productImage"/>
<a text = ${shoe.name} class="shoeName">AirMAX</a> <a th:text= "${shoe.name}" class="shoeName">AirMAX</a>
<a text = ${shoe.price} class="shoePrice">¥10,000</a> <a th:text = "${shoe.price}" class="shoePrice">¥10,000</a>
<button type="button" id="modal-open" class="button-link">詳細</button> <button type="button" id="modal-open" class="button-link">詳細</button>
</div> </div>
<!--デモ用のダミー--> <!--デモ用のダミー-->
<div class="productBox" >
<img class="shoeImage" src="images/スニーカー3.jpg" alt="productImage"/>
<a class="shoeName">AirMAX</a>
<a class="shoePrice">¥10,000</a>
<button type="button" id="modal-open" class="button-link">詳細</button>
</div>
<div class="productBox">box</div> <div class="productBox">box</div>
<div class="productBox">box</div> <div class="productBox">box</div>
<div class="productBox">box</div> <div class="productBox">box</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment