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
5d8aa8df
Commit
5d8aa8df
authored
Sep 17, 2022
by
Bogdan Andjelkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
poruke: uradjeni linkovi za dm, uradjen window, jos ostao stil windowa
parent
0c2cd067
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
42 deletions
+31
-42
SkuciSe/src/main/java/com/example/SkuciSe/configuration/WebSocket/WSService.java
+2
-1
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppController.java
+5
-1
SkuciSe/src/main/java/com/example/SkuciSe/controller/ZahtevController.java
+11
-2
SkuciSe/src/main/resources/static/js/socket.js
+6
-1
SkuciSe/src/main/resources/templates/chat.html
+0
-36
SkuciSe/src/main/resources/templates/moji-zahtevi.html
+5
-1
SkuciSe/src/main/resources/templates/oglas.html
+2
-0
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/configuration/WebSocket/WSService.java
View file @
5d8aa8df
...
@@ -14,7 +14,7 @@ public class WSService {
...
@@ -14,7 +14,7 @@ public class WSService {
this
.
messagingTemplate
=
messagingTemplate
;
this
.
messagingTemplate
=
messagingTemplate
;
}
}
public
void
notifyUser
(
final
String
mail
,
final
Message
message
)
{
public
void
notifyUser
(
final
String
mail
,
final
Message
message
)
{
ResponseMessage
responseMessage
=
new
ResponseMessage
(
message
.
getFrom
()
+
" "
+
message
.
getMessageContent
());
ResponseMessage
responseMessage
=
new
ResponseMessage
(
message
.
getFrom
()
+
"
:
"
+
message
.
getMessageContent
());
messagingTemplate
.
convertAndSendToUser
(
mail
,
"/topic/private-messages"
,
responseMessage
);
messagingTemplate
.
convertAndSendToUser
(
mail
,
"/topic/private-messages"
,
responseMessage
);
}
}
}
}
\ No newline at end of file
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppController.java
View file @
5d8aa8df
...
@@ -82,8 +82,12 @@ public class AppController
...
@@ -82,8 +82,12 @@ public class AppController
return
"portfolio"
;
return
"portfolio"
;
}
}
@GetMapping
(
"/chat"
)
@GetMapping
(
"/chat"
)
public
String
getChat
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
){
public
String
getChat
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
,
@RequestParam
(
"email"
)
String
email
)
{
if
(
loggedUser
==
null
)
return
"redirect:/moji-zahtevi"
;
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
model
.
addAttribute
(
"sagovornik"
,
kRepo
.
findByEmail
(
email
));
return
"chat"
;
return
"chat"
;
}
}
}
}
SkuciSe/src/main/java/com/example/SkuciSe/controller/ZahtevController.java
View file @
5d8aa8df
...
@@ -2,10 +2,12 @@ package com.example.SkuciSe.controller;
...
@@ -2,10 +2,12 @@ package com.example.SkuciSe.controller;
import
com.example.SkuciSe.configuration.AktivanZahtevPostoji
;
import
com.example.SkuciSe.configuration.AktivanZahtevPostoji
;
import
com.example.SkuciSe.model.komentar.Komentar
;
import
com.example.SkuciSe.model.komentar.Komentar
;
import
com.example.SkuciSe.model.korisnik.Korisnik
;
import
com.example.SkuciSe.model.korisnik.KorisnikDetails
;
import
com.example.SkuciSe.model.korisnik.KorisnikDetails
;
import
com.example.SkuciSe.model.oglas.Oglas
;
import
com.example.SkuciSe.model.oglas.Oglas
;
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
com.example.SkuciSe.repository.KorisnikRepository
;
import
com.example.SkuciSe.repository.OglasRepository
;
import
com.example.SkuciSe.repository.OglasRepository
;
import
com.example.SkuciSe.repository.SlikeRepository
;
import
com.example.SkuciSe.repository.SlikeRepository
;
import
com.example.SkuciSe.repository.ZahtevRepository
;
import
com.example.SkuciSe.repository.ZahtevRepository
;
...
@@ -30,21 +32,27 @@ public class ZahtevController {
...
@@ -30,21 +32,27 @@ public class ZahtevController {
ZahtevRepository
zRepo
;
ZahtevRepository
zRepo
;
@Autowired
@Autowired
OglasRepository
oRepo
;
OglasRepository
oRepo
;
@Autowired
@Autowired
SlikeRepository
sRepo
;
SlikeRepository
sRepo
;
@Autowired
KorisnikRepository
kRepo
;
@GetMapping
(
"/profile/moji-zahtevi"
)
@GetMapping
(
"/profile/moji-zahtevi"
)
public
String
getMojiZahtevi
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
public
String
getMojiZahtevi
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
{
List
<
Zahtev
>
mojiZahtevi
=
zRepo
.
findAllByKorisnikId
(
loggedUser
.
getKorisnik
().
getKorisnikId
());
List
<
Zahtev
>
mojiZahtevi
=
zRepo
.
findAllByKorisnikId
(
loggedUser
.
getKorisnik
().
getKorisnikId
());
List
<
Oglas
>
mojiOglasi
=
new
ArrayList
<
Oglas
>();
List
<
Oglas
>
mojiOglasi
=
new
ArrayList
<
Oglas
>();
List
<
Korisnik
>
vlasnici
=
new
ArrayList
<
Korisnik
>();
for
(
Zahtev
zahtev:
mojiZahtevi
)
for
(
Zahtev
zahtev:
mojiZahtevi
)
{
{
mojiOglasi
.
add
(
oRepo
.
findById
(
zahtev
.
getOglasId
()));
Oglas
oglas
=
oRepo
.
findById
(
zahtev
.
getOglasId
());
mojiOglasi
.
add
(
oglas
);
vlasnici
.
add
(
kRepo
.
findById
(
oglas
.
getKorisnikId
()));
}
}
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
model
.
addAttribute
(
"zahtevi"
,
mojiZahtevi
);
model
.
addAttribute
(
"zahtevi"
,
mojiZahtevi
);
model
.
addAttribute
(
"oglasi"
,
mojiOglasi
);
model
.
addAttribute
(
"oglasi"
,
mojiOglasi
);
model
.
addAttribute
(
"vlasnici"
,
vlasnici
);
model
.
addAttribute
(
"slike"
,
sRepo
.
findAllFirstPics
(
mojiOglasi
));
model
.
addAttribute
(
"slike"
,
sRepo
.
findAllFirstPics
(
mojiOglasi
));
return
"moji-zahtevi"
;
return
"moji-zahtevi"
;
}
}
...
@@ -73,6 +81,7 @@ public class ZahtevController {
...
@@ -73,6 +81,7 @@ public class ZahtevController {
zRepo
.
updateZahtevStatus
(
zahtevId
,
StanjeZahteva
.
POTVRDJEN
);
zRepo
.
updateZahtevStatus
(
zahtevId
,
StanjeZahteva
.
POTVRDJEN
);
return
(
"redirect:/lista-oglasa/"
+
oglasId
);
return
(
"redirect:/lista-oglasa/"
+
oglasId
);
}
}
@GetMapping
(
"/oglas-edit/{oglasId}/odbi-zahtev/{zahtevId}"
)
@GetMapping
(
"/oglas-edit/{oglasId}/odbi-zahtev/{zahtevId}"
)
public
String
getOdbiZahtev
(
Model
model
,
@PathVariable
(
"oglasId"
)
int
oglasId
,
@PathVariable
(
"zahtevId"
)
int
zahtevId
)
public
String
getOdbiZahtev
(
Model
model
,
@PathVariable
(
"oglasId"
)
int
oglasId
,
@PathVariable
(
"zahtevId"
)
int
zahtevId
)
{
{
...
...
SkuciSe/src/main/resources/static/js/socket.js
View file @
5d8aa8df
var
stompClient
=
null
;
var
stompClient
=
null
;
var
email
=
new
URLSearchParams
(
window
.
location
.
search
).
get
(
"email"
);
console
.
log
(
"To: "
+
email
);
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
console
.
log
(
"Index page is ready"
);
console
.
log
(
"Index page is ready"
);
connect
();
connect
();
...
@@ -25,5 +28,6 @@ function showMessage(message) {
...
@@ -25,5 +28,6 @@ function showMessage(message) {
function
sendPrivateMessage
()
{
function
sendPrivateMessage
()
{
console
.
log
(
"sending private message"
);
console
.
log
(
"sending private message"
);
stompClient
.
send
(
"/ws/private-message"
,
{},
JSON
.
stringify
({
'from'
:
""
,
'to'
:
$
(
"#to"
).
val
(),
'messageContent'
:
$
(
"#private-message"
).
val
()}));
stompClient
.
send
(
"/ws/private-message"
,
{},
JSON
.
stringify
({
'from'
:
""
,
'to'
:
email
/*$("#to").val()*/
,
'messageContent'
:
$
(
"#private-message"
).
val
()}));
$
(
"#private-message"
).
val
(
""
);
}
}
\ No newline at end of file
SkuciSe/src/main/resources/templates/chat.html
View file @
5d8aa8df
...
@@ -114,8 +114,6 @@
...
@@ -114,8 +114,6 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"private-message"
>
Private Message
</label>
<label
for=
"private-message"
>
Private Message
</label>
<input
type=
"text"
id=
"private-message"
class=
"form-control"
placeholder=
"Enter your message here..."
>
<input
type=
"text"
id=
"private-message"
class=
"form-control"
placeholder=
"Enter your message here..."
>
<label
for=
"private-message"
>
To
</label>
<input
type=
"text"
id=
"to"
class=
"form-control"
placeholder=
"Enter your message here..."
>
</div>
</div>
<button
id=
"send-private"
class=
"btn btn-default"
type=
"button"
>
Send Private Message
</button>
<button
id=
"send-private"
class=
"btn btn-default"
type=
"button"
>
Send Private Message
</button>
</form>
</form>
...
@@ -137,40 +135,6 @@
...
@@ -137,40 +135,6 @@
</div>
</div>
</section>
</section>
<div
class=
"container-fluid pb-0 mb-0 justify-content-center text-light "
>
<footer>
<div
class=
"row my-5 justify-content-center py-5"
>
<div
class=
"col-11"
>
<div
class=
"row "
>
<div
class=
"col-xl-8 col-md-4 col-sm-4 col-12 my-auto mx-auto a"
><h3
class=
"text-muted mb-md-0 mb-5 bold-text"
>
SkuciSe
</h3></div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-12"
><h6
class=
"mb-3 mb-lg-4 bold-text "
><b>
MENI
</b><i
class=
"fa-solid fa-bars"
></i></h6>
<ul
class=
"list-unstyled"
>
<li><a
href=
"/index"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
Pocetna
</a></li>
<li><a
href=
"/onama"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
O nama
</a></li>
<li><a
href=
"/portfolio"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
Portfolio
</a></li>
</ul>
</div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-12"
><h6
class=
"mb-3 mb-lg-4 text-muted bold-text mt-sm-0 mt-5"
><b>
ADRESA
</b><i
class=
"fa-solid fa-map-pin"
></i></h6>
<p><a
href=
"http://maps.google.com/maps?daddr=Radoja Domanovića 12 Kragujevac&"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
Radoja Domanovića 12 Kragujevac 34000
</a></p>
</div>
<div
class=
"row "
>
<div
class=
"col-xl-8 col-md-4 col-sm-4 col-auto my-md-0 mt-5 order-sm-1 order-3 align-self-end"
><p
class=
"social text-muted mb-0 pb-0 bold-text"
><span
class=
"mx-2"
><i
class=
"fa fa-facebook"
aria-hidden=
"true"
></i></span>
<span
class=
"mx-2"
><i
class=
"fa fa-linkedin-square"
aria-hidden=
"true"
></i></span>
<span
class=
"mx-2"
><i
class=
"fa fa-twitter"
aria-hidden=
"true"
></i></span>
<span
class=
"mx-2"
><i
class=
"fa fa-instagram"
aria-hidden=
"true"
></i></span></p><small
class=
"rights"
><span>
®
</span>
SkuciSe. Sva prava zadrzana.
</small></div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-auto order-1 align-self-end "
><h6
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>
</div>
</div>
</div></div>
</footer>
</div>
<!-- JavaScript Bundle with Popper -->
<!-- JavaScript Bundle with Popper -->
<script
src=
"//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"
></script>
<script
src=
"//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"
></script>
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"
></script>
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"
></script>
...
...
SkuciSe/src/main/resources/templates/moji-zahtevi.html
View file @
5d8aa8df
...
@@ -160,7 +160,7 @@
...
@@ -160,7 +160,7 @@
</form>
</form>
</div>
</div>
<div
class=
"col-5 d-flex align-items-center flex-row justify-content-center"
>
<div
class=
"col-5 d-flex align-items-center flex-row justify-content-center"
>
<form
method=
"get"
th:action=
"@{/profile/moji-zahtevi/sacuvaj-komentar}"
>
<form
method=
"get"
th:action=
"@{/profile/moji-zahtevi/sacuvaj-komentar}"
th:if=
"${zahtevi[oglasStat.count - 1].status.toString() == 'POTVRDJEN'}"
>
<div
class=
"col-4 h-100"
>
<div
class=
"col-4 h-100"
>
<div
class=
"w-100 h-100 d-flex justify-content-center align-items-center"
>
<div
class=
"w-100 h-100 d-flex justify-content-center align-items-center"
>
<input
type=
"text"
name=
"komentar"
/>
<input
type=
"text"
name=
"komentar"
/>
...
@@ -188,6 +188,10 @@
...
@@ -188,6 +188,10 @@
</div>
</div>
</form>
</form>
</form>
</form>
<div>
<p
th:text=
"'Vlasnik: ' + ${vlasnici[oglasStat.count - 1].ime}"
></p>
<a
th:href=
"'/chat?email='+${vlasnici[oglasStat.count - 1].email}"
target=
"_blank"
onclick=
"window.open(this.href,'mywindow','menubar=1,resizable=0,width=500,height=900')"
>
Posaljite poruku
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
SkuciSe/src/main/resources/templates/oglas.html
View file @
5d8aa8df
...
@@ -280,6 +280,8 @@
...
@@ -280,6 +280,8 @@
Email:
<span
th:text=
"${korisnik.getEmail()}"
></span><br>
Email:
<span
th:text=
"${korisnik.getEmail()}"
></span><br>
Telefon:
<span
th:text=
"${korisnik.getTelefon()}"
></span>
Telefon:
<span
th:text=
"${korisnik.getTelefon()}"
></span>
</p>
</p>
<a
th:href=
"'/chat?email='+${korisnik.email}"
target=
"_blank"
onclick=
"window.open(this.href,'mywindow','menubar=1,resizable=0,width=500,height=900')"
>
Posaljite poruku
</a>
</div>
</div>
</div>
</div>
<div
class=
"col-md-3 d-flex flex-column justify-content-around align-items-center"
>
<div
class=
"col-md-3 d-flex flex-column justify-content-around align-items-center"
>
...
...
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