Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
Ecsite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shoei.kanno
Ecsite
Commits
fbc1c5af
Commit
fbc1c5af
authored
Oct 20, 2020
by
issei.miyajima
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理機能(商品新規登録、編集、削除)
parent
fa37214b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
225 additions
and
150 deletions
+225
-150
ShoesService.java
src/main/java/com/example/service/ShoesService.java
+5
-1
EcsiteController.java
src/main/java/com/example/web/EcsiteController.java
+1
-1
ManagementController.java
src/main/java/com/example/web/ManagementController.java
+95
-55
ShoesForm.java
src/main/java/com/example/web/ShoesForm.java
+2
-1
management.js
src/main/resources/static/js/management.js
+2
-2
スニーカー3.jpg
src/main/resources/static/upload/スニーカー3.jpg
+0
-0
スニーカー3.jpg.jpg
src/main/resources/static/upload/スニーカー3.jpg.jpg
+0
-0
management.html
src/main/resources/templates/management.html
+72
-50
shoeEdit.html
src/main/resources/templates/shoeEdit.html
+48
-40
No files found.
src/main/java/com/example/service/ShoesService.java
View file @
fbc1c5af
...
@@ -18,7 +18,7 @@ public class ShoesService {
...
@@ -18,7 +18,7 @@ public class ShoesService {
public
List
<
Shoes
>
findAll
(){
public
List
<
Shoes
>
findAll
(){
List
<
Shoes
>
list
=
shoesRepository
.
findAll
();
List
<
Shoes
>
list
=
shoesRepository
.
findAll
();
//並べ替え処理
//並べ替え処理
Collections
.
sort
(
list
,
Collections
.
reverseOrder
());
//
Collections.sort(list, Collections.reverseOrder());
//並べ替えたものを返す。
//並べ替えたものを返す。
return
list
;
return
list
;
}
}
...
@@ -34,4 +34,8 @@ public class ShoesService {
...
@@ -34,4 +34,8 @@ public class ShoesService {
public
Shoes
update
(
Shoes
shoes
){
public
Shoes
update
(
Shoes
shoes
){
return
shoesRepository
.
save
(
shoes
);
return
shoesRepository
.
save
(
shoes
);
}
}
public
void
delete
(
Integer
id
){
shoesRepository
.
delete
(
id
);
}
}
}
src/main/java/com/example/web/EcsiteController.java
View file @
fbc1c5af
...
@@ -27,7 +27,7 @@ public class EcsiteController {
...
@@ -27,7 +27,7 @@ public class EcsiteController {
@Autowired
@Autowired
ShoesService
shoesService
;
ShoesService
shoesService
;
@Autowired
@Autowired
SalesLogService
salesLogService
;
SalesLogService
salesLogService
;
//写真の表示用メソッド
//写真の表示用メソッド
...
...
src/main/java/com/example/web/ManagementController.java
View file @
fbc1c5af
...
@@ -15,13 +15,17 @@ import javax.imageio.ImageWriter;
...
@@ -15,13 +15,17 @@ import javax.imageio.ImageWriter;
import
javax.imageio.plugins.jpeg.JPEGImageWriteParam
;
import
javax.imageio.plugins.jpeg.JPEGImageWriteParam
;
import
javax.imageio.stream.ImageOutputStream
;
import
javax.imageio.stream.ImageOutputStream
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
@@ -32,7 +36,7 @@ import com.example.service.ShoesService;
...
@@ -32,7 +36,7 @@ import com.example.service.ShoesService;
//管理画面用
//管理画面用
@Controller
@Controller
@RequestMapping
(
"limited/admin/management
/
"
)
@RequestMapping
(
"limited/admin/management"
)
public
class
ManagementController
{
public
class
ManagementController
{
@Autowired
@Autowired
ShoesService
shoesService
;
ShoesService
shoesService
;
...
@@ -41,71 +45,107 @@ public class ManagementController {
...
@@ -41,71 +45,107 @@ public class ManagementController {
//管理画面表示(靴もユーザ情報も一覧で取得できるようになっている)
//管理画面表示(靴もユーザ情報も一覧で取得できるようになっている)
@GetMapping
()
@GetMapping
()
public
String
management
(
Model
model
)
{
public
String
management
(
Model
model
,
@Validated
ShoesForm
form
,
BindingResult
result
,
MultipartFile
multipartFile
)
{
List
<
Shoes
>
shoes
=
shoesService
.
findAll
();
List
<
Shoes
>
shoes
=
shoesService
.
findAll
();
model
.
addAttribute
(
"shoes"
,
shoes
);
model
.
addAttribute
(
"shoes"
,
shoes
);
List
<
User
>
user
=
loginUserDetailsService
.
findAll
();
List
<
User
>
user
=
loginUserDetailsService
.
findAll
();
model
.
addAttribute
(
"user"
,
user
);
model
.
addAttribute
(
"user"
,
user
);
//遷移先 未設定
return
"management"
;
return
"Hello World"
;
}
}
//靴の登録処理
//靴の登録処理
@PostMapping
(
"addShoes"
)
@PostMapping
(
"addShoes"
)
public
String
CreateShoes
(
@Validated
ShoesForm
form
,
BindingResult
result
,
MultipartFile
multipartFile
)
throws
Exception
{
public
String
CreateShoes
(
@Validated
ShoesForm
form
,
BindingResult
result
,
MultipartFile
multipartFile
)
throws
Exception
{
if
(
result
.
hasErrors
())
{
System
.
out
.
println
(
"1"
);
return
"management"
;
if
(
result
.
hasErrors
())
{
}
System
.
out
.
println
(
"2"
);
multipartFile
=
form
.
getMultipartFile
();
return
"management"
;
Shoes
shoes
=
new
Shoes
();
}
if
(!
multipartFile
.
isEmpty
())
{
System
.
out
.
println
(
"3"
);
try
{
multipartFile
=
form
.
getMultipartFile
();
// ファイル名をリネイム
Shoes
shoes
=
new
Shoes
();
File
oldFileName
=
new
File
(
multipartFile
.
getOriginalFilename
());
if
(!
multipartFile
.
isEmpty
())
{
File
newFileName
=
new
File
(
oldFileName
+
".jpg"
);
try
{
oldFileName
.
renameTo
(
newFileName
);
// ファイル名をリネイム
File
oldFileName
=
new
File
(
multipartFile
.
getOriginalFilename
());
//File newFileName = new File(oldFileName + ".jpg");
//oldFileName.renameTo(newFileName);
// 保存先を定義
// 保存先を定義
String
uploadPath
=
"src/main/resources/static/upload/"
;
String
uploadPath
=
"src/main/resources/static/upload/"
;
byte
[]
bytes
=
multipartFile
.
getBytes
();
byte
[]
bytes
=
multipartFile
.
getBytes
();
// 指定ファイルへ読み込みファイルを書き込み
// 指定ファイルへ読み込みファイルを書き込み
BufferedOutputStream
stream
=
new
BufferedOutputStream
(
BufferedOutputStream
stream
=
new
BufferedOutputStream
(
new
FileOutputStream
(
new
File
(
uploadPath
+
newFileName
)));
new
FileOutputStream
(
new
File
(
uploadPath
+
oldFileName
)));
stream
.
write
(
bytes
);
// BufferedOutputStream stream = new BufferedOutputStream(
stream
.
close
();
// new FileOutputStream(new File(uploadPath + newFileName)));
stream
.
write
(
bytes
);
stream
.
close
();
// 圧縮
// 圧縮
File
input
=
new
File
(
uploadPath
+
newFileName
);
//File input = new File(uploadPath + newFileName);
BufferedImage
image
=
ImageIO
.
read
(
input
);
File
input
=
new
File
(
uploadPath
+
oldFileName
);
OutputStream
os
=
new
FileOutputStream
(
input
);
BufferedImage
image
=
ImageIO
.
read
(
input
);
Iterator
<
ImageWriter
>
writers
=
ImageIO
OutputStream
os
=
new
FileOutputStream
(
input
);
.
getImageWritersByFormatName
(
"jpg"
);
Iterator
<
ImageWriter
>
writers
=
ImageIO
ImageWriter
writer
=
(
ImageWriter
)
writers
.
next
();
.
getImageWritersByFormatName
(
"jpg"
);
ImageOutputStream
ios
=
ImageIO
.
createImageOutputStream
(
os
);
ImageWriter
writer
=
(
ImageWriter
)
writers
.
next
();
writer
.
setOutput
(
ios
);
ImageOutputStream
ios
=
ImageIO
.
createImageOutputStream
(
os
);
ImageWriteParam
param
=
new
JPEGImageWriteParam
(
null
);
writer
.
setOutput
(
ios
);
param
.
setCompressionMode
(
ImageWriteParam
.
MODE_EXPLICIT
);
ImageWriteParam
param
=
new
JPEGImageWriteParam
(
null
);
param
.
setCompressionQuality
(
0.30f
);
param
.
setCompressionMode
(
ImageWriteParam
.
MODE_EXPLICIT
);
writer
.
write
(
null
,
new
IIOImage
(
image
,
null
,
null
),
param
);
param
.
setCompressionQuality
(
0.30f
);
os
.
close
();
writer
.
write
(
null
,
new
IIOImage
(
image
,
null
,
null
),
param
);
ios
.
close
();
os
.
close
();
writer
.
dispose
();
ios
.
close
();
writer
.
dispose
();
// shoes entity に写真の名前を格納する
// shoes entity に写真の名前を格納する
shoes
.
setPhoto
(
newFileName
.
toString
());
//shoes.setPhoto(newFileName.toString());
shoes
.
setPhoto
(
oldFileName
.
toString
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
System
.
out
.
println
(
e
);
}
}
}
shoes
.
setName
(
form
.
getName
());
shoes
.
setPrice
(
form
.
getPrice
());
shoes
.
setStock
(
form
.
getStock
());
shoes
.
setSize
(
form
.
getSize
());
shoes
.
setProductStatus
(
form
.
getProduct_status
());
shoesService
.
update
(
shoes
);
//遷移先 未設定
return
"Hello World"
;
}
}
shoes
.
setName
(
form
.
getName
());
shoes
.
setPrice
(
form
.
getPrice
());
shoes
.
setStock
(
form
.
getStock
());
shoes
.
setSize
(
form
.
getSize
());
shoes
.
setProductStatus
(
form
.
getProductStatus
());
shoesService
.
update
(
shoes
);
//遷移先
return
"redirect:/limited/admin/management"
;
}
//商品編集画面
@GetMapping
(
path
=
"{id}/edit"
)
String
editForm
(
@PathVariable
Integer
id
,
ShoesForm
form
,
Model
model
){
Shoes
shoes
=
shoesService
.
findOne
(
id
);
model
.
addAttribute
(
"shoes"
,
shoes
);
BeanUtils
.
copyProperties
(
shoes
,
form
);
return
"shoeEdit"
;
}
//商品編集機能
@PostMapping
(
path
=
"{id}/edit"
)
String
edit
(
@PathVariable
Integer
id
,
@Validated
ShoesForm
form
,
BindingResult
result
,
Model
model
)
{
if
(
result
.
hasErrors
())
{
return
editForm
(
id
,
form
,
model
);
}
Shoes
shoes
=
new
Shoes
();
BeanUtils
.
copyProperties
(
form
,
shoes
);
shoes
.
setId
(
id
);
shoesService
.
update
(
shoes
);
return
"redirect:/limited/admin/management"
;
}
//商品削除
@DeleteMapping
(
path
=
"{id}"
)
String
delete
(
@PathVariable
Integer
id
)
{
shoesService
.
delete
(
id
);
return
"redirect:/limited/admin/management"
;
}
}
}
src/main/java/com/example/web/ShoesForm.java
View file @
fbc1c5af
...
@@ -7,10 +7,11 @@ import lombok.Setter;
...
@@ -7,10 +7,11 @@ import lombok.Setter;
@Getter
@Getter
@Setter
@Setter
public
class
ShoesForm
{
public
class
ShoesForm
{
private
Integer
id
;
private
String
name
;
private
String
name
;
private
Integer
price
;
private
Integer
price
;
private
Integer
stock
;
private
Integer
stock
;
private
Integer
size
;
private
Integer
size
;
private
Integer
product
_s
tatus
;
private
Integer
product
S
tatus
;
private
MultipartFile
multipartFile
;
private
MultipartFile
multipartFile
;
}
}
src/main/resources/static/js/management.js
View file @
fbc1c5af
$
(
'#
shoe
_management'
).
hide
();
$
(
'#
user
_management'
).
hide
();
//ユーザー管理
//ユーザー管理
...
@@ -23,7 +23,7 @@ $('#shoe_button').on('click', function(){
...
@@ -23,7 +23,7 @@ $('#shoe_button').on('click', function(){
})
})
//商品削除確認アラート
//商品削除確認アラート
$
(
'
#
shoeDeleteBtn'
).
on
(
'click'
,
function
(){
$
(
'
.
shoeDeleteBtn'
).
on
(
'click'
,
function
(){
if
(
!
confirm
(
'本当に商品情報を削除しますか?'
))
{
if
(
!
confirm
(
'本当に商品情報を削除しますか?'
))
{
return
false
;
return
false
;
}
else
{
}
else
{
...
...
src/main/resources/static/upload/スニーカー3.jpg
0 → 100644
View file @
fbc1c5af
4.93 KB
src/main/resources/static/upload/スニーカー3.jpg.jpg
0 → 100644
View file @
fbc1c5af
4.93 KB
src/main/resources/templates/management.html
View file @
fbc1c5af
<!doctype html>
<!doctype html>
<html
class=
"no-js"
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
class=
"no-js"
lang=
"en"
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"
/
>
<title>
Limited
</title>
<title>
Limited
</title>
<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}"
/
>
<!--[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>
<script>window.html5 || document.write('<script src="js/vendor/html5shiv.js"><\/script>')</script>
<script>window.html5 || document.write('<script src="js/vendor/html5shiv.js"><\/script>')</script>
<![endif]-->
<![endif]-->
</head>
</head>
<body>
<body>
<div
id=
"management_wrapper"
>
<div
id=
"management_wrapper"
>
<div
id=
"sidebar"
>
<div
id=
"sidebar"
>
<div
class=
"sidebar_title"
><
button
th:href=
"http://localhost:8080/limited"
>
TOPへ戻る
</button
></div>
<div
class=
"sidebar_title"
><
a
th:href=
"@{http://localhost:8080/limited/top}"
>
TOPへ戻る
</a
></div>
<div
class=
"sidebar_title"
><button
id=
"user_button"
type=
"button"
>
ユーザー管理
</button></div>
<div
class=
"sidebar_title"
><button
id=
"user_button"
type=
"button"
>
ユーザー管理
</button></div>
<div
class=
"sidebar_title"
><button
id=
"shoe_button"
type=
"button"
>
商品管理
</button></div>
<div
class=
"sidebar_title"
><button
id=
"shoe_button"
type=
"button"
>
商品管理
</button></div>
</div>
</div>
...
@@ -56,36 +55,57 @@
...
@@ -56,36 +55,57 @@
</div>
</div>
<!-- 新規登録フォーム -->
<!-- 新規登録フォーム -->
<div
id=
"newShoesFormTitle"
>
商品新規登録
</div>
<div
id=
"newShoesFormTitle"
>
商品新規登録
</div>
<form
id=
"newShoesForm"
>
<form
id=
"newShoesForm"
th:action=
"@{/limited/admin/management/addShoes}"
th:object=
"${shoesForm}"
method=
"post"
enctype=
"multipart/form-data"
>
<span>
商品名:
<input
type=
"text"
name=
"name"
placeholder=
"name"
/></span>
<span
for=
"name"
>
商品名:
<span>
価格:
<input
type=
"text"
name=
"price"
placeholder=
"price"
/></span>
<input
type=
"text"
id=
"name"
name=
"name"
placeholder=
"name"
th:field=
"*{name}"
th:errorclass=
"error-input"
/>
<!-- <span>在庫数:<select name="stock">
</span>
<option value="1">1</option>
<span
th:if=
"${#fields.hasErrors('name')}"
th:errors=
"*{name}"
class=
"error-messages"
>
error!
</span>
<option value="2">2</option>
<option value="3">3</option>
<span
for=
"price"
>
価格:
<option value="4">4</option>
<input
type=
"text"
id=
"price"
name=
"price"
placeholder=
"price"
th:field=
"*{price}"
th:errorclass=
"error-input"
/>
<option value="5">5</option>
</span>
<option value="6">6</option>
<span
th:if=
"${#fields.hasErrors('price')}"
th:errors=
"*{price}"
class=
"error-messages"
>
error!
</span>
<option value="7">7</option>
<option value="8">8</option>
<span>
在庫数:
<option value="9">9</option>
<select
id=
"stock"
name=
"stock"
th:field=
"*{stock}"
th:errorclass=
"error-input"
>
<option value="10">10</option>
<option
value=
"1"
>
1
</option>
</select></span> -->
<option
value=
"2"
>
2
</option>
<span>
在庫数:
<input
type=
"number"
name=
"stock"
/></span>
<option
value=
"3"
>
3
</option>
<span>
サイズ:
<select
name=
"size_id"
>
<option
value=
"4"
>
4
</option>
<option
value=
"1"
>
24
</option>
<option
value=
"5"
>
5
</option>
<option
value=
"2"
>
24.5
</option>
<option
value=
"6"
>
6
</option>
<option
value=
"3"
>
25
</option>
<option
value=
"7"
>
7
</option>
<option
value=
"4"
>
25.5
</option>
<option
value=
"8"
>
8
</option>
<option
value=
"5"
>
26
</option>
<option
value=
"9"
>
9
</option>
<option
value=
"6"
>
26.5
</option>
<option
value=
"10"
>
10
</option>
<option
value=
"7"
>
27
</option>
</select>
<option
value=
"8"
>
27.5
</option>
</span>
<option
value=
"9"
>
28
</option>
<span
th:if=
"${#fields.hasErrors('stock')}"
th:errors=
"*{stock}"
class=
"error-messages"
>
error!
</span>
<option
value=
"10"
>
28.5
</option>
<!-- <span>在庫数:<input type="number" name="stock"/></span> -->
</select></span>
<span>
サイズ:
<div>
商品画像
<input
type=
"file"
name=
"photo"
></div>
<select
id=
"size"
name=
"size"
th:field=
"*{size}"
th:errorclass=
"error-input"
>
<button
type=
"button"
id=
"newShoesFormBtn"
>
登録確定
</button>
<option
value=
"23"
>
23
</option>
<option
value=
"24"
>
24
</option>
<option
value=
"25"
>
25
</option>
<option
value=
"26"
>
26
</option>
<option
value=
"27"
>
27
</option>
<option
value=
"28"
>
28
</option>
<option
value=
"29"
>
29
</option>
<option
value=
"30"
>
30
</option>
</select>
</span>
<span
th:if=
"${#fields.hasErrors('size')}"
th:errors=
"*{size}"
class=
"error-messages"
>
error!
</span>
<span>
公開範囲:
<select
id=
"productStatus"
name=
"productStatus"
th:field=
"*{productStatus}"
>
<option
value=
"0"
>
通常公開
</option>
<option
value=
"1"
>
限定公開
</option>
</select>
</span>
<span
th:if=
"${#fields.hasErrors('productStatus')}"
th:errors=
"*{produntStatus}"
class=
"error-messages"
>
error!
</span>
<div>
商品画像
<input
type=
"file"
name=
"photo"
th:field=
"*{multipartFile}"
th:errorclass=
"error-input"
/></div>
<span
th:if=
"${#fields.hasErrors('multipartFile')}"
th:errors=
"*{multipartFile}"
class=
"error-messages"
>
error!
</span>
<input
type=
"submit"
id=
"newShoesFormBtn"
value=
"新規登録"
/>
</form>
</form>
<!-- 在庫一覧 eachで繰り返し -->
<!-- 在庫一覧 eachで繰り返し -->
...
@@ -101,23 +121,25 @@
...
@@ -101,23 +121,25 @@
<th>
編集
</th>
<th>
編集
</th>
<th>
削除
</th>
<th>
削除
</th>
</tr>
</tr>
<tr
th:each=
""
>
<tr
th:each=
"
shoe : ${shoes}
"
>
<td
th:text=
""
>
1
</td>
<td
th:text=
"
${shoe.id}
"
>
1
</td>
<td
th:text=
""
>
AirMax
</td>
<td
th:text=
"
${shoe.name}
"
>
AirMax
</td>
<td
th:text=
""
>
¥10,000
</td>
<td
th:text=
"
${shoe.price}
"
>
¥10,000
</td>
<td
th:text=
""
>
10
</td>
<td
th:text=
"
${shoe.stock}
"
>
10
</td>
<td></td>
<td></td>
<td>
<td>
<form
th:action=
"@{/shoes/edit}"
method=
"get"
>
<
!-- <
form th:action="@{/shoes/edit}" method="get">
<input type="submit" name="form" value="編集"/>
<input type="submit" name="form" value="編集"/>
<input
type=
"hidden"
name=
"id"
th:value=
""
/>
<input type="hidden" name="id" th:value="${shoe.id}"/>
</form>
</form>-->
<a
th:href=
"@{/limited/admin/management/{id}/edit(id=${shoe.id})}"
class=
"btn btn-primary"
>
編集
</a>
</td>
</td>
<td>
<td>
<form
th:action=
"@{/
shoes/delete}"
method=
"post
"
>
<form
th:action=
"@{/
limited/admin/management//{id}(id=${shoe.id})}"
th:method=
"delete
"
>
<input
type=
"
button"
name=
"form"
value=
"削除"
id
=
"shoeDeleteBtn"
/>
<input
type=
"
submit"
name=
"form"
value=
"削除"
class
=
"shoeDeleteBtn"
/>
<input
type=
"hidden"
name=
"id"
th:value=
""
/>
<input
type=
"hidden"
name=
"id"
th:value=
"
${shoe.id}
"
/>
</form>
</form>
</td>
</td>
</tr>
</tr>
</table>
</table>
...
@@ -132,6 +154,6 @@
...
@@ -132,6 +154,6 @@
<script src="js/owl.carousel.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/wow.min.js"></script>
<script src="js/wow.min.js"></script>
<script src="js/custom.js"></script> -->
<script src="js/custom.js"></script> -->
<script
type=
"text/javascript"
src=
"js/management.js"
></script>
<script
type=
"text/javascript"
src=
"js/management.js"
th:src=
"@{/js/management.js}"
></script>
</body>
</body>
</html>
</html>
src/main/resources/templates/shoeEdit.html
View file @
fbc1c5af
<!doctype html>
<!doctype html>
<html
class=
"no-js"
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
class=
"no-js"
lang=
"en"
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"
/
>
<title>
Limited
</title>
<title>
Limited
</title>
<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}"
/
>
<!--[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>
...
@@ -18,9 +18,9 @@
...
@@ -18,9 +18,9 @@
<body>
<body>
<div
id=
"management_wrapper"
>
<div
id=
"management_wrapper"
>
<div
id=
"sidebar"
>
<div
id=
"sidebar"
>
<div
class=
"sidebar_title"
><
button
th:href=
"http://localhost:8080/limited"
>
TOPへ戻る
</button
></div>
<div
class=
"sidebar_title"
><
a
th:href=
"@{http://localhost:8080/limited/top}"
>
TOPへ戻る
</a
></div>
<div
class=
"sidebar_title"
><
button
id=
"shoe_button"
type=
"button"
th:href=
"http://localhost:8080/limited/admin/management"
>
管理画面へ戻る
</button
></div>
<div
class=
"sidebar_title"
><
a
id=
"shoe_button"
type=
"button"
th:href=
"@{http://localhost:8080/limited/admin/management}"
>
管理画面へ戻る
</a
></div>
</div>
</div>
<div
id=
"mainbody"
>
<div
id=
"mainbody"
>
...
@@ -32,37 +32,45 @@
...
@@ -32,37 +32,45 @@
</div>
</div>
<!-- 在庫一覧 eachで繰り返し -->
<!-- 在庫一覧 eachで繰り返し -->
<div
id=
"shoesListTitle"
>
商品情報編集
</div>
<div
id=
"shoesListTitle"
>
商品情報編集
</div>
<form
id=
"ShoesEditForm"
th:action=
""
th:object=
""
method=
"post"
>
<form
id=
"ShoesEditForm"
th:action=
"@{/limited/admin/management/{id}/edit(id=${shoes.id})}"
th:object=
"${shoesForm}"
method=
"post"
>
<span>
ID:
<div
name=
"id"
th:text=
""
></div></span>
<span>
ID:
<div
name=
"id"
th:field=
"${shoes.id}"
></div></span>
<span>
商品名:
<input
type=
"text"
name=
"name"
th:field=
""
/></span>
<span>
商品名:
<input
type=
"text"
name=
"name"
th:field=
"${shoes.name}"
/></span>
<span>
価格:
<input
type=
"text"
name=
"price"
th:field=
""
/></span>
<span>
価格:
<input
type=
"text"
name=
"price"
th:field=
"${shoes.price}"
/></span>
<!-- <span>在庫数:<select name="stock">
<span>
在庫数:
<option value="1">1</option>
<select
id=
"stock"
name=
"stock"
th:field=
"${shoes.stock}"
th:errorclass=
"error-input"
>
<option value="2">2</option>
<option
value=
"1"
>
1
</option>
<option value="3">3</option>
<option
value=
"2"
>
2
</option>
<option value="4">4</option>
<option
value=
"3"
>
3
</option>
<option value="5">5</option>
<option
value=
"4"
>
4
</option>
<option value="6">6</option>
<option
value=
"5"
>
5
</option>
<option value="7">7</option>
<option
value=
"6"
>
6
</option>
<option value="8">8</option>
<option
value=
"7"
>
7
</option>
<option value="9">9</option>
<option
value=
"8"
>
8
</option>
<option value="10">10</option>
<option
value=
"9"
>
9
</option>
</select></span> -->
<option
value=
"10"
>
10
</option>
<span>
在庫数:
<input
type=
"number"
name=
"stock"
th:field=
""
/></span>
</select>
<span>
サイズ:
<select
name=
"size_id"
th:field=
""
>
</span>
<option
value=
"1"
>
24
</option>
<span>
サイズ:
<option
value=
"2"
>
24.5
</option>
<select
id=
"size"
name=
"size"
th:field=
"${shoes.size}"
th:errorclass=
"error-input"
>
<option
value=
"3"
>
25
</option>
<option
value=
"23"
>
23
</option>
<option
value=
"4"
>
25.5
</option>
<option
value=
"24"
>
24
</option>
<option
value=
"5"
>
26
</option>
<option
value=
"25"
>
25
</option>
<option
value=
"6"
>
26.5
</option>
<option
value=
"26"
>
26
</option>
<option
value=
"7"
>
27
</option>
<option
value=
"27"
>
27
</option>
<option
value=
"8"
>
27.5
</option>
<option
value=
"28"
>
28
</option>
<option
value=
"9"
>
28
</option>
<option
value=
"29"
>
29
</option>
<option
value=
"10"
>
28.5
</option>
<option
value=
"30"
>
30
</option>
</select></span>
</select>
<div>
商品画像
<input
type=
"file"
name=
"photo"
th:field=
""
></div>
</span>
<button
type=
"button"
id=
"ShoesEditBtn"
>
変更確定
</button>
<span>
公開範囲:
<select
id=
"product_status"
name=
"product_status"
th:field=
"${shoes.productStatus}"
>
<option
value=
"0"
>
通常公開
</option>
<option
value=
"1"
>
限定公開
</option>
</select>
</span>
<div>
商品画像
<input
type=
"file"
name=
"photo"
/></div>
<button
type=
"submit"
id=
"ShoesEditBtn"
>
変更確定
</button>
</form>
</form>
</div>
</div>
...
@@ -74,6 +82,6 @@
...
@@ -74,6 +82,6 @@
<script src="js/owl.carousel.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/wow.min.js"></script>
<script src="js/wow.min.js"></script>
<script src="js/custom.js"></script> -->
<script src="js/custom.js"></script> -->
<script
type=
"text/javascript"
src=
"js/showEdit.js"
></script>
</body>
</body>
</html>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment