|
7 | 7 | <link rel="stylesheet" href="<c:url value="/resources/datetime-picker.css" />"> |
8 | 8 | <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> |
9 | 9 | <script src="<c:url value="/resources/datetime-picker.js" />"></script> |
| 10 | +<script src="<c:url value="/resources/validator.js" />"></script> |
10 | 11 |
|
11 | 12 | </head> |
12 | 13 | <body> |
|
20 | 21 | <span class="icon-bar"></span> |
21 | 22 | <span class="icon-bar"></span> |
22 | 23 | </button> |
23 | | - <a class="navbar-brand" href="info">Schedule to Reddit</a> |
| 24 | + <a class="navbar-brand" href="<c:url value="/info" />">Schedule to Reddit</a> |
24 | 25 | </div> |
25 | 26 |
|
26 | 27 | <p class="navbar-text navbar-right">Logged in as <b><c:out value="${username}"/></b> </p> |
27 | 28 |
|
28 | 29 | <!-- Collect the nav links, forms, and other content for toggling --> |
29 | 30 | <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
30 | 31 | <ul class="nav navbar-nav"> |
31 | | - <li><a href="posts">My Scheduled Posts</a></li> |
32 | | - <li><a href="post">Post to Reddit</a></li> |
33 | | - <li><a href="postSchedule">Schedule Post to Reddit</a></li> |
| 32 | + <li><a href="<c:url value="/posts" />">My Scheduled Posts</a></li> |
| 33 | + <li><a href="<c:url value="/post" />">Post to Reddit</a></li> |
| 34 | + <li><a href="<c:url value="/postSchedule" />">Schedule Post to Reddit</a></li> |
34 | 35 | </ul> |
35 | 36 |
|
36 | 37 | </div><!-- /.navbar-collapse --> |
37 | 38 | </div><!-- /.container-fluid --> |
38 | 39 | </nav> |
39 | 40 | <div class="container"> |
40 | 41 | <h1>Edit Scheduled Post</h1> |
41 | | -<form action="<c:url value="/updatePost/${post.getId()}" />" method="post"> |
| 42 | +<form action="<c:url value="/updatePost/${post.getId()}" />" method="post" role="form" data-toggle="validator"> |
42 | 43 | <div class="row"> |
43 | 44 | <input type="hidden" name="id" value="${post.getId()}"/> |
44 | 45 | <div class="form-group"> |
45 | 46 | <label class="col-sm-3">Title</label> |
46 | | - <span class="col-sm-9"><input name="title" placeholder="title" class="form-control" value="${post.getTitle()}" required/></span> |
| 47 | + <span class="col-sm-9"><input name="title" placeholder="title" class="form-control" value="${post.getTitle()}" required data-minlength="3"/></span> |
47 | 48 | </div> |
48 | 49 | <br><br> |
49 | 50 | <div class="form-group"> |
50 | 51 | <label class="col-sm-3">Url</label> |
51 | | - <span class="col-sm-9"><input name="url" placeholder="url" class="form-control" value="${post.getUrl()}" required/></span> |
| 52 | + <span class="col-sm-9"><input name="url" type="url" placeholder="url" class="form-control" value="${post.getUrl()}" required data-minlength="3"/></span> |
52 | 53 | </div> |
53 | 54 | <br><br> |
54 | 55 | <div class="form-group"> |
55 | 56 | <label class="col-sm-3">Subreddit</label> |
56 | | - <span class="col-sm-9"><input name="sr" placeholder="Subreddit" class="form-control" value="${post.getSubreddit()}" required/></span> |
| 57 | + <span class="col-sm-9"><input name="sr" placeholder="Subreddit" class="form-control" value="${post.getSubreddit()}" required data-minlength="3"/></span> |
57 | 58 | </div> |
58 | 59 | <br><br> |
59 | 60 | <div class="col-sm-3"> |
60 | | -<input type="checkbox" name="sendreplies" value="true" <c:if test="${post.isSendReplies()=='true'}"> checked </c:if> /> Send replies to my inbox |
| 61 | +<label>Send replies to my inbox</label> <input type="checkbox" name="sendreplies" value="true" <c:if test="${post.isSendReplies()=='true'}"> checked </c:if> /> |
61 | 62 | </div> |
62 | 63 | <br><br> |
63 | 64 |
|
64 | 65 | <label class="col-sm-3">Submission Date</label> |
65 | | -<span class="col-sm-9"><input type="text" name="date" class="form-control" value="${dateValue}"></span> |
| 66 | +<span class="col-sm-9"><input type="text" name="date" class="form-control" value="${dateValue}" readonly></span> |
66 | 67 | <script type="text/javascript"> |
67 | 68 | $(function(){ |
68 | 69 | $('*[name=date]').appendDtpicker({"inline": true}); |
|
0 commit comments