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
c423ab94
Commit
c423ab94
authored
Oct 19, 2020
by
shoei.kanno
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '商品一覧画面ルーティング' into 'master'
一覧画面モーダルの実装まで完了 See merge request
!32
parents
fa37214b
55ab7aee
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
29 deletions
+70
-29
ShoesService.java
src/main/java/com/example/service/ShoesService.java
+6
-5
style.css
src/main/resources/static/css/style.css
+13
-0
list.js
src/main/resources/static/js/list.js
+38
-4
スニーカー1.jpg
src/main/resources/static/upload/スニーカー1.jpg
+0
-0
スニーカー2.jpg
src/main/resources/static/upload/スニーカー2.jpg
+0
-0
スニーカー3.jpg
src/main/resources/static/upload/スニーカー3.jpg
+0
-0
list.html
src/main/resources/templates/list.html
+13
-20
No files found.
src/main/java/com/example/service/ShoesService.java
View file @
c423ab94
...
...
@@ -16,11 +16,12 @@ public class ShoesService {
ShoesRepository
shoesRepository
;
public
List
<
Shoes
>
findAll
(){
List
<
Shoes
>
list
=
shoesRepository
.
findAll
();
//並べ替え処理
Collections
.
sort
(
list
,
Collections
.
reverseOrder
());
//並べ替えたものを返す。
return
list
;
// List<Shoes> list = shoesRepository. findAll();
// //並べ替え処理
// Collections.sort(list, Collections.reverseOrder());
// //並べ替えたものを返す。
// return list;
return
shoesRepository
.
findAll
();
}
public
Shoes
findOne
(
Integer
id
){
...
...
src/main/resources/static/css/style.css
View file @
c423ab94
...
...
@@ -1932,3 +1932,15 @@ th, td {
cursor
:
pointer
;
color
:
#f00
;
}
.details
{
width
:
150px
;
height
:
50px
;
margin
:
50px
0
;
font-weight
:
bold
;
font-size
:
small
;
background-color
:
#1abc9c
;
border-radius
:
3px
;
border
:
none
;
color
:
#000
;
}
\ No newline at end of file
src/main/resources/static/js/list.js
View file @
c423ab94
$
(
function
(){
$
(
"#modal-open"
).
click
(
function
(
event
){
$
(
".details"
).
each
(
function
()
{
$
(
".details"
).
click
(
function
(
event
){
$
(
'#showName'
).
empty
();
$
(
'#showPrice'
).
empty
();
$
(
'#showId'
).
empty
();
//以下デモ参照
//キーボード操作などにより、オーバーレイが多重起動するのを防止する
// $( this ).blur() ; //ボタンからフォーカスを外す
...
...
@@ -20,14 +23,19 @@ $(function(){
//一覧画面から情報取得
let
nameField
=
document
.
createElement
(
"a"
);
let
priceField
=
document
.
createElement
(
"a"
);
let
nameField
=
document
.
createElement
(
"p"
);
let
priceField
=
document
.
createElement
(
"p"
);
let
idField
=
document
.
createElement
(
"input"
);
idField
.
setAttribute
(
"type"
,
"hidden"
);
let
name
=
$
(
event
.
target
.
parentNode
.
children
[
1
].
textContent
);
let
price
=
$
(
event
.
target
.
parentNode
.
children
[
2
].
textContent
);
let
id
=
$
(
event
.
target
.
parentNode
.
children
[
3
].
value
);
nameField
.
textContent
=
name
.
selector
;
$
(
'#showName'
).
append
(
nameField
);
priceField
.
textContent
=
price
.
selector
;
$
(
'#showPrice'
).
append
(
priceField
);
idField
.
value
=
id
.
selector
;
$
(
'#showId'
).
append
(
idField
);
//[#modal-overlay]、または[#modal-close]をクリックしたら…
$
(
"#modal-overlay,#modal-close"
).
unbind
().
click
(
function
(){
...
...
@@ -41,9 +49,10 @@ $(function(){
}
)
;
}
)
;
}
)
;
});
//リサイズされたら、センタリングをする関数[centeringModalSyncer()]を実行する
$
(
window
).
resize
(
centeringModalSyncer
)
;
...
...
@@ -69,3 +78,28 @@ $(function(){
}
)
;
//モーダル表示
//let details = document.getElementsByClassName("js-modal-open");
//$(".js-modal-open").each(function() {
// $(".js-modal-open").on("click", function(){
// $('.js-modal').fadeIn();
// return false;
// });
// $(".js-modal-close").on("click", function(){
// $('.js-modal').fadeIn();
// return false;
// });
//});
//モーダル内情報表示
//モーダルフォーム送信
//$('#ok-btn').on('click', function(){
//
//});
src/main/resources/static/upload/スニーカー1.jpg
0 → 100644
View file @
c423ab94
69.9 KB
src/main/resources/static/upload/スニーカー2.jpg
0 → 100644
View file @
c423ab94
4.77 KB
src/main/resources/static/upload/スニーカー3.jpg
0 → 100644
View file @
c423ab94
7.34 KB
src/main/resources/templates/list.html
View file @
c423ab94
...
...
@@ -16,6 +16,7 @@
<![endif]-->
</head>
<body>
<!-- モーダル中身 -->
<div
id=
"modal-content"
>
<div
id=
"modal-content-innar"
>
...
...
@@ -23,12 +24,13 @@
<img
class=
"shoeImage"
alt=
"productImage"
/>
<div
id=
"showName"
></div>
<div
id=
"showPrice"
></div>
<div
id=
"showId"
></div>
<p><a
id=
"modal-close"
class=
"button-link"
>
閉じる
</a></p>
<button
type=
"button"
class=
"cartBtn"
>
cartへ入れる
</button>
</div>
<!-- モーダルウィンドウのコンテンツ終了 -->
</div>
<!-- モーダルウィンドウのコンテンツ終了 -->
<section
class=
"header-top-section"
>
<div
class=
"container"
>
...
...
@@ -92,24 +94,15 @@
<div
id=
"listBox"
>
<!--each分でくりかえす(宮嶋)-->
<div
class=
"productBox"
th:each=
"shoe : ${shoes}"
>
<img
class=
"shoeImage"
src=
"images/スニーカー3.jpg"
alt=
"productImage"
/>
<a
th:text=
"${shoe.name}"
class=
"shoeName"
>
AirMAX
</a>
<a
th:text =
"${shoe.price}"
class=
"shoePrice"
>
¥10,000
</a>
<button
type=
"button"
id=
"modal-open"
class=
"button-link"
>
詳細
</button>
</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>
<div
th:each=
"shoesPhoto : ${shoesPhoto}"
>
<img
class=
"shoeImage"
th:src=
"@{upload/スニーカー1.jpg}"
alt=
"productImage"
/>
<p
th:text=
"${shoe.name}"
class=
"shoeName"
>
AirMAX
</p>
<p
th:text =
"'¥' +${shoe.price}"
class=
"shoePrice"
>
¥10,000
</p>
<input
type=
"hidden"
th:value=
"${shoe.id}"
/>
<button
type=
"button"
id=
"modal-open"
class=
"details"
>
Datails
</button>
<!-- <button class="js-modal-open" id="sign-up">Details</button>-->
</div>
</div>
</div>
<footer
class=
"footer"
>
<div
class=
"container"
>
...
...
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