From da57e93cf8382a95b506b63dc693ad67b2ad4e16 Mon Sep 17 00:00:00 2001 From: Adamo2499 Date: Tue, 4 Jul 2023 19:36:21 +0200 Subject: [PATCH 1/5] Update links --- bin/main/templates/albums/list.html | 4 ++-- bin/main/templates/artists/list.html | 4 ++-- bin/main/templates/songs/list.html | 8 ++++---- src/main/resources/templates/albums/list.html | 4 ++-- src/main/resources/templates/artists/list.html | 4 ++-- src/main/resources/templates/songs/list.html | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/main/templates/albums/list.html b/bin/main/templates/albums/list.html index 8515631..c01c099 100644 --- a/bin/main/templates/albums/list.html +++ b/bin/main/templates/albums/list.html @@ -20,8 +20,8 @@ Nazwa - Edytuj - Usuń + Edytuj + Usuń diff --git a/bin/main/templates/artists/list.html b/bin/main/templates/artists/list.html index e750ff5..7916b25 100644 --- a/bin/main/templates/artists/list.html +++ b/bin/main/templates/artists/list.html @@ -25,8 +25,8 @@

Lista artystów

Opis Typ - Edytuj - Usuń + Edytuj + Usuń diff --git a/bin/main/templates/songs/list.html b/bin/main/templates/songs/list.html index afc74e3..aa84bb5 100644 --- a/bin/main/templates/songs/list.html +++ b/bin/main/templates/songs/list.html @@ -17,11 +17,11 @@ - - + + - Edytuj - Usuń + Edytuj + Usuń diff --git a/src/main/resources/templates/albums/list.html b/src/main/resources/templates/albums/list.html index 8515631..c01c099 100644 --- a/src/main/resources/templates/albums/list.html +++ b/src/main/resources/templates/albums/list.html @@ -20,8 +20,8 @@ Nazwa - Edytuj - Usuń + Edytuj + Usuń diff --git a/src/main/resources/templates/artists/list.html b/src/main/resources/templates/artists/list.html index e750ff5..7916b25 100644 --- a/src/main/resources/templates/artists/list.html +++ b/src/main/resources/templates/artists/list.html @@ -25,8 +25,8 @@

Lista artystów

Opis Typ - Edytuj - Usuń + Edytuj + Usuń diff --git a/src/main/resources/templates/songs/list.html b/src/main/resources/templates/songs/list.html index afc74e3..aa84bb5 100644 --- a/src/main/resources/templates/songs/list.html +++ b/src/main/resources/templates/songs/list.html @@ -17,11 +17,11 @@ - - + + - Edytuj - Usuń + Edytuj + Usuń From fc63e8b1e19278b8bbaae5a0d661b38acd9d9ef5 Mon Sep 17 00:00:00 2001 From: Adamo2499 Date: Tue, 4 Jul 2023 19:38:01 +0200 Subject: [PATCH 2/5] Add show page for songs --- bin/main/templates/songs/show.html | 42 ++++++++++++++++++++ src/main/resources/templates/songs/show.html | 42 ++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 bin/main/templates/songs/show.html create mode 100644 src/main/resources/templates/songs/show.html diff --git a/bin/main/templates/songs/show.html b/bin/main/templates/songs/show.html new file mode 100644 index 0000000..7d1202c --- /dev/null +++ b/bin/main/templates/songs/show.html @@ -0,0 +1,42 @@ + + +
+
+ +
+
+
+
+
+

Edytuj dane piosenki

+
+
+ + + + + + + + + + + + + + + + + + + + + +
ID piosenki:
Tytuł
ID wykonawcy
ID albumu
Długość trwania utworu
+ +
+
+
+
+ + \ No newline at end of file diff --git a/src/main/resources/templates/songs/show.html b/src/main/resources/templates/songs/show.html new file mode 100644 index 0000000..7d1202c --- /dev/null +++ b/src/main/resources/templates/songs/show.html @@ -0,0 +1,42 @@ + + +
+
+ +
+
+
+
+
+

Edytuj dane piosenki

+
+
+ + + + + + + + + + + + + + + + + + + + + +
ID piosenki:
Tytuł
ID wykonawcy
ID albumu
Długość trwania utworu
+ +
+
+
+
+ + \ No newline at end of file From 29c0fc90a1195c6346e0b35f5d71cd64abbd97af Mon Sep 17 00:00:00 2001 From: Adam Bieszk Date: Wed, 5 Jul 2023 18:34:01 +0200 Subject: [PATCH 3/5] Add buttons styles --- bin/main/static/style.css | 298 ++++++++++++++-------------- src/main/resources/static/style.css | 298 ++++++++++++++-------------- 2 files changed, 304 insertions(+), 292 deletions(-) diff --git a/bin/main/static/style.css b/bin/main/static/style.css index 368edfb..664abed 100644 --- a/bin/main/static/style.css +++ b/bin/main/static/style.css @@ -1,146 +1,152 @@ -@charset "UTF-8"; -* { - margin: 0; - padding: 0; -} -.dropdown { - width: 25%; -} - -.dropdown-content { - display: none; - position: absolute; - width: 25%; - overflow: auto; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - background-image: linear-gradient(to bottom right, red, darkred); - -} - -.dropdown:hover .dropdown-content { - display: block; -} - -.dropdown-content a { - display: block; - color: white; - padding: 5px; - text-decoration: none; -} - -.dropdown-content a:hover { - color: #FFFFFF; - background-color: red; -} - -ul { - list-style-type: none; - margin: 0; - padding: 0; - overflow: hidden; - /* background-color: #f00; */ - background-image: linear-gradient(to bottom right, red, darkred); - } - - li { - float: left; - } - - li a { - display: block; - color: white; - text-align: center; - padding: 14px 16px; - text-decoration: none; - } - - header { - background-image: linear-gradient(to bottom right, darkred, red); - color: white; - text-align: center; - padding-bottom: 30px; - } - - footer { - background-image: linear-gradient(to bottom right, darkred, red); - color: white; - text-align: center; - padding-bottom: 30px; - position:absolute; - bottom:0; - width:100%; /* Height of the footer */ - position: fixed; - } - - h2 { - text-align: center; - } - - table,th,td { - text-align: center; - margin: 0 auto; - border: 1px solid black; - padding: 3px; - } - - .form-inline { - text-align: center; - margin: 0 auto; - } - - sup { - color: red; - } - - img { - width: 50%; - height: 50%; - } - - .alert { - text-align: center; - color: whitesmoke; - } - - #buttons{ - margin: 0 auto; - text-align: center; - width: 100%; - } - - button { - transition-duration: 0.4s; - border: none; - color: white; - padding: 15px 32px; - text-align: center; - text-decoration: none; - font-size: 16px; - border-radius: 100rem; - margin: 0 auto; - } - - input[type = file]{ - background-color: #f4f4ec; - border: 1px solid #f8f4f4; - } - - button[type = submit]{ - background-color: #a00c04; - display: inline-flex; - justify-content: center; - align-items: center; - } - - button[type = reset]{ - background-color: black; - display: inline-flex; - justify-content: center; - align-items: center; - } - - button:hover{ - box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19); - } - - /* @media only screen and (max-width: 600px) {} */ \ No newline at end of file +@charset "UTF-8"; + +* { + margin: 0; + padding: 0; +} + +.dropdown { + width: 25%; +} + +.dropdown-content { + display: none; + position: absolute; + width: 25%; + overflow: auto; + box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); + background-image: linear-gradient(to bottom right, red, darkred); + +} + +.dropdown:hover .dropdown-content { + display: block; +} + +.dropdown-content a { + display: block; + color: white; + padding: 5px; + text-decoration: none; +} + +.dropdown-content a:hover { + color: #FFFFFF; + background-color: red; +} + +ul { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + /* background-color: #f00; */ + background-image: linear-gradient(to bottom right, red, darkred); +} + +li { + float: left; +} + +li a { + display: block; + color: white; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +header { + background-image: linear-gradient(to bottom right, darkred, red); + color: white; + text-align: center; + padding-bottom: 30px; +} + +footer { + background-image: linear-gradient(to bottom right, darkred, red); + color: white; + text-align: center; + padding-bottom: 30px; + position: absolute; + bottom: 0; + width: 100%; + /* Height of the footer */ + position: fixed; +} + +h2 { + text-align: center; +} + +table, +th, +td { + text-align: center; + margin: 0 auto; + border: 1px solid black; + padding: 3px; +} + +.form-inline { + text-align: center; + margin: 0 auto; +} + +sup { + color: red; +} + +img { + width: 50%; + height: 50%; +} + +.alert { + text-align: center; + color: whitesmoke; +} + +button { + transition-duration: 0.4s; + border: none; + color: white; + padding: 15px 32px; + text-align: center; + text-decoration: none; + font-size: 16px; + border-radius: 100rem; + margin: 0 auto; +} + +input[type=file] { + background-color: #f4f4ec; + border: 1px solid #f8f4f4; +} + +button[type=submit] { + background-color: darkred; + display: inline-flex; + justify-content: center; + align-items: center; +} + +.return { + background-color: #a00c04; + display: inline-flex; + justify-content: center; + align-items: center; +} + +button[type=reset] { + background-color: black; + display: inline-flex; + justify-content: center; + align-items: center; +} + +button:hover { + box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19); +} + +/* @media only screen and (max-width: 600px) {} */ \ No newline at end of file diff --git a/src/main/resources/static/style.css b/src/main/resources/static/style.css index 368edfb..664abed 100644 --- a/src/main/resources/static/style.css +++ b/src/main/resources/static/style.css @@ -1,146 +1,152 @@ -@charset "UTF-8"; -* { - margin: 0; - padding: 0; -} -.dropdown { - width: 25%; -} - -.dropdown-content { - display: none; - position: absolute; - width: 25%; - overflow: auto; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - background-image: linear-gradient(to bottom right, red, darkred); - -} - -.dropdown:hover .dropdown-content { - display: block; -} - -.dropdown-content a { - display: block; - color: white; - padding: 5px; - text-decoration: none; -} - -.dropdown-content a:hover { - color: #FFFFFF; - background-color: red; -} - -ul { - list-style-type: none; - margin: 0; - padding: 0; - overflow: hidden; - /* background-color: #f00; */ - background-image: linear-gradient(to bottom right, red, darkred); - } - - li { - float: left; - } - - li a { - display: block; - color: white; - text-align: center; - padding: 14px 16px; - text-decoration: none; - } - - header { - background-image: linear-gradient(to bottom right, darkred, red); - color: white; - text-align: center; - padding-bottom: 30px; - } - - footer { - background-image: linear-gradient(to bottom right, darkred, red); - color: white; - text-align: center; - padding-bottom: 30px; - position:absolute; - bottom:0; - width:100%; /* Height of the footer */ - position: fixed; - } - - h2 { - text-align: center; - } - - table,th,td { - text-align: center; - margin: 0 auto; - border: 1px solid black; - padding: 3px; - } - - .form-inline { - text-align: center; - margin: 0 auto; - } - - sup { - color: red; - } - - img { - width: 50%; - height: 50%; - } - - .alert { - text-align: center; - color: whitesmoke; - } - - #buttons{ - margin: 0 auto; - text-align: center; - width: 100%; - } - - button { - transition-duration: 0.4s; - border: none; - color: white; - padding: 15px 32px; - text-align: center; - text-decoration: none; - font-size: 16px; - border-radius: 100rem; - margin: 0 auto; - } - - input[type = file]{ - background-color: #f4f4ec; - border: 1px solid #f8f4f4; - } - - button[type = submit]{ - background-color: #a00c04; - display: inline-flex; - justify-content: center; - align-items: center; - } - - button[type = reset]{ - background-color: black; - display: inline-flex; - justify-content: center; - align-items: center; - } - - button:hover{ - box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19); - } - - /* @media only screen and (max-width: 600px) {} */ \ No newline at end of file +@charset "UTF-8"; + +* { + margin: 0; + padding: 0; +} + +.dropdown { + width: 25%; +} + +.dropdown-content { + display: none; + position: absolute; + width: 25%; + overflow: auto; + box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); + background-image: linear-gradient(to bottom right, red, darkred); + +} + +.dropdown:hover .dropdown-content { + display: block; +} + +.dropdown-content a { + display: block; + color: white; + padding: 5px; + text-decoration: none; +} + +.dropdown-content a:hover { + color: #FFFFFF; + background-color: red; +} + +ul { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + /* background-color: #f00; */ + background-image: linear-gradient(to bottom right, red, darkred); +} + +li { + float: left; +} + +li a { + display: block; + color: white; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +header { + background-image: linear-gradient(to bottom right, darkred, red); + color: white; + text-align: center; + padding-bottom: 30px; +} + +footer { + background-image: linear-gradient(to bottom right, darkred, red); + color: white; + text-align: center; + padding-bottom: 30px; + position: absolute; + bottom: 0; + width: 100%; + /* Height of the footer */ + position: fixed; +} + +h2 { + text-align: center; +} + +table, +th, +td { + text-align: center; + margin: 0 auto; + border: 1px solid black; + padding: 3px; +} + +.form-inline { + text-align: center; + margin: 0 auto; +} + +sup { + color: red; +} + +img { + width: 50%; + height: 50%; +} + +.alert { + text-align: center; + color: whitesmoke; +} + +button { + transition-duration: 0.4s; + border: none; + color: white; + padding: 15px 32px; + text-align: center; + text-decoration: none; + font-size: 16px; + border-radius: 100rem; + margin: 0 auto; +} + +input[type=file] { + background-color: #f4f4ec; + border: 1px solid #f8f4f4; +} + +button[type=submit] { + background-color: darkred; + display: inline-flex; + justify-content: center; + align-items: center; +} + +.return { + background-color: #a00c04; + display: inline-flex; + justify-content: center; + align-items: center; +} + +button[type=reset] { + background-color: black; + display: inline-flex; + justify-content: center; + align-items: center; +} + +button:hover { + box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19); +} + +/* @media only screen and (max-width: 600px) {} */ \ No newline at end of file From b98f9ee0b2c3723c88c4428ed4580db5e0fa9470 Mon Sep 17 00:00:00 2001 From: Adam Bieszk Date: Wed, 5 Jul 2023 18:38:29 +0200 Subject: [PATCH 4/5] Add missing buttons --- bin/main/templates/albums/list.html | 8 ++------ bin/main/templates/albums/show.html | 12 ++---------- bin/main/templates/artists/list.html | 9 ++------- bin/main/templates/artists/show.html | 4 ++-- bin/main/templates/songs/list.html | 14 +++++--------- bin/main/templates/songs/new.html | 18 +++++++++++++----- src/main/resources/templates/albums/list.html | 8 ++------ src/main/resources/templates/albums/show.html | 12 ++---------- src/main/resources/templates/artists/list.html | 9 ++------- src/main/resources/templates/artists/show.html | 4 ++-- src/main/resources/templates/songs/list.html | 14 +++++--------- src/main/resources/templates/songs/new.html | 18 +++++++++++++----- 12 files changed, 52 insertions(+), 78 deletions(-) diff --git a/bin/main/templates/albums/list.html b/bin/main/templates/albums/list.html index c01c099..baf89c5 100644 --- a/bin/main/templates/albums/list.html +++ b/bin/main/templates/albums/list.html @@ -21,15 +21,11 @@ Edytuj - Usuń - - - - Powrót na stronę główną - + Usuń +

diff --git a/bin/main/templates/albums/show.html b/bin/main/templates/albums/show.html index ceab421..ebcab49 100644 --- a/bin/main/templates/albums/show.html +++ b/bin/main/templates/albums/show.html @@ -9,7 +9,7 @@

Szczegółowe dane albumu

-
+ @@ -19,20 +19,12 @@

Szczegółowe dane albumu

-
ID albumu: Nazwa albumu:
Rok wydania
- +
diff --git a/bin/main/templates/artists/list.html b/bin/main/templates/artists/list.html index 7916b25..d06a814 100644 --- a/bin/main/templates/artists/list.html +++ b/bin/main/templates/artists/list.html @@ -26,16 +26,11 @@

Lista artystów

Typ Edytuj - Usuń - - - - - Powrót na stronę główną
- + Usuń +

diff --git a/bin/main/templates/artists/show.html b/bin/main/templates/artists/show.html index 096429b..16aa06c 100644 --- a/bin/main/templates/artists/show.html +++ b/bin/main/templates/artists/show.html @@ -10,7 +10,7 @@

Szczegółowe dane artysty


-
@@ -37,7 +37,7 @@

Szczegółowe dane artysty

- +
diff --git a/bin/main/templates/songs/list.html b/bin/main/templates/songs/list.html index aa84bb5..cff2533 100644 --- a/bin/main/templates/songs/list.html +++ b/bin/main/templates/songs/list.html @@ -17,19 +17,15 @@ - - + + - Edytuj - Usuń + Edytuj + Usuń - - - Powrót na stronę główną - - +

diff --git a/bin/main/templates/songs/new.html b/bin/main/templates/songs/new.html index b6129b0..7896d4a 100644 --- a/bin/main/templates/songs/new.html +++ b/bin/main/templates/songs/new.html @@ -8,7 +8,7 @@

-

Edytuj dane artysty

+

Dodaj dane piosenki


@@ -17,12 +17,20 @@

Edytuj dane artysty

- - + + - - + + diff --git a/src/main/resources/templates/albums/list.html b/src/main/resources/templates/albums/list.html index c01c099..baf89c5 100644 --- a/src/main/resources/templates/albums/list.html +++ b/src/main/resources/templates/albums/list.html @@ -21,15 +21,11 @@ - - - - +
ID wykonawcy Wykonawca + +
ID albumuAlbum + +
Długość trwania utworu Edytuj Usuń
- Powrót na stronę główną - Usuń
+

diff --git a/src/main/resources/templates/albums/show.html b/src/main/resources/templates/albums/show.html index ceab421..ebcab49 100644 --- a/src/main/resources/templates/albums/show.html +++ b/src/main/resources/templates/albums/show.html @@ -9,7 +9,7 @@

Szczegółowe dane albumu

- + @@ -19,20 +19,12 @@

Szczegółowe dane albumu

-
ID albumu: Nazwa albumu:
Rok wydania
- +
diff --git a/src/main/resources/templates/artists/list.html b/src/main/resources/templates/artists/list.html index 7916b25..d06a814 100644 --- a/src/main/resources/templates/artists/list.html +++ b/src/main/resources/templates/artists/list.html @@ -26,16 +26,11 @@

Lista artystów

Typ Edytuj - Usuń - - - - - Powrót na stronę główną
- + Usuń +

diff --git a/src/main/resources/templates/artists/show.html b/src/main/resources/templates/artists/show.html index 096429b..16aa06c 100644 --- a/src/main/resources/templates/artists/show.html +++ b/src/main/resources/templates/artists/show.html @@ -10,7 +10,7 @@

Szczegółowe dane artysty


-
@@ -37,7 +37,7 @@

Szczegółowe dane artysty

- +
diff --git a/src/main/resources/templates/songs/list.html b/src/main/resources/templates/songs/list.html index aa84bb5..cff2533 100644 --- a/src/main/resources/templates/songs/list.html +++ b/src/main/resources/templates/songs/list.html @@ -17,19 +17,15 @@ - - + + - Edytuj - Usuń + Edytuj + Usuń - - - Powrót na stronę główną - - +

diff --git a/src/main/resources/templates/songs/new.html b/src/main/resources/templates/songs/new.html index 118ffb9..95105fa 100644 --- a/src/main/resources/templates/songs/new.html +++ b/src/main/resources/templates/songs/new.html @@ -8,7 +8,7 @@

-

Edytuj dane artysty

+

Dodaj dane piosenki


@@ -17,12 +17,20 @@

Edytuj dane artysty

- - + + - - + + From 123959071511412347ddb531b4e0b41eea8c70f8 Mon Sep 17 00:00:00 2001 From: Adam Bieszk Date: Wed, 5 Jul 2023 18:39:26 +0200 Subject: [PATCH 5/5] Global fix --- .gitignore | 2 + WEB-INF/web.xml | 12 +++ .../controllers/AlbumsController.class | Bin 3519 -> 3800 bytes .../controllers/ArtistController.class | Bin 3191 -> 3503 bytes .../controllers/SongsController.class | Bin 2901 -> 3456 bytes bin/main/musicbase/models/Album.class | Bin 1997 -> 2347 bytes bin/main/musicbase/models/Artist.class | Bin 2096 -> 2509 bytes bin/main/musicbase/models/Song.class | Bin 2112 -> 2356 bytes bin/main/static/index.html | 2 +- bin/main/templates/albums/details.html | 34 +++++++++ bin/main/templates/artists/details.html | 45 +++++++++++ bin/main/templates/songs/edit.html | 4 +- .../controllers/AlbumsController.java | 30 +++++--- .../controllers/ArtistController.java | 28 ++++--- .../controllers/SongsController.java | 18 ++++- src/main/java/musicbase/models/Album.java | 16 ++++ src/main/java/musicbase/models/Artist.java | 13 ++++ src/main/java/musicbase/models/Song.java | 71 ++++++++++++++---- src/main/resources/static/index.html | 2 +- .../resources/templates/albums/details.html | 34 +++++++++ .../resources/templates/artists/details.html | 45 +++++++++++ src/main/resources/templates/songs/edit.html | 4 +- 22 files changed, 315 insertions(+), 45 deletions(-) create mode 100644 .gitignore create mode 100644 WEB-INF/web.xml create mode 100644 bin/main/templates/albums/details.html create mode 100644 bin/main/templates/artists/details.html create mode 100644 src/main/resources/templates/albums/details.html create mode 100644 src/main/resources/templates/artists/details.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd0ec54 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +*.class diff --git a/WEB-INF/web.xml b/WEB-INF/web.xml new file mode 100644 index 0000000..fd741a3 --- /dev/null +++ b/WEB-INF/web.xml @@ -0,0 +1,12 @@ + + + MusicBaseSpring + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + diff --git a/bin/main/musicbase/controllers/AlbumsController.class b/bin/main/musicbase/controllers/AlbumsController.class index 2a2e82ed82c3c427beb08dd8874da86c23d0a57b..dbd208dafab15c6bdc44a97271a3f8af948a830b 100644 GIT binary patch delta 458 zcmZ{g%Su8~7=_oivU85-RCvMYBxR6Y(V&Y$*afVd)TCh(4G$$)30hGacD1V&{PYeD zi)KL=Xx0-niXNar^Z?PXQ9;mPZ&>U5*V>mm{mG>~eq7%I2;$^Y2@5eylVV8pP((QB zwA^kQGp-)Qt67m#vkS|^iRr~Tx|dpmH9sV|UIe8c1$Ee0aezY#%V$EOXSuyXM>*o`6FI@1!gDyI^Y-_zx&<7j*&=H_FwS!`6P7AU-!0sTs zLq%85VijfR@UXCe<6n44KNrqNayJwADFgEc3xY)$|I6rEF3R;8hs6+~-0yBq?flqP2XW0M% delta 306 zcmca1yI-2?)W2Q(7#J9A8M-%ec`!02P7Y>tV6>S0fL(I(1Qr3dpwzKsf_HC9k{eu zB^g*4q$cNcC2-0ya4^U-2r(#3zQNVTsS4z&0eR{`p5o*V?n+J_23ZDOpqSodE}j-% zV+Jk;69!=hQwC`Uv&pl0R`FT`MQnf~wm=a(poq3{149)9GlLG$4?GNvKp8HE28L>& z2qQxyLlc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fSyrx$&Wdp`!KpHE}3kj4;(6{|{k zL=`hQ;E{@@H(fA76 zu4Zt}F@DW%ugX8Vhw%k#au?Spa|qK@ww37E!CcZ-B<_GL)r~H`4haU_jT-bgL@}ox zEf7Vizepp4T}!x4-g54jafdqjak-VdtcWb`A;nETu_E~WL%>IKfdzB45B|+-fMXjx YkXNuk7tGOVNb@!t9+{4_pTKLtUwe*q-T(jq diff --git a/bin/main/musicbase/models/Album.class b/bin/main/musicbase/models/Album.class index e5b599d4d7afeb800a49fb516c50453f98942b7b..e8db18a7ee06e941e2402b30d45018a1d7ce4fae 100644 GIT binary patch delta 405 zcmYk1PfG$(6vgkG$D2VLClbv?#WoI>Qb*`%DneNS&KjXFt?2Zd&cZUvg_Gy@J4q2xgM2T#{pQvd(} delta 269 zcmZ22be5m%)W2Q(7#J9A8C*AV9cP+6ky)NmbMi)J-N_G_r1|xE7uTCE$N*)S80>(0nHcOD*nzYNkmUfR9f34&F@qC>b1{Pp E03S0ucmMzZ diff --git a/bin/main/musicbase/models/Artist.class b/bin/main/musicbase/models/Artist.class index 0b697eeccb6037560602181d0c2570d06c019954..3e43a534fd8fd2705a7e0f643e94846b4c773d8e 100644 GIT binary patch delta 448 zcma)%OG^S_6o%h#E=7`MjgF0wnr>uDBqHcuc7ZNdQqacL1cOZI7&B8_e}w&zM25gc zi)&Uaqk^P2e5VxK?5cL2LM>BolhX`@tou%4|-%W|8QTE}f} zkJYz<=lrwN%gK7NaP#B_PTRh7eCNJp*DcR#+kx#>UAGfhfzxsQ!H3)sVtSBOzomr0 z26iCR46vpGy++;8{lkd%lrBo!(0CRCjpbUI4oXC!s*k2lgfWq6oQjnQQi9gO0BCNi5O9ryg`8L)W2Q(7#J9A8JstA?PA{S&JxMU$h~w6|;CI%az3=>d}9Y~7+S$06$ Q9!T>RGdM6f7Be^j09n%wg8%>k diff --git a/bin/main/musicbase/models/Song.class b/bin/main/musicbase/models/Song.class index be12df7b90b0790d26633707099433fdf8778628..45c64f2119f0e0043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OHo-r(tpZt%{kn{50@KL74;#YU6OrP5YRsGG3gdZWJM#trez+-3?Rsc|<$06Rb~PD07xjZl~Q%T)du=?PhY#_ewNLH;{muT?v!j zb=&b=c%(BU78P;GI(JyPTloH6Sg%&-8jWk%CSaMO+&Hlh z&t7ki1yA#fY5o*4I16<cuzv=$g!|#R-5oP_IEVB&Z%$w zkFeLvFN@*E^Gz^3z-nO~EdNe#{hUC};K}GjGnA*d@k0MA><3u_$ioXjme4{5d6)_Es2^lG6J$9Xxk~HUe+>ImO&heSY3pA|h^&7A diff --git a/bin/main/static/index.html b/bin/main/static/index.html index ac6ba13..df34ad5 100644 --- a/bin/main/static/index.html +++ b/bin/main/static/index.html @@ -6,7 +6,7 @@ -

+
MusicBase

ID wykonawcy Wykonawca + +
ID albumuAlbum + +
Długość trwania utworu
+ + + + + + + + + + + + +
ID albumu:
Nazwa albumu: +
Rok wydania
+ +
+
+
+ + \ No newline at end of file diff --git a/bin/main/templates/artists/details.html b/bin/main/templates/artists/details.html new file mode 100644 index 0000000..e31695f --- /dev/null +++ b/bin/main/templates/artists/details.html @@ -0,0 +1,45 @@ + + +
+
+ +
+
+
+
+
+

Szczegółowe dane artysty

+
+
+ + + + + + + + + + + + + + + + + + + + + +
ID artysty:
Nazwa wykonawcy:
Opis wykonawcy:
Typ wykonawcy
Oficjalna strona wykonawcy:
+
+
+
+
+ + \ No newline at end of file diff --git a/bin/main/templates/songs/edit.html b/bin/main/templates/songs/edit.html index 582a518..9f1f82f 100644 --- a/bin/main/templates/songs/edit.html +++ b/bin/main/templates/songs/edit.html @@ -22,11 +22,11 @@

Edytuj dane piosenki

ID wykonawcy - + ID albumu - + Długość trwania utworu diff --git a/src/main/java/musicbase/controllers/AlbumsController.java b/src/main/java/musicbase/controllers/AlbumsController.java index ddad0f4..1d72652 100644 --- a/src/main/java/musicbase/controllers/AlbumsController.java +++ b/src/main/java/musicbase/controllers/AlbumsController.java @@ -6,6 +6,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -25,14 +27,14 @@ public AlbumsController() { super(); } - @RequestMapping("/albums/list") - public String viewalbumsList(Model model) { + @GetMapping("/albums/list") + public String viewAlbumsList(Model model) { List lalbums = service.findAll(); model.addAttribute("albums", lalbums); return "/albums/list"; } - @RequestMapping("/albums/new") + @GetMapping("/albums/new") public String showFormNewAlbums(Model model) { Album newAlbum = new Album(); model.addAttribute("album", newAlbum); @@ -46,7 +48,7 @@ public String saveAlbums(@ModelAttribute("albums") Album Album) { return "redirect:/albums/list"; } - @RequestMapping("/albums/edit/{id}") + @GetMapping("/albums/edit/{id}") public ModelAndView showEditFormAlbums(@PathVariable(name = "id") Long id) { ModelAndView mav = new ModelAndView("/albums/edit"); Optional eAlbum = service.findById(id); @@ -54,18 +56,26 @@ public ModelAndView showEditFormAlbums(@PathVariable(name = "id") Long id) { return mav; } - @RequestMapping("/albums/show/{id}") - public ModelAndView showAlbumDetails(@PathVariable(name = "id") Long id) { + @GetMapping("/albums/show/{id}") + public ModelAndView showAlbum(@PathVariable(name = "id") Long id) { ModelAndView mav = new ModelAndView("/albums/show"); Optional showAlbum = service.findById(id); mav.addObject("album",showAlbum); return mav; } + + @GetMapping("/albums/details/{id}") + public ModelAndView showAlbumDetails(@PathVariable(name = "id") Long id) { + ModelAndView mav = new ModelAndView("/albums/details"); + Optional showAlbum = service.findById(id); + mav.addObject("album",showAlbum); + return mav; + } - - @RequestMapping("/albums/delete/{id}") + @DeleteMapping("/albums/delete/{id}") public String deleteAlbums(@PathVariable(name = "id") Long id) { - service.deleteById(id); - return "redirect:/albums/list"; + service.deleteById(id); + return "redirect:/albums/list"; } + } diff --git a/src/main/java/musicbase/controllers/ArtistController.java b/src/main/java/musicbase/controllers/ArtistController.java index 357c8de..c397c04 100644 --- a/src/main/java/musicbase/controllers/ArtistController.java +++ b/src/main/java/musicbase/controllers/ArtistController.java @@ -6,10 +6,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import musicbase.models.Artist; @@ -25,14 +26,14 @@ public ArtistController() { super(); } - @RequestMapping("/artists/list") + @GetMapping("/artists/list") public String viewArtistsList(Model model) { List lArtists = service.findAll(); model.addAttribute("artists", lArtists); return "/artists/list"; } - @RequestMapping("/artists/new") + @GetMapping("/artists/new") public String showFormNewArtist(Model model) { Artist newArtist = new Artist(); model.addAttribute("artist", newArtist); @@ -45,7 +46,7 @@ public String saveArtist(@ModelAttribute("artist") Artist artist) { return "redirect:/artists/list"; } - @RequestMapping("/artists/edit/{id}") + @GetMapping("/artists/edit/{id}") public ModelAndView showEditFormArtist(@PathVariable(name = "id") Long id) { ModelAndView mav = new ModelAndView("/artists/edit"); Optional eartist = service.findById(id); @@ -53,20 +54,23 @@ public ModelAndView showEditFormArtist(@PathVariable(name = "id") Long id) { return mav; } - @RequestMapping("/artists/show/{id}") - public ModelAndView showArtistDetails(@PathVariable(name = "id") Long id) { + @GetMapping("/artists/show/{id}") + public ModelAndView showArtist(@PathVariable(name = "id") Long id) { ModelAndView mav = new ModelAndView("/artists/show"); Optional sartist = service.findById(id); mav.addObject("artist", sartist); return mav; } + + @GetMapping("/artists/details/{id}") + public ModelAndView showArtistDetails(@PathVariable(name = "id") Long id) { + ModelAndView mav = new ModelAndView("/artists/details"); + Optional artistDetails = service.findById(id); + mav.addObject("artist", artistDetails); + return mav; + } - // @RequestMapping("/artists/delete/{id}") - // public String deleteArtist(@PathVariable(name = "id") Long id) { - // service.deleteById(id); - // return "redirect:/artists/list"; - // } - @RequestMapping("/artists/delete/{id}") + @DeleteMapping("/artists/delete/{id}") public String deleteArtist(@PathVariable(name = "id") Long id) { service.deleteById(id); return "redirect:/artists/list"; diff --git a/src/main/java/musicbase/controllers/SongsController.java b/src/main/java/musicbase/controllers/SongsController.java index 6bdec67..9284c59 100644 --- a/src/main/java/musicbase/controllers/SongsController.java +++ b/src/main/java/musicbase/controllers/SongsController.java @@ -9,10 +9,15 @@ import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.servlet.ModelAndView; +import musicbase.models.Album; +import musicbase.models.Artist; import musicbase.models.Song; +import musicbase.services.AlbumsService; +import musicbase.services.ArtistService; import musicbase.services.SongsService; @Controller @@ -20,6 +25,13 @@ public class SongsController { @Autowired private SongsService service; + + @Autowired + private ArtistService artistService; + + @Autowired + private AlbumsService albumsService; + public SongsController() { super(); @@ -35,6 +47,10 @@ public String viewSongsList(Model model) { @GetMapping("/songs/new") public String showFormNewSongs(Model model) { Song newSong = new Song(); + List artistsList = artistService.findAll(); + List albumsList = albumsService.findAll(); + model.addAttribute("artists",artistsList); + model.addAttribute("albums",albumsList); model.addAttribute("song", newSong); return "/songs/new"; } @@ -52,7 +68,7 @@ public ModelAndView showEditFormSongs(@PathVariable(name = "id") Long id) { mav.addObject("song", songToEdit); return mav; } - @GetMapping("/songs/delete/{id}") + @DeleteMapping("/songs/delete/{id}") public String deleteSongs(@PathVariable(name = "id") Long id) { service.deleteById(id); return "redirect:/songs/list"; diff --git a/src/main/java/musicbase/models/Album.java b/src/main/java/musicbase/models/Album.java index 13cf5f9..3be7d31 100644 --- a/src/main/java/musicbase/models/Album.java +++ b/src/main/java/musicbase/models/Album.java @@ -31,6 +31,22 @@ public Album() { // TODO Auto-generated constructor stub } + public String getCover_image() { + return cover_image; + } + + public void setCover_image(String cover_image) { + this.cover_image = cover_image; + } + + public Integer getPublishing_year() { + return publishing_year; + } + + public void setPublishing_year(Integer publishing_year) { + this.publishing_year = publishing_year; + } + public Long getId() { return id; } diff --git a/src/main/java/musicbase/models/Artist.java b/src/main/java/musicbase/models/Artist.java index 9f8852f..3990dcf 100644 --- a/src/main/java/musicbase/models/Artist.java +++ b/src/main/java/musicbase/models/Artist.java @@ -67,5 +67,18 @@ public Artist() { super(); // TODO Auto-generated constructor stub } + public Artist(Long id, + @NotNull @Size(min = 3, message = "Nazwa artysty musi się składać z minium 3 znaków") String name, + @Size(min = 3, message = "Opis artysty musi się składać z minium 3 znaków") String description, + @URL String ofc_website, @NotNull String type) { + super(); + this.id = id; + this.name = name; + this.description = description; + this.ofc_website = ofc_website; + this.type = type; + } + + } \ No newline at end of file diff --git a/src/main/java/musicbase/models/Song.java b/src/main/java/musicbase/models/Song.java index 6dd3ec3..7aca42c 100644 --- a/src/main/java/musicbase/models/Song.java +++ b/src/main/java/musicbase/models/Song.java @@ -4,6 +4,9 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToOne; import jakarta.persistence.Table; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; @@ -21,13 +24,22 @@ public class Song { @Size(min = 3, message = "Tytuł jest za krótki") private String title; - @NotNull - @Positive - private Integer performer_id; +// @NotNull +// @Positive(message = "Indeks albumu musi być liczbą dodatnią!") +// private Integer performer_id; +// +// @NotNull +// @Positive(message = "Indeks albumu musi być liczbą dodatnią!") +// private Integer album_id; +// - @NotNull - @Positive(message = "Indeks albumu musi być liczbą dodatnią!") - private Integer album_id; + @ManyToOne + @JoinColumn(name = "album_id") + private Album album; + + @ManyToOne + @JoinColumn(name = "performer_id") + private Artist performer; @NotNull @Pattern(regexp = "^[0-5]{1}\\:[0-5]{1}[0-9]{1}$", message = "Nieprawidłowo zapisana długość utworu!") @@ -37,6 +49,14 @@ public Song() { super(); } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + public String getTitle() { return title; } @@ -45,28 +65,47 @@ public void setTitle(String title) { this.title = title; } - public Integer getPerformer() { - return performer_id; +// public Integer getPerformer_id() { +// return performer_id; +// } +// +// public void setPerformerID(Integer performer_id) { +// this.performer_id = performer_id; +// } +// +// public Integer getAlbum_id() { +// return album_id; +// } +// +// public void setAlbumID(Integer album_id) { +// this.album_id = album_id; +// } + + + public String getDuration() { + return duration; } - public void setPerformer(Integer performer) { - this.performer_id = performer; + public Album getAlbum() { + return album; } - public Integer getAlbumid() { - return album_id; + public void setAlbum(Album album) { + this.album = album; } - public void setAlbumid(Integer albumid) { - this.album_id = albumid; + public Artist getPerformer() { + return performer; } - public String getDuration() { - return duration; + public void setPerformer(Artist performer) { + this.performer = performer; } public void setDuration(String duration) { this.duration = duration; } + + } diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index ac6ba13..df34ad5 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -6,7 +6,7 @@ -

+
MusicBase