|
|
|
@ -67,36 +67,62 @@ |
|
|
|
<li> |
|
|
|
<h2>Les postes</h2> |
|
|
|
<% postData.forEach(post => { %> |
|
|
|
<% if (post.isFinish) {%> |
|
|
|
<div id="postFinish"> |
|
|
|
<h2><%= post.titre %></h2> |
|
|
|
<p> |
|
|
|
<%= post.commentairePost %> |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
Récompense : <%= post.recompense %> |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
statue : Accepté |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
<% } else {%> |
|
|
|
<div id="postNotFinish"> |
|
|
|
<h2><%= post.titre %></h2> |
|
|
|
<p> |
|
|
|
Déscription : <%= post.commentaire %> |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
Récompense : <%= post.recompense %> |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
statue : en attente |
|
|
|
</p> |
|
|
|
<button id="but<%= post._id %>" data-post-id="<%= post._id %>"> |
|
|
|
Soummettre sa resolution |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<% } %> |
|
|
|
<% if (post.isFinish) {%> |
|
|
|
<div id="postFinish"> |
|
|
|
<h2><%= post.titre %></h2> |
|
|
|
<p> |
|
|
|
<%= post.commentairePost %> |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
Récompense : <%= post.recompense %> |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
statue : Accepté |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
<% } else {%> |
|
|
|
<div id="postNotFinish"> |
|
|
|
<h2><%= post.titre %></h2> |
|
|
|
<p> |
|
|
|
Déscription : <%= post.commentaire %> |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
Récompense : <%= post.recompense %> |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
statue : en attente |
|
|
|
</p> |
|
|
|
<form action="/accepter/<%= post._id %>" method="post"> |
|
|
|
<div> |
|
|
|
<label for="utilisateur">Le gagnant est : </label> |
|
|
|
<select name="utilisateur" id="utilisateur"> |
|
|
|
<% users.forEach(user => { %> |
|
|
|
<option value="<%= user.nom_dutilisateur %>"><%= user.nom_dutilisateur %></option> |
|
|
|
<% }); %> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
<button id="but<%= post._id %>"> |
|
|
|
Accepter |
|
|
|
</button> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
<% } %> |
|
|
|
<% resData.forEach(res => {%> |
|
|
|
<% if (res.postId === post._id.toString()) { %> |
|
|
|
<% console.log(res.postId) |
|
|
|
console.log(post._id) |
|
|
|
%> |
|
|
|
<div> |
|
|
|
<h3> |
|
|
|
<%= res.nom %> <%= res.prenom %> |
|
|
|
</h3> |
|
|
|
<p> |
|
|
|
<%= res.description %> |
|
|
|
</p> |
|
|
|
<img src="<%= res.imagePath %>" alt="image de la resolution"> |
|
|
|
</div> |
|
|
|
<% } %> |
|
|
|
<% }) %> |
|
|
|
<% }); %> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
|