Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
S4a021 Web Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Charlie Darques
S4a021 Web Backend
Commits
cae72a73
Commit
cae72a73
authored
1 month ago
by
Yannis Devos
Browse files
Options
Downloads
Patches
Plain Diff
Correction fonctionnement affichage des messages
parent
9d9f1655
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
WEB-INF/src/controleurs/Feed.java
+13
-4
13 additions, 4 deletions
WEB-INF/src/controleurs/Feed.java
WEB-INF/src/controleurs/Following.java
+1
-1
1 addition, 1 deletion
WEB-INF/src/controleurs/Following.java
css/feed.css
+22
-3
22 additions, 3 deletions
css/feed.css
with
36 additions
and
8 deletions
WEB-INF/src/controleurs/Feed.java
+
13
−
4
View file @
cae72a73
...
...
@@ -16,6 +16,7 @@ import java.io.IOException;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Locale
;
@WebServlet
(
"/Welcome"
)
public
class
Feed
extends
HttpServlet
{
...
...
@@ -54,6 +55,15 @@ public class Feed extends HttpServlet {
MyThread
msgThread
=
new
MyThread
(
0
,
null
);
if
(!
messages
.
isEmpty
())
{
try
{
Message
msg
=
messages
.
get
(
0
);
msgThread
=
threadDao
.
getThreadById
(
msg
.
getThreadId
());
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
out
.
println
(
"<h2 class=\"feedMsgThread\"> Thread : <span style=\"color : grey\">"
+
msgThread
.
getThreadName
().
toUpperCase
()
+
"</span></h2>"
);
for
(
Message
message
:
messages
)
{
try
{
msgThread
=
threadDao
.
getThreadById
(
message
.
getThreadId
());
...
...
@@ -61,8 +71,7 @@ public class Feed extends HttpServlet {
throw
new
RuntimeException
(
e
);
}
out
.
println
(
"<div class=\"message\">"
);
out
.
println
(
"<h3 class=\"msgThread\">"
+
msgThread
.
getThreadName
()
+
"</h3>"
);
out
.
println
(
"<p class=\"msgContent\">"
+
message
.
getContent
()
+
"</p>"
);
out
.
println
(
"<p class=\"msgContent\"><strong style=\"color : grey\">"
+
userDao
.
getUserById
(
message
.
getSenderId
()).
getUserName
()
+
"</strong> : "
+
message
.
getContent
()
+
"</p>"
);
boolean
msgIsLiked
=
false
;
try
{
...
...
@@ -72,7 +81,7 @@ public class Feed extends HttpServlet {
sqle
.
getStackTrace
();
}
out
.
println
(
"<form class=\"feedForm\" action=\"http://localhost:8080/s4a021-web-backend/LikeMessage\" method=\"post\">"
);
out
.
println
(
"<form
class=\"feedForm\" action=\"http://localhost:8080/s4a021-web-backend/LikeMessage\" method=\"post\">"
);
out
.
println
(
"<input name=\"messageid\" type=\"hidden\" value=\""
+
message
.
getMsgId
()
+
"\">"
);
if
(
msgIsLiked
)
{
...
...
@@ -90,7 +99,7 @@ public class Feed extends HttpServlet {
out
.
println
(
"<form class=\"feedForm\" action=\"http://localhost:8080/s4a021-web-backend/PostMessage\" method=\"post\">"
);
out
.
println
(
"<textarea name=\"message\" rows=\"2\" cols=\"30\" placeholder=\"Post a message in this thread\"></textarea>"
);
out
.
println
(
"<input name=\"threadid\" type=\"hidden\" value=\""
+
msgThread
.
getId
()
+
"\">"
);
out
.
println
(
"<button type=\"submit\">Post</button>"
);
out
.
println
(
"<button
class=\"postButton\"
type=\"submit\">Post</button>"
);
out
.
println
(
"</form>"
);
out
.
println
(
"<div class=\"discover\">"
);
...
...
This diff is collapsed.
Click to expand it.
WEB-INF/src/controleurs/Following.java
+
1
−
1
View file @
cae72a73
...
...
@@ -74,7 +74,7 @@ public class Following extends HttpServlet {
}
else
{
out
.
println
(
"<h3>You are not following any thread yet.</h3>"
);
out
.
println
(
"<button><a href=\"\">Discover new threads</a></button>"
);
out
.
println
(
"<button><a href=\"
http://localhost:8080/s4a021-web-backend/Discover
\">Discover new threads</a></button>"
);
}
out
.
println
(
"</body>"
);
...
...
This diff is collapsed.
Click to expand it.
css/feed.css
+
22
−
3
View file @
cae72a73
...
...
@@ -7,6 +7,14 @@ body{
background-color
:
#232323
;
}
toCenter
{
text-align
:
center
;
}
.feedMsgThread
{
margin-top
:
5%
;
}
.menu
{
display
:
flex
;
align-items
:
center
;
...
...
@@ -31,7 +39,7 @@ ul{
padding
:
0
;
}
form
:not
(
.followThread
,
.feedForm
)
{
form
:not
(
.followThread
,
.feedForm
,
.feedFormu
)
{
text-align
:
center
;
display
:
flex
;
flex-direction
:
column
;
...
...
@@ -41,6 +49,16 @@ form:not(.followThread, .feedForm) {
margin-top
:
5%
;
}
textarea
{
margin-top
:
1%
;
margin-right
:
auto
;
margin-left
:
auto
;
}
postButton
{
}
.menu_option
{
text-align
:
center
;
list-style
:
none
;
...
...
@@ -73,6 +91,7 @@ form>.link {
}
.discover
{
margin-top
:
5%
;
text-align
:
center
;
}
...
...
@@ -83,7 +102,7 @@ form>.link {
}
.information
{
margin-top
:
10
%
;
margin-bottom
:
2
%
;
margin-top
:
5
%
;
margin-bottom
:
5
%
;
text-align
:
center
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment