Commit b2067cc1 authored by Abdelmoujib Megzari's avatar Abdelmoujib Megzari
Browse files

go hakim go

parent 62aa3152
......@@ -147,7 +147,12 @@ public class LookupStory extends HttpServlet {
return;//TODO
}
ArrayList<Story> stories = histoireDAO.getUserStories((String) session.getAttribute("username"));
//TODO response
for (Story story : stories) {
PrintWriter out = response.getWriter();
out.println("<div class=\"story_div\">"
+ "<a class=\"story\" href=\"LookupStory?code=1&&story_id=" + story.getId() + "\">" + story.getTitre() + "</a>"
+ "</div>");
}
}
/**
......@@ -222,7 +227,12 @@ public class LookupStory extends HttpServlet {
throws ServletException, IOException {
ArrayList<Story> stories = histoireDAO.getPublicStories();
//TODO response
PrintWriter out = response.getWriter();
for (Story story : stories) {
out.println("<div class=\"story_div\">"
+ "<a class=\"story\" href=\"LookupStory?code=1&&story_id=" + story.getId() + "\">" + story.getTitre() + "</a>"
+ "</div>");
}
}
/**
......@@ -267,8 +277,13 @@ public class LookupStory extends HttpServlet {
return;//TODO
}
ArrayList<Story> stories = histoireDAO.getInviterStories((String) session.getAttribute("username"));
PrintWriter out = response.getWriter();
for (Story story : stories) {
out.println("<div class=\"story_div\">"
+ "<a class=\"story\" href=\"LookupStory?code=1&&story_id=" + story.getId() + "\">" + story.getTitre() + "</a>"
+ "</div>");
}
//TODO response
}
}
......@@ -9,6 +9,11 @@
<c:if test="${choice['idParagrapheSuite']!=0}" var="new" scope="request">
<span class="choice ${choice['published']?'':'edit'}" id ="choice${choice['id']}" style ="${choice['published']?'':'display:none;'}" onclick="${'choose'}(${choice['idParagraphe']},${choice['idParagrapheSuite']},${storyid})">
<c:out value="${choice['texte']}"/>
<div class="edit">
<c:forEach items="${choice['required']}" var="pid">
-${pid}
</c:forEach>
</div>
</span>
</c:if>
</c:forEach>
......
......@@ -241,9 +241,12 @@ function deleteParagraphe(id){
$.post("ManageParagraph", {action:7,paragraph_id:id}).done(function (data) {
console.log(data);
if(parseInt(data)===1) {
document.getElementById(`paragraph_contents${id}`).innerHTML = ``;
let actual = parseInt(document.getElementById(`paragraph_contents${id}`).parentElement.id.substring(12));
let next = parseInt(document.getElementById(`paragraph_contents${id}`).parentElement.parentElement.id.substring(12));
choose(actual,next);
//TODO if it was a conclusion some paragraphes may need to stop being published
//TODO same problem with valide for the paragraph befor
//ToDO or maybe better PREVENT conclusion from being deleted
}else{
alert("couldn't delete this paragraphe");
}
......@@ -258,7 +261,7 @@ function associate(id){
//TODO bug detected after association the new paragraphe isn't deleted and is forever locked
let follower = parseInt(document.getElementById(`link${id}`).value);
console.log(follower);
console.log(last_lock);
let last_lock_first=document.getElementById(`paragraph_contents${id}`).parentElement.id;
$.post("AssociateParagraphChoice", {choice_id:last_lock , paragraphFollower: follower}).done(function (data) {
console.log("done");
console.log(data);
......
......@@ -2,7 +2,7 @@
<div class="side_menu hiden_menu" id="sideBar">
<div class="menu_entry"><a href="index.jsp">Home</a></div>
<div class="menu_entry"><a href="createstory.jsp">Create New Story</a></div>
<div class="menu_entry"><a href="createstory.jsp">My Stories</a></div> <!--to be modified-->
<div class="menu_entry"><a href="createstory.jsp">History</a></div> <!--to be modified-->
<div class="menu_entry"><a href="myStories.jsp">My Stories</a></div> <!--to be modified-->
<!--<div class="menu_entry"><a href="createstory.jsp">History</a></div>--> <!--to be modified-->
<div class="menu_entry"><a href="Logout">Logout</a></div>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment