diff --git a/WEB-INF/vue/compte.jsp b/WEB-INF/vue/compte.jsp index 3ac5088713e1211226569f0e34e63c77820daac2..4007fad91d0fbb337a1e3926f9b4529a217a40c8 100644 --- a/WEB-INF/vue/compte.jsp +++ b/WEB-INF/vue/compte.jsp @@ -104,7 +104,7 @@ <% if (daoThread.findByCreator(username).size() == 0){ %> <div class="p-2 mb-3"> <div class="d-flex justify-content-center align-items-center"> - <label class="fs-3">Vous n'avez pas de fil !</label> + <label class="fs-3">Vous n'avez pas de fil :</label> <a class="ms-3 align-self-center btn btn-success" href="navigation?page=creerFil">Créer un fil <i class="bi-plus-square-fill"></i></a> </div> </div> diff --git a/WEB-INF/vue/fils.jsp b/WEB-INF/vue/fils.jsp index 49133990e4432bdea00a6b86df416c4a25dfe0cf..16d5057a727f167a7917070ad07bd0fc52c1406b 100644 --- a/WEB-INF/vue/fils.jsp +++ b/WEB-INF/vue/fils.jsp @@ -67,24 +67,35 @@ <hr /> <% User user = daoUser.findByUsername((String) request.getSession().getAttribute("username")); + if (daoThread.findThreadNotFollow(user.getUsername()).size() == 0){ %> - <% for (Thread fil : daoThread.findThreadNotFollow(user.getUsername())) { %> + <div class="p-2 mb-3"> + <div class="d-flex justify-content-center align-items-center"> + <label class="fs-3">Pas de fil disponible :</label> + <a class="ms-3 align-self-center btn btn-success" href="navigation?page=creerFil">Créer un fil <i class="bi-plus-square-fill"></i></a> + </div> + </div> + <% + } else { + %> + <% for (Thread fil : daoThread.findThreadNotFollow(user.getUsername())) { %> - <div class="p-2 border border-primary border-3 rounded mb-3"> - <div class="d-flex justify-content-between"> - <div class="ms-2"> - <p class="fs-3"><%= fil.getName() %></p> - <span class="text-secondary">Par @<%= fil.getCreator()%> le <%=fil.getDate().format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))%></span> + <div class="p-2 border border-primary border-3 rounded mb-3"> + <div class="d-flex justify-content-between"> + <div class="ms-2"> + <p class="fs-3"><%= fil.getName() %></p> + <span class="text-secondary">Par @<%= fil.getCreator()%> le <%=fil.getDate().format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))%></span> + </div> + <a class="me-3 align-self-center btn btn-primary" href="thread?action=follow&id=<%=fil.getId_thread() %>">Suivre <i class="bi-heart-fill"></i></a> </div> - <a class="me-3 align-self-center btn btn-primary" href="thread?action=follow&id=<%=fil.getId_thread() %>">Suivre <i class="bi-heart-fill"></i></a> </div> - </div> - <% } %> + <% } %> - <div class="bg-light p-3 d-flex justify-content-center border-top border-3"> - <a href="#" class="btn btn-outline-secondary">Remonter <i class="bi-arrow-up"></i></a> - </div> + <div class="bg-light p-3 d-flex justify-content-center border-top border-3"> + <a href="#" class="btn btn-outline-secondary">Remonter <i class="bi-arrow-up"></i></a> + </div> + <% } %> </div> </div> </div> diff --git a/WEB-INF/vue/filsSuivis.jsp b/WEB-INF/vue/filsSuivis.jsp index a6e551d68003e8471c27b3cf6de9f034827ee387..d1721b861cb33bfb194f7a45cd92d3de63184680 100644 --- a/WEB-INF/vue/filsSuivis.jsp +++ b/WEB-INF/vue/filsSuivis.jsp @@ -64,26 +64,34 @@ <h1>Fils suivis !</h1> <hr /> - <% for (Thread fil : daoThread.findThreadFollow(user.getUsername())) { %> - - <div class="p-2 border border-primary border-3 rounded mb-3"> - <div class="d-flex justify-content-between"> - <div class="ms-2"> - <p class="fs-3"><%= fil.getName() %></p> - <span class="text-secondary">Par @<%= fil.getCreator()%> le <%=fil.getDate().format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))%></span> - </div> - <div class="d-flex"> - <a class="me-3 align-self-center btn btn-primary" href="thread?action=open&id=<%=fil.getId_thread() %>">Ouvrir <i class="bi-chat-fill"></i></a> - <a class="me-3 align-self-center btn btn-danger <% if (daoThread.isCreatorOf(user.getUsername(), fil.getId_thread())) { %> disabled <% } %>" href="thread?action=unfollow&id=<%=fil.getId_thread() %>">Ne plus suivre <i class="bi-x-circle-fill"></i></a> - </div> + <% if(daoThread.findThreadFollow(user.getUsername()).size() == 0){ %> + <div class="p-2 mb-3"> + <div class="d-flex justify-content-center align-items-center"> + <label class="fs-3">Vous ne suivez aucun fil :</label> + <a class="ms-3 align-self-center btn btn-success" href="navigation?page=fils">Voir les fils <i class="bi-threads-fill"></i></a> </div> </div> + <% } else { %> + <% for (Thread fil : daoThread.findThreadFollow(user.getUsername())) { %> + <div class="p-2 border border-primary border-3 rounded mb-3"> + <div class="d-flex justify-content-between"> + <div class="ms-2"> + <p class="fs-3"><%= fil.getName() %></p> + <span class="text-secondary">Par @<%= fil.getCreator()%> le <%=fil.getDate().format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))%></span> + </div> + <div class="d-flex"> + <a class="me-3 align-self-center btn btn-primary" href="thread?action=open&id=<%=fil.getId_thread() %>">Ouvrir <i class="bi-chat-fill"></i></a> + <a class="me-3 align-self-center btn btn-danger <% if (daoThread.isCreatorOf(user.getUsername(), fil.getId_thread())) { %> disabled <% } %>" href="thread?action=unfollow&id=<%=fil.getId_thread() %>">Ne plus suivre <i class="bi-x-circle-fill"></i></a> + </div> + </div> + </div> + <% } %> + <div class="bg-light p-3 d-flex justify-content-center border-top border-3"> + <a href="#" class="btn btn-outline-secondary">Remonter <i class="bi-arrow-up"></i></a> + </div> <% } %> - <div class="bg-light p-3 d-flex justify-content-center border-top border-3"> - <a href="#" class="btn btn-outline-secondary">Remonter <i class="bi-arrow-up"></i></a> - </div> </div> </div> </div>