Guest User

Untitled

a guest
Nov 15th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.44 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4.     <title>Spring Boot Thymeleaf Hello World Example</title>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  6.  
  7.     <link rel="stylesheet" type="text/css"
  8.          href="webjars/bootstrap/3.3.7/css/bootstrap.min.css"/>
  9.  
  10.     <link rel="stylesheet" th:href="@{/css/main.css}"
  11.          href="../../css/main.css"/>
  12.     <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
  13. </head>
  14. <body>
  15. <div th:replace="fragments/header :: header"></div>
  16.  
  17. <div class="container">
  18.     <div id="postContainer" th:unless="${specificPost == null}">
  19.  
  20.         <h1 th:text="${specificPost.title}"></h1>
  21.         <td th:text="${specificPost.creationDate}"></td>
  22.         <p th:text="${specificPost.contents}"></p>
  23.  
  24.  
  25.     </div>
  26.  
  27.  
  28.     <h3>Komentarze: </h3>
  29.     <div id="commentSection" th:switch="${true}">
  30.         <p th:case="${numberOfComments lt 1}">Brak komentarzy</p>
  31.  
  32.         <p th:case="${numberOfComments gt 0}">
  33.  
  34.             <tr th:each="comment: ${specificPost.comments}">
  35.         <p id="title" th:text="${comment.username}"></p>
  36.         <td th:text="${comment.commentsDate}"></td>
  37.         <td th:text="${comment.commentsContent}"></td>
  38.         </tr>
  39.         </p>
  40.  
  41.     </div>
  42.  
  43.     <button id="addCommentButton" type="button">Add comment</button>
  44.     <p>
  45.         This is the paragraph to end all paragraphs. You
  46.         should feel <em>lucky</em> to have seen such a paragraph in
  47.         your life. Congratulations!
  48.     </p>
  49.  
  50.  
  51.     <div style="display: none" id="addComent">
  52.         <form th:cellpadding="10px" action="#" method="POST" th:action="@{/addComment}"
  53.              th:object="${specificPost.comments[__${numberOfComments-1}__]}" id="commentForm">
  54.  
  55.             <div>Your comment:</div>
  56.             <div>
  57.                 <label>
  58.                     <textarea rows="10" cols="80" th:field="*{commentsContent}" form="commentForm">... </textarea>
  59.                 </label>
  60.             </div>
  61.             <div>
  62.                 <input type="submit" value="Add"/>
  63.             </div>
  64.         </form>
  65.     </div>
  66. </div>
  67.  
  68. <script>
  69.     $("#addCommentButton").click(function () {
  70.         $("#addComent").slideToggle("slow");
  71.     });
  72.  
  73.  
  74.     //    $("button").click(function () {
  75.     //        $("a").slideToggle("slow");
  76.     //    });
  77. </script>
  78. <div th:replace="fragments/footer :: footer">&copy; 2016 The Static Templates</div>
  79.  
  80. </body>
  81. </html>
Add Comment
Please, Sign In to add comment