Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SkuciSe
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tim 2 - 2022
SkuciSe
Commits
83027bec
Commit
83027bec
authored
Sep 16, 2022
by
Bogdan Andjelkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
div u footeru, poruka o vec postojecem aktivnom zahtevu, updatovanje zavrsen na zahtevima
parent
fcaca62f
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
60 additions
and
12 deletions
+60
-12
SkuciSe/src/main/java/com/example/SkuciSe/configuration/AktivanZahtevPostoji.java
+5
-0
SkuciSe/src/main/java/com/example/SkuciSe/controller/ZahtevController.java
+7
-2
SkuciSe/src/main/java/com/example/SkuciSe/repository/ZahtevRepository.java
+31
-1
SkuciSe/src/main/resources/templates/index.html
+1
-1
SkuciSe/src/main/resources/templates/lista-korisnika.html
+1
-0
SkuciSe/src/main/resources/templates/lista-oglasa.html
+1
-1
SkuciSe/src/main/resources/templates/login.html
+1
-1
SkuciSe/src/main/resources/templates/moji-zahtevi.html
+2
-1
SkuciSe/src/main/resources/templates/novi-oglas-form.html
+1
-1
SkuciSe/src/main/resources/templates/oglas.html
+6
-1
SkuciSe/src/main/resources/templates/password-edit.html
+1
-1
SkuciSe/src/main/resources/templates/profile-edit.html
+1
-1
SkuciSe/src/main/resources/templates/profile.html
+1
-1
SkuciSe/src/main/resources/templates/register.html
+1
-0
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/configuration/AktivanZahtevPostoji.java
0 → 100644
View file @
83027bec
package
com
.
example
.
SkuciSe
.
configuration
;
public
class
AktivanZahtevPostoji
extends
Exception
{
}
SkuciSe/src/main/java/com/example/SkuciSe/controller/ZahtevController.java
View file @
83027bec
package
com
.
example
.
SkuciSe
.
controller
;
package
com
.
example
.
SkuciSe
.
controller
;
import
com.example.SkuciSe.configuration.AktivanZahtevPostoji
;
import
com.example.SkuciSe.model.korisnik.KorisnikDetails
;
import
com.example.SkuciSe.model.korisnik.KorisnikDetails
;
import
com.example.SkuciSe.model.zahtev.StanjeZahteva
;
import
com.example.SkuciSe.model.zahtev.StanjeZahteva
;
import
com.example.SkuciSe.model.zahtev.Zahtev
;
import
com.example.SkuciSe.model.zahtev.Zahtev
;
...
@@ -33,8 +34,12 @@ public class ZahtevController {
...
@@ -33,8 +34,12 @@ public class ZahtevController {
@PostMapping
(
"/obradi-zahtev/{id}"
)
@PostMapping
(
"/obradi-zahtev/{id}"
)
public
String
postObradizahtev
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
,
@ModelAttribute
Zahtev
noviZahtev
,
@ModelAttribute
(
"datumIVreme"
)
String
datumIVreme
,
@PathVariable
(
"id"
)
int
oglasId
,
RedirectAttributes
redirectAttributes
)
public
String
postObradizahtev
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
,
@ModelAttribute
Zahtev
noviZahtev
,
@ModelAttribute
(
"datumIVreme"
)
String
datumIVreme
,
@PathVariable
(
"id"
)
int
oglasId
,
RedirectAttributes
redirectAttributes
)
{
{
zRepo
.
insert
(
loggedUser
.
getKorisnik
().
getKorisnikId
(),
oglasId
,
noviZahtev
,
datumIVreme
);
try
{
redirectAttributes
.
addFlashAttribute
(
"zakazan"
,
true
);
zRepo
.
insert
(
loggedUser
.
getKorisnik
().
getKorisnikId
(),
oglasId
,
noviZahtev
,
datumIVreme
);
redirectAttributes
.
addFlashAttribute
(
"zakazan"
,
true
);
}
catch
(
AktivanZahtevPostoji
e
)
{
redirectAttributes
.
addFlashAttribute
(
"aktivanZahtevPostoji"
,
true
);
}
return
"redirect:/lista-oglasa/"
+
oglasId
;
return
"redirect:/lista-oglasa/"
+
oglasId
;
}
}
...
...
SkuciSe/src/main/java/com/example/SkuciSe/repository/ZahtevRepository.java
View file @
83027bec
package
com
.
example
.
SkuciSe
.
repository
;
package
com
.
example
.
SkuciSe
.
repository
;
import
com.example.SkuciSe.configuration.AktivanZahtevPostoji
;
import
com.example.SkuciSe.model.zahtev.StanjeZahteva
;
import
com.example.SkuciSe.model.zahtev.StanjeZahteva
;
import
com.example.SkuciSe.model.zahtev.Zahtev
;
import
com.example.SkuciSe.model.zahtev.Zahtev
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -16,8 +17,22 @@ import java.util.*;
...
@@ -16,8 +17,22 @@ import java.util.*;
public
class
ZahtevRepository
{
public
class
ZahtevRepository
{
@Autowired
@Autowired
DataBase
dataBase
;
DataBase
dataBase
;
public
void
insert
(
int
korisnikId
,
int
oglasId
,
Zahtev
noviZahtev
,
String
datumIVreme
)
public
void
insert
(
int
korisnikId
,
int
oglasId
,
Zahtev
noviZahtev
,
String
datumIVreme
)
throws
AktivanZahtevPostoji
{
{
this
.
postaviFinishedZahteve
();
try
{
CallableStatement
provera
=
dataBase
.
connection
.
prepareCall
(
"{ call daLiPostojiAktivanZahtev(?,?)}"
);
provera
.
setInt
(
1
,
korisnikId
);
provera
.
setInt
(
2
,
oglasId
);
ResultSet
rs
=
provera
.
executeQuery
();
while
(
rs
.
next
())
{
System
.
out
.
println
(
rs
.
getString
(
"stanje"
));
throw
new
AktivanZahtevPostoji
();
}
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
String
datum
=
datumIVreme
.
split
(
" "
)[
0
];
String
datum
=
datumIVreme
.
split
(
" "
)[
0
];
LocalDate
datumFormatiran
=
LocalDate
.
parse
(
datum
,
DateTimeFormatter
.
ofPattern
(
"MM/dd/yyyy"
));
LocalDate
datumFormatiran
=
LocalDate
.
parse
(
datum
,
DateTimeFormatter
.
ofPattern
(
"MM/dd/yyyy"
));
String
vreme
=
datumIVreme
.
split
(
" "
)[
1
];
String
vreme
=
datumIVreme
.
split
(
" "
)[
1
];
...
@@ -44,6 +59,7 @@ public class ZahtevRepository {
...
@@ -44,6 +59,7 @@ public class ZahtevRepository {
public
List
<
Zahtev
>
findAllByKorisnikId
(
int
korisnikId
)
public
List
<
Zahtev
>
findAllByKorisnikId
(
int
korisnikId
)
{
{
this
.
postaviFinishedZahteve
();
List
<
Zahtev
>
list
=
new
ArrayList
<
Zahtev
>();
List
<
Zahtev
>
list
=
new
ArrayList
<
Zahtev
>();
String
sql
=
"call findAllZahtevByKorisnikId(?)"
;
String
sql
=
"call findAllZahtevByKorisnikId(?)"
;
CallableStatement
stmt
=
null
;
CallableStatement
stmt
=
null
;
...
@@ -65,6 +81,7 @@ public class ZahtevRepository {
...
@@ -65,6 +81,7 @@ public class ZahtevRepository {
public
List
<
Zahtev
>
findAllByOglasId
(
int
oglasId
)
public
List
<
Zahtev
>
findAllByOglasId
(
int
oglasId
)
{
{
this
.
postaviFinishedZahteve
();
List
<
Zahtev
>
list
=
new
ArrayList
<
Zahtev
>();
List
<
Zahtev
>
list
=
new
ArrayList
<
Zahtev
>();
String
sql
=
"call findAllZahtevByOglasId(?)"
;
String
sql
=
"call findAllZahtevByOglasId(?)"
;
CallableStatement
stmt
=
null
;
CallableStatement
stmt
=
null
;
...
@@ -109,5 +126,18 @@ public class ZahtevRepository {
...
@@ -109,5 +126,18 @@ public class ZahtevRepository {
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
this
.
postaviFinishedZahteve
();
}
public
void
postaviFinishedZahteve
()
{
String
sql
=
"{ call postaviFinishedZahteve()}"
;
CallableStatement
cs
=
null
;
try
{
cs
=
dataBase
.
connection
.
prepareCall
(
sql
);
cs
.
execute
();
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
}
}
SkuciSe/src/main/resources/templates/index.html
View file @
83027bec
...
@@ -203,7 +203,7 @@
...
@@ -203,7 +203,7 @@
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
<!-- JavaScript Bundle with Popper -->
<!-- JavaScript Bundle with Popper -->
...
...
SkuciSe/src/main/resources/templates/lista-korisnika.html
View file @
83027bec
...
@@ -185,6 +185,7 @@
...
@@ -185,6 +185,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
<!-- JavaScript Bundle with Popper -->
<!-- JavaScript Bundle with Popper -->
...
...
SkuciSe/src/main/resources/templates/lista-oglasa.html
View file @
83027bec
...
@@ -379,7 +379,7 @@
...
@@ -379,7 +379,7 @@
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
...
...
SkuciSe/src/main/resources/templates/login.html
View file @
83027bec
...
@@ -161,7 +161,7 @@
...
@@ -161,7 +161,7 @@
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
<!-- JavaScript Bundle with Popper -->
<!-- JavaScript Bundle with Popper -->
...
...
SkuciSe/src/main/resources/templates/moji-zahtevi.html
View file @
83027bec
...
@@ -137,8 +137,9 @@
...
@@ -137,8 +137,9 @@
class=
"mt-55 mt-2 text-muted bold-text"
><b>
Korisnicki centar
</b><i
class=
"fa-solid fa-phone"
></i></h6><small>
<span><i
class=
"mt-55 mt-2 text-muted bold-text"
><b>
Korisnicki centar
</b><i
class=
"fa-solid fa-phone"
></i></h6><small>
<span><i
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
...
...
SkuciSe/src/main/resources/templates/novi-oglas-form.html
View file @
83027bec
...
@@ -287,7 +287,7 @@
...
@@ -287,7 +287,7 @@
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
<!-- JavaScript Bundle with Popper -->
<!-- JavaScript Bundle with Popper -->
...
...
SkuciSe/src/main/resources/templates/oglas.html
View file @
83027bec
...
@@ -107,6 +107,11 @@
...
@@ -107,6 +107,11 @@
<div><strong>
Uspesno!
</strong>
Uspesno ste poslali zahtev za obilazak!
</div>
<div><strong>
Uspesno!
</strong>
Uspesno ste poslali zahtev za obilazak!
</div>
<button
type=
"button"
class=
"btn-close"
data-dismiss=
"alert"
></button>
<button
type=
"button"
class=
"btn-close"
data-dismiss=
"alert"
></button>
</div>
</div>
<div
class=
"alert alert-warning d-flex justify-content-between align-items-center"
th:object=
"${aktivanZahtevPostoji}"
th:if=
"${aktivanZahtevPostoji == true}"
style=
"width: 96%"
>
<div><strong>
Greška!
</strong>
Vec postoji aktivan zahtev za ovaj oglas!
</div>
<button
type=
"button"
class=
"btn-close"
data-dismiss=
"alert"
></button>
</div>
<div
class=
"row mb-5 flex-row"
>
<div
class=
"row mb-5 flex-row"
>
<div
class=
"col-lg-6 col-md-6 col-sm-6"
>
<div
class=
"col-lg-6 col-md-6 col-sm-6"
>
<div
id=
"custCarousel"
class=
"carousel slide"
data-ride=
"carousel"
align=
"center"
>
<div
id=
"custCarousel"
class=
"carousel slide"
data-ride=
"carousel"
align=
"center"
>
...
@@ -316,7 +321,7 @@
...
@@ -316,7 +321,7 @@
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
...
...
SkuciSe/src/main/resources/templates/password-edit.html
View file @
83027bec
...
@@ -169,7 +169,7 @@
...
@@ -169,7 +169,7 @@
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
<!-- JavaScript Bundle with Popper -->
<!-- JavaScript Bundle with Popper -->
...
...
SkuciSe/src/main/resources/templates/profile-edit.html
View file @
83027bec
...
@@ -192,7 +192,7 @@
...
@@ -192,7 +192,7 @@
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
<!-- JavaScript Bundle with Popper -->
<!-- JavaScript Bundle with Popper -->
...
...
SkuciSe/src/main/resources/templates/profile.html
View file @
83027bec
...
@@ -194,7 +194,7 @@
...
@@ -194,7 +194,7 @@
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
<!-- JavaScript Bundle with Popper -->
<!-- JavaScript Bundle with Popper -->
...
...
SkuciSe/src/main/resources/templates/register.html
View file @
83027bec
...
@@ -207,6 +207,7 @@
...
@@ -207,6 +207,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</footer>
</div>
</div>
<!-- JavaScript Bundle with Popper -->
<!-- JavaScript Bundle with Popper -->
...
...
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