Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IntergrationProject
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
Mateusz Tomasz Kaczmarek
IntergrationProject
Commits
9c770f17
Commit
9c770f17
authored
9 months ago
by
Snorre Hareide Hansen
Browse files
Options
Downloads
Patches
Plain Diff
Moved forum to forum button instead of under the game
parent
7ad62660
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!30
Frontend fixes
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Project/static/game.html
+2
-21
2 additions, 21 deletions
Project/static/game.html
Project/static/js/game.js
+48
-2
48 additions, 2 deletions
Project/static/js/game.js
Project/static/style/style_game.css
+2
-2
2 additions, 2 deletions
Project/static/style/style_game.css
with
52 additions
and
25 deletions
Project/static/game.html
+
2
−
21
View file @
9c770f17
...
@@ -35,9 +35,9 @@
...
@@ -35,9 +35,9 @@
<main>
<main>
<!--This is probably js instead of a list with links-->
<!--This is probably js instead of a list with links-->
<ul>
<ul>
<li><a
id=
"aiButton"
href=
"#"
>
AI
</a></li>
<li><a
id=
"myFeedButton"
href=
"#"
>
My feed
</a></li>
<li><a
id=
"gamesButton"
href=
"/games"
>
Games
</a>
</li>
<li><a
id=
"gamesButton"
href=
"/games"
>
Games
</a>
</li>
<li><a
id=
"gameButton"
href=
"#"
>
Game
</a></li>
<li><a
id=
"forumButton"
href=
"#"
>
Forum
</a></li>
</ul>
</ul>
<section
class=
"sectionMain"
id=
"sectionMain"
>
<section
class=
"sectionMain"
id=
"sectionMain"
>
...
@@ -74,25 +74,6 @@
...
@@ -74,25 +74,6 @@
</section>
</section>
</aside>
</aside>
</div>
</div>
<div
id=
"forumSection"
>
<section
>
<h2>
Game Forum
</h2>
<div
id=
"comments"
></div>
<form
id=
"commentForm"
>
<label>
Write your comment:
</label>
<br>
<textarea
id=
"comment"
></textarea>
<br>
<button
id=
"submitComment"
type=
"button"
>
Submit
</button>
</form>
</section>
<section
id=
"commentSection"
>
<h2>
Forum
</h2>
<div
id=
"forum"
></div>
</section>
</div>
<footer>
<footer>
<div>
<div>
...
...
This diff is collapsed.
Click to expand it.
Project/static/js/game.js
+
48
−
2
View file @
9c770f17
...
@@ -16,6 +16,9 @@ const eDeleteReviewButton = document.getElementById('deleteReview');
...
@@ -16,6 +16,9 @@ const eDeleteReviewButton = document.getElementById('deleteReview');
const
addDeleteButton
=
document
.
getElementById
(
'
addDelete
'
);
const
addDeleteButton
=
document
.
getElementById
(
'
addDelete
'
);
const
eSubmitCommentButton
=
document
.
getElementById
(
'
submitComment
'
);
const
eSubmitCommentButton
=
document
.
getElementById
(
'
submitComment
'
);
const
eComment
=
document
.
getElementById
(
'
comment
'
);
const
eComment
=
document
.
getElementById
(
'
comment
'
);
const
forumButton
=
document
.
getElementById
(
'
forumButton
'
);
const
sectionMain
=
document
.
getElementById
(
'
sectionMain
'
);
const
gameButton
=
document
.
getElementById
(
'
gameButton
'
);
const
loginButton
=
document
.
getElementById
(
'
loginButton
'
);
const
loginButton
=
document
.
getElementById
(
'
loginButton
'
);
const
userPageButton
=
document
.
getElementById
(
'
userPageButton
'
);
const
userPageButton
=
document
.
getElementById
(
'
userPageButton
'
);
...
@@ -53,8 +56,8 @@ onAuthStateChanged(auth, async (user) => {
...
@@ -53,8 +56,8 @@ onAuthStateChanged(auth, async (user) => {
if
(
user
)
{
if
(
user
)
{
currentUser
=
user
currentUser
=
user
c
onst
idToken
=
await
user
.
getIdToken
();
c
urrentUser
.
idToken
=
await
user
.
getIdToken
();
getUserGameData
(
idToken
);
getUserGameData
(
currentUser
.
idToken
);
}
else
{
}
else
{
eReviewForm
.
innerHTML
=
""
;
eReviewForm
.
innerHTML
=
""
;
addDeleteButton
.
disabled
=
"
disabled
"
;
addDeleteButton
.
disabled
=
"
disabled
"
;
...
@@ -131,6 +134,49 @@ function getUserGameData(token) {
...
@@ -131,6 +134,49 @@ function getUserGameData(token) {
showReviews
();
showReviews
();
showComments
();
showComments
();
forumButton
.
addEventListener
(
'
click
'
,
function
(
event
)
{
// Clear the sectionMain content
sectionMain
.
innerHTML
=
''
;
// Create the forum section HTML
const
forumHTML
=
`
<div id="forumSection">
<section>
<h2>Game Forum</h2>
<div id="comments"></div>
<form id="commentForm">
<label>Write your comment: </label>
<br>
<textarea id="comment"></textarea>
<br>
<button id="submitComment" type="button">Submit</button>
</form>
</section>
<section id="commentSection">
<h2>Forum</h2>
<div id="forum"></div>
</section>
</div>
`
;
// Insert the forum HTML into sectionMain
sectionMain
.
innerHTML
=
forumHTML
;
showComments
();
});
gameButton
.
addEventListener
(
'
click
'
,
async
(
e
)
=>
{
e
.
preventDefault
();
sectionMain
.
innerHTML
=
''
;
getGameData
();
if
(
currentUser
&&
currentUser
.
idToken
)
{
getUserGameData
(
currentUser
.
idToken
);
}
else
{
console
.
error
(
"
User token is missing or invalid.
"
);
}
});
// Submit review and rating
// Submit review and rating
eFormButton
.
addEventListener
(
'
click
'
,
async
(
e
)
=>
{
eFormButton
.
addEventListener
(
'
click
'
,
async
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
...
...
This diff is collapsed.
Click to expand it.
Project/static/style/style_game.css
+
2
−
2
View file @
9c770f17
...
@@ -10,7 +10,7 @@ h1, h2, h4, p{ /*text for some reason has a invisible margin, removing this*/
...
@@ -10,7 +10,7 @@ h1, h2, h4, p{ /*text for some reason has a invisible margin, removing this*/
margin
:
0
;
margin
:
0
;
padding
:
5px
;
padding
:
5px
;
}
}
/*
#forumSection {
#forumSection {
color : white;
color : white;
width: 95%;
width: 95%;
...
@@ -20,4 +20,4 @@ h1, h2, h4, p{ /*text for some reason has a invisible margin, removing this*/
...
@@ -20,4 +20,4 @@ h1, h2, h4, p{ /*text for some reason has a invisible margin, removing this*/
overflow: auto;
overflow: auto;
background-color: rgb(57, 62, 70);
background-color: rgb(57, 62, 70);
}
}*/
\ No newline at end of file
\ 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