Advertisement
Guest User

Untitled

a guest
May 27th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.68 KB | None | 0 0
  1. <!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
  2.  
  3. <html xmlns:layout="http://www.w3.org/1999/xhtml"
  4.      xmlns:th="http://www.thymeleaf.org">
  5.  
  6.  
  7. <head>
  8.     <title>Kursas</title>
  9.     <meta charset="utf-8">
  10.     <meta name="viewport" content="width=device-width, initial-scale=1">
  11.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  12.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  13.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  14.  
  15. </head>
  16. <body>
  17. <center>
  18.     <div align="right"><a href="/logout"><b>LOGOUT<b></b></b></a></div>
  19.     <a class="btn btn-primary" href="/student_teacher/purchased_courses" role="button">Purchased courses</a>
  20.     <a class="btn btn-primary" href="/student_teacher/created_courses" role="button">Created courses</a>
  21.     <a class="btn btn-primary" href="/user/courses" role="button">Courses</a>
  22.     <a class="btn btn-primary" href="/user/courses_forum" role="button">Courses forum</a>
  23.  
  24. <div layout:fragment="content">
  25.     <h1>Sukurti Kursą</h1>
  26.     <form class="form-horizontal" th:object="${course}" th:action="@{'/student_teacher/created_course_submitted'}">
  27.         <input type="hidden" th:field="*{id}" />
  28.         <div th:class="form-group" th:classappend="${#fields.hasErrors('name')}? 'has-error'">
  29.             <label class="col-sm-2 control-label">Name</span></label>
  30.             <div class="col-md-10">
  31.                 <input type="text" class="form-control" th:field="*{name}"/>
  32.                 <span th:if="${#fields.hasErrors('name')}" th:errors="*{name}" th:class="help-block">Name error</span>
  33.             </div>
  34.         </div>
  35.         <div th:class="form-group" th:classappend="${#fields.hasErrors('description')}? 'has-error'">
  36.             <label class="col-sm-2 control-label">Description</span></label>
  37.             <div class="col-md-10">
  38.                 <textarea input type="text" class="form-control" th:field="*{description}"/></textarea>
  39.                 <span th:if="${#fields.hasErrors('description')}" th:errors="*{description}" th:class="help-block">Description error</span>
  40.             </div>
  41.         </div>
  42.         <div th:class="form-group" th:classappend="${#fields.hasErrors('price')}? 'has-error'">
  43.             <label class="col-sm-2 control-label">Price</span></label>
  44.             <div class="col-md-10">
  45.                 <input type="text" class="form-control" th:field="*{price}"/>
  46.                 <span th:if="${#fields.hasErrors('price')}" th:errors="*{price}" th:class="help-block">Price error</span>
  47.             </div>
  48.         </div>
  49.         <div th:class="form-group">
  50.             <label class="col-sm-2 control-label">Is Visible?</span></label>
  51.             <div class="col-md-1">
  52.                 <input th:type="checkbox" class="form-control" th:checked="${isVisible}"/>
  53.             </div>
  54.         </div>
  55.         <button type="submit" class="btn btn-primary pull-right">Submit</button>
  56.         <div>
  57.             <legend>Legend</legend>
  58.             <table>
  59.                 <tbody id="customTable">
  60.                 </tbody>
  61.             </table>
  62.             <input type="button" id="new-row" value="Add"/>
  63.         </div>
  64.     </form>
  65.  
  66. </div>
  67.  
  68. </center>
  69.   <script type="text/javascript">
  70.    
  71.     $("#new-row").on('click',function(){
  72.         $("#customTable").append(
  73.             "<tr>" +
  74.                 "<td>" + "<input type='text'></td>" +
  75.                 "<td><button onclick='del(this)'>X</button></td>" +
  76.             "</tr>");
  77.     })
  78.  
  79.  
  80.     function del(field) {
  81.         field.parentNode.parentNode.outerHTML = "";
  82.     }
  83. </script>
  84. </body>
  85.  
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement