Skip to content
Snippets Groups Projects
Commit 7d88a404 authored by Erik Bertilsson's avatar Erik Bertilsson
Browse files

Merge branch 'dev' of ssh://gitlab.liu.se/emisv011/c3

parents bc7786cc 767478d2
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ import { ...@@ -11,6 +11,7 @@ import {
loadProjectPageA, loadProjectPageA,
loadProjectPageG, loadProjectPageG,
loadProjectPageS, loadProjectPageS,
loadInitiatePage
} from "./SidebarAndHeader/pageHandler.js"; } from "./SidebarAndHeader/pageHandler.js";
import { import {
getUsers, getUsers,
...@@ -110,22 +111,53 @@ class IdeaCard { ...@@ -110,22 +111,53 @@ class IdeaCard {
this.id this.id
}" class= "expandedIdeaContent" style ="display : none;"> }" class= "expandedIdeaContent" style ="display : none;">
<div class="expandedDescriptionText"> <div class="expandedDescriptionText">
<p class="ideaCardFont" id="expandedHeader">Om ideen</p> <p class="ideaCardFontComments" id="expandedHeader">Om ideen</p>
<p id="expandedDescription">${this.description}</p> <p class="ideaCardFont" id="expandedDescription">${
this.description
}</p>
</div> </div>
<div class="expandedCommentAndButton id = "expandedCommentAndButton${ <div class="expandedCommentAndButton id = "expandedCommentAndButton${
this.id this.id
}"> }">
<div class="expandedComment"> <div class="expandedComment">
<p class="ideaCardFont">Kommentarer</p> <button class="ideaCardFontComments" id="commentsProjectCard">Kommentarer</button>
<p class="ideaCardFont">Komment 1</p>
<p class="ideaCardFont">K0mment 2</p>
</div> </div>
<div class="expandedButton"> <div class="expandedButton">
<button class="initiateProjectButton" id="initiateProjectFromCard${ <button class="initiateProjectButton" id="initiateProjectFromCard${
this.suggestionID this.suggestionID
}">Initiera Förbättringsförslag</button> }">Initiera Förbättringsförslag</button>
</div> </div>
<!-- commentsModal.html -->
<div id="commentsModal" class="modal">
<div class="modal-content">
<span class="close" id="closeModal">&times;</span>
<div id="existingComments">
<!-- Display existing comments here -->
<div class="comment-container">
<div class="comment">
<div class="comment-author">John Doe</div>
<div class="comment-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
</div>
<div class="comment">
<div class="comment-author">Jane Smith</div>
<div class="comment-text">Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>
<div class="comment">
<div class="comment-author">Erik Svensson</div>
<div class="comment-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
</div>
</div>
</div>
<form id="addCommentForm">
<input type="text" id="commentInput" name="commentInput">
<button type="button" id="addCommentBtn">Publicera</button>
</form>
</div>
</div>
</div> </div>
</div> </div>
</div>`; </div>`;
...@@ -214,6 +246,11 @@ function addListner(cardArray: { [key: number]: IdeaCard }, element: Element) { ...@@ -214,6 +246,11 @@ function addListner(cardArray: { [key: number]: IdeaCard }, element: Element) {
} }
} }
} }
if (target && target.className === "initiateProjectButton") {
const cardId = target.id.replace("initiateProjectFromCard", "");
loadInitiatePage(cardId);
}
}); });
} }
async function createNewIdeaCard( async function createNewIdeaCard(
......
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
loadProjectPageA, loadProjectPageA,
loadProjectPageG, loadProjectPageG,
loadProjectPageS, loadProjectPageS,
loadInitiatePage
} from "./SidebarAndHeader/pageHandler.js"; } from "./SidebarAndHeader/pageHandler.js";
import { projectCard, addEventListener } from "./currentProjects/currentProjects.js"; import { projectCard, addEventListener } from "./currentProjects/currentProjects.js";
...@@ -106,20 +107,57 @@ class IdeaCard { ...@@ -106,20 +107,57 @@ class IdeaCard {
</div> </div>
</div> </div>
</div> </div>
<div id="expandedContent${this.id}" class= "expandedIdeaContent" style ="display : none;"> <div id="expandedContent${
this.id
}" class= "expandedIdeaContent" style ="display : none;">
<div class="expandedDescriptionText"> <div class="expandedDescriptionText">
<p class="ideaCardFont" id="expandedHeader">Om ideen</p> <p class="ideaCardFontComments" id="expandedHeader">Om ideen</p>
<p id="expandedDescription">${this.description}</p> <p class="ideaCardFont" id="expandedDescription">${
this.description
}</p>
</div> </div>
<div class="expandedCommentAndButton id = "expandedCommentAndButton${this.id}"> <div class="expandedCommentAndButton id = "expandedCommentAndButton${
this.id
}">
<div class="expandedComment"> <div class="expandedComment">
<p class="ideaCardFont">Kommentarer</p> <button class="ideaCardFontComments" id="commentsProjectCard">Kommentarer</button>
<p class="ideaCardFont">Komment 1</p>
<p class="ideaCardFont">K0mment 2</p>
</div> </div>
<div class="expandedButton"> <div class="expandedButton">
<button class="initiateProjectButton" id="initiateProjectFromCard${this.suggestionID}">Initiera Projekt</button> <button class="initiateProjectButton" id="initiateProjectFromCard${
this.suggestionID
}">Initiera Förbättringsförslag</button>
</div> </div>
<!-- commentsModal.html -->
<div id="commentsModal" class="modal">
<div class="modal-content">
<span class="close" id="closeModal">&times;</span>
<div id="existingComments">
<!-- Display existing comments here -->
<div class="comment-container">
<div class="comment">
<div class="comment-author">John Doe</div>
<div class="comment-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
</div>
<div class="comment">
<div class="comment-author">Jane Smith</div>
<div class="comment-text">Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>
<div class="comment">
<div class="comment-author">Erik Svensson</div>
<div class="comment-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
</div>
</div>
</div>
<form id="addCommentForm">
<input type="text" id="commentInput" name="commentInput">
<button type="button" id="addCommentBtn">Publicera</button>
</form>
</div>
</div>
</div> </div>
</div> </div>
</div>`; </div>`;
...@@ -296,6 +334,11 @@ async function createNewIdeaCard( ...@@ -296,6 +334,11 @@ async function createNewIdeaCard(
} }
} }
if (target && target.className === "initiateProjectButton") {
const cardId = target.id.replace("initiateProjectFromCard", "");
loadInitiatePage(cardId);
}
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment