Commit 5beaa47b authored by Liing Pang Ryan's avatar Liing Pang Ryan
Browse files

Removed publish story during story creation, modified some buttons

parent f4c1af80
......@@ -110,22 +110,21 @@ public class CreateStory extends HttpServlet {
//Recupération des données
String title = request.getParameter("title");
String textfirstParagraph = request.getParameter("firstParagraph");
int published = request.getParameter("published") != null ? 1 : 0;
int access = request.getParameter("access") != null ? 1 : 0;
String firstChoice = request.getParameter("firstChoice");
try {
//MAJ ParagraphDAO pour premier paragraph
//MAJ ParagraphDAO pour premier paragraph
ParagraphDAO paraDAO = new ParagraphDAO(ds);
int idFirstParagraph = paraDAO.createParagraph(textfirstParagraph, author, false, true);
if (idFirstParagraph == -1) {
//TODO failure
//TODO failure
}
ChoixDAO choixDAO = new ChoixDAO(ds);
choixDAO.addChoice(idFirstParagraph, firstChoice);
paraDAO.validateParagraph(idFirstParagraph);
//MAJ StoryDAO
int idStory = storyDAO.addStory(access, published, idFirstParagraph, title);
int idStory = storyDAO.addStory(access, 0, idFirstParagraph, title); //published = 0 by default
//Association Story-Paragraphe
paraDAO.associateStoryParagraph(idStory, idFirstParagraph);
......
......@@ -31,9 +31,6 @@ and open the template in the editor.
<input type="checkbox" name="access" id="access">
<label for="access">Story publicly accessible? (If unchecked, only invited guests can modify the story)</label>
<br>
<input type="checkbox" name="published" id="published">
<label for="published">Publish the story? (Available for public view)</label>
<br>
<input type="submit" value="Create"/>
</form>
</div>
......
......@@ -137,7 +137,7 @@
margin-top: 25px;
background-color: #0c2440;
border-radius: 30px;
width: 30%;
width: 160px;
height: 50%;
display: flex;
align-items: center;
......@@ -281,6 +281,8 @@
background-color: #5267fa;
color:white;
transition: 150ms;
cursor:pointer;
}
.connex_ins input[type="submit"]:hover{
......
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